From nobody Mon Jan 13 00:41:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWYNq6fxVz5k8Wb; Mon, 13 Jan 2025 00:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWYNq683Fz417L; Mon, 13 Jan 2025 00:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGoDvMa6WzpN4Mx2g7ByFlzYlaLt64c4N/Lz1v6J8/I=; b=AjmIRk/UmRNCpYhthRKgBzHceJoaCQMOr1vFKTx/WMbssRDcmDNpM2YhXtgGXRKXaAsfnb d5Q6u+rzUcGtg5cCj/Z9tvBaksUO8K8xzdWhcEKXkoXz/0o0QHl1iT+QDFwZAbFS4ZL4fV GVGSgw4xxelVBfhbml1tK/dP84NgwIRFg28N1TC+A7CVEExXddzz402zq9iS2V9DTwNEe0 x2+RgtCN13gxbDY96r1SjBywwP35s1f5tKcuSCRxDp7rF/iZWEixtK3cGmZklHi8uVToaB kvfU4r1wH29+BxPVQKorgcFac4ombo8rlLWtGGNvtTcnSpHaYSZPmkxGANB3oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nGoDvMa6WzpN4Mx2g7ByFlzYlaLt64c4N/Lz1v6J8/I=; b=r/ktsIYSC+JUsT69UyCJBoA0/UB8TcTOW4rKY/RTWl4aV6tSQd38n0+YRXWTcoSnuTQCbP AIIyXDxIkOs2L35iuvEm7lpEEt2z/CjNTfGvdPRqV9L4cCwegdOwPQol6/sSVWg1DO3YVM bRFrLyTWYnjvf2SuEHROvGKoCa1Tza9CTfstrT5oSet+UUnS3UztLAoyOmMwtPm7OTtmZM o+5aFDPEd3/0J7eS6DMl++bTOq+41Md3+YxbZt6Yc167XsxcnjI+XLjpGG/7jFFKwnFV78 VxKhVbcXWbUy08LtS4X8K+ftRHds4EpGygCjR9E8PF/yH57ArjpQrsSLxMNsrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736728907; a=rsa-sha256; cv=none; b=G/BzOdYCetX4DLxZAXBXNGNEDQJbBIVgcvbyo5/TJfSYIjOy2Ssw2f4BUjTbS7DqFSkTUx RlQb5dxOJzHyFqIw+Uo20CwL0cuq3cOF8Muq85je+4IsYBRmjV7mFodwBrqy5wL78usREF n0CiqtvuMk45fqyOovsiZWGCNHnXV4U5urOnp8MM9x/3ouSWxxp251lGkDx1hjiPdE8PCY kzFrzPojz47cWT95EpyAmoYSMbbsb+BrdE6IzEr0MYkgZJiF8gc9DW8dZVBG/4ICxU/bKO CzZn/UyqmiebnJQBEk/F4NCObW0ON/zZSAH3pe4EIp/QNSekC2STBdZCrbRiGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWYNq5d89z16y0; Mon, 13 Jan 2025 00:41: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 50D0flAe032958; Mon, 13 Jan 2025 00:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D0flxp032955; Mon, 13 Jan 2025 00:41:47 GMT (envelope-from git) Date: Mon, 13 Jan 2025 00:41:47 GMT Message-Id: <202501130041.50D0flxp032955@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: 712f81feea41 - main - include: add a userland version of __assert_unreachable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 712f81feea416e9f8aaf040173883876a50a7d34 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=712f81feea416e9f8aaf040173883876a50a7d34 commit 712f81feea416e9f8aaf040173883876a50a7d34 Author: Kyle Evans AuthorDate: 2025-01-13 00:41:25 +0000 Commit: Kyle Evans CommitDate: 2025-01-13 00:41:37 +0000 include: add a userland version of __assert_unreachable The kernel has had a version of this since c79cee71363d ("kernel: provide panicky version of __unreachable"), and userland can benefit from the same. __unreachable is largely inadequate because it's *not* an assertion of any sort, so we're not really alerted to a problem that we could've anticipated. Reviewed by: emaste, imp, jhb, olce Differential Revision: https://reviews.freebsd.org/D48077 --- include/assert.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/assert.h b/include/assert.h index cc2a5f8b9e64..a3dbe933e18f 100644 --- a/include/assert.h +++ b/include/assert.h @@ -43,15 +43,22 @@ #undef assert #undef _assert +#undef __assert_unreachable #ifdef NDEBUG #define assert(e) ((void)0) #define _assert(e) ((void)0) +#if __BSD_VISIBLE +#define __assert_unreachable() __unreachable() +#endif /* __BSD_VISIBLE */ #else #define _assert(e) assert(e) #define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ __LINE__, #e)) +#if __BSD_VISIBLE +#define __assert_unreachable() assert(0 && "unreachable segment reached") +#endif /* __BSD_VISIBLE */ #endif /* NDEBUG */ #ifndef _ASSERT_H_ From nobody Mon Jan 13 00:41:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWYNs0b2vz5k8bk; Mon, 13 Jan 2025 00:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWYNr72vmz41Y3; Mon, 13 Jan 2025 00:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f07HTyq+dIJpJ/Ey6IamamW6pCRK3xZfrIIdqYg0ZRg=; b=HDefKKTQ41EKl3qjffC4QFj0/8rtCK4y4iF4+cuXnBA6SJeb+N4KgxbsbhCrTk49AiXCMC eVlrVbWIlsXaZrrf45Hh5NxAQMhgDyZboSItChUj7LBk3fcy83N3/ZehCcKbCj3fifBZJY dgT17Sr7OuWikXMJ5PZW9sTRkSzBsyvI5m6iSUVus/wiIjG2vpyTNkjVNlZbEmkMGtsgR8 PRp75J8k7VfMNPh4WMXIEhSNVou1OcHwvwNPK7i+D+/YssIYN1nmYy60Y18uolwX4JWaS1 J6zCksTGp0hHqKTVMCY2PcYeqlW1tUf6DrgY3TYboohD8HkjlhOwZ7wNmBTf9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f07HTyq+dIJpJ/Ey6IamamW6pCRK3xZfrIIdqYg0ZRg=; b=RzUGMx2y7IBqlgIyglGs+oWrMPdx27fLxUq5PVbxgv8sF6/2Hk/13YjAVsYIR+x40eY8Bi Tx9YL2tt8EtZF9ZRFtyBUJ6UI5FcFRJjdASzzzo6+3hQlOLgfri8erzELeWHdTIk9PQK1Q 7CJAOnxq9vQ6XVX3ZJFGUw46nu5+NVVCOh+qZQaDvrj/vorNoqvSj4Z0U56ATXRKeMKyr3 DpYq1suiKu1ReCOC7IqiLXor+rg6MvANXMhhEfnYpEteyO4Fvx+YB8TZb7RKslITm6QA32 CWau+gQO0wIV5Ntf8tUhCw5ivlj63JH1Gq2Rnu5VpomsD8Y7yNvbGWf3Yc3U/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736728909; a=rsa-sha256; cv=none; b=y3pM1TNEBfZEkbw95wTx7C6EJlm4kaArnU2hqrtqgw30g7vq2LZ8QS696wrcFU8afpS+c0 DGFxseuOO96Ip7F5LTdYDo5YfUZZepowu/9WXAe0ct4StBIaJczDxpntdecXWIQ3hj55W3 gVjDqwVODx/ZR7+/IBwWrSDQKD2GUb48ZPMcgsuV9iymmrbn3xDKrrFhN64bG3McF2kkWX yV1A44Rx169KdN68iAjdT6pltofBj//KNQEtBsxB7djK1zMcGKOioPPUDnmCewDcovFFUY HJ4ymRvAUKwAcKrd6vqrin/D6gBZcMTNsKqckBKqzn/71LXtubN+VU/EUdHdGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWYNr6bLsz16y3; Mon, 13 Jan 2025 00:41: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 50D0fmsG033047; Mon, 13 Jan 2025 00:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D0fm6G033044; Mon, 13 Jan 2025 00:41:48 GMT (envelope-from git) Date: Mon, 13 Jan 2025 00:41:48 GMT Message-Id: <202501130041.50D0fm6G033044@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: b769044f300a - main - nvmf: fix build with __assert_unreachable() addition to userland List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: b769044f300a2e8534d0581f4fa7b4a296f038fa Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b769044f300a2e8534d0581f4fa7b4a296f038fa commit b769044f300a2e8534d0581f4fa7b4a296f038fa Author: Kyle Evans AuthorDate: 2025-01-13 00:41:25 +0000 Commit: Kyle Evans CommitDate: 2025-01-13 00:41:37 +0000 nvmf: fix build with __assert_unreachable() addition to userland now has a usable definition, so we don't need to shim it out in the nvmf header anymore. Reviewed by: emaste, jhb Differential Revision: https://reviews.freebsd.org/D48078 --- sys/dev/nvmf/nvmf_tcp.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/nvmf/nvmf_tcp.h b/sys/dev/nvmf/nvmf_tcp.h index c60be0bc1024..03b5d2445928 100644 --- a/sys/dev/nvmf/nvmf_tcp.h +++ b/sys/dev/nvmf/nvmf_tcp.h @@ -9,7 +9,6 @@ #define __NVMF_TCP_H__ #ifndef _KERNEL -#define __assert_unreachable __unreachable #define MPASS assert #endif From nobody Mon Jan 13 00:43:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWYQH6yM1z5k8jK; Mon, 13 Jan 2025 00:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWYQH5qYTz42ZD; Mon, 13 Jan 2025 00:43:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eJvSFKKz2V/CsAe7zx5txveQ5fgWZTe/Mns1WTMsYSg=; b=QbsGMWuasqrMhTU0KbXauPqsbR/RUDAoTLwKiQYT6SkfwhgJVtavMi6QCt40vAUkCceBnA V4v+7EvmAoszUBTUmAxsxlpeiJXzUQJXYiKLHEg9e2jwoQOlnKNojLnKU/7AjpZrD2IbDr PEX5WJI83z1839LYCOPlTqz1b1L7n7by0e1KQ/vO8kBE2BrKVC4nG2b6rTd8QMJU0IRJOW vLYKFGENZvCY+JcfK1BUDmoyD9prhOSl2s6q9fBjfpxmqQPLr1Gczg/hub4JrYCqE7Ti7m 42bjVe5OwFE+udWOmq9Sg3NAhBYQRpYi2crHOqyAt/UJg2CqffBLcH/Xm2rtEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736728983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eJvSFKKz2V/CsAe7zx5txveQ5fgWZTe/Mns1WTMsYSg=; b=UQ5/ezqHiYQ+EojoLD1IC+iZ4Mzwjr4h5gfKkWR5+/BDIYhsgQV0CerP9MBW87BQhO+5eP Jb5g48fisXfovAwCfMPvaeqQUj0fNsCPJ5aw9gSCrgr+D2JffpYVW3UUcoeejtnIIEs+fL jEOaoPweEOiH/mk/KniLmx9v0ouu/rI776cN1PoLRWu0PAWRy2Tvj0A/HLQiRiIE+MWi5J gQdUI2IRPnA0hQsDTyAWQGxdG9tutcrL9L12lIEG9gbbIZKiHkWHlVc6mxCt8TMDE6Ftwn Fet0rQzQsytg+0ML6fSIKBhKRZM4LgCJfF6MTA1uez4h9R4EeJ2iaCZrKauI1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736728983; a=rsa-sha256; cv=none; b=xZUSv7XHiSkwrf5tw7ev9wNi/D08TbbSASFGUhn9weINXZh2Nr00mrJXzzSqgA4BUUVQlm e27qVzxh5ehLD7zsyDqVrbQzWmKI9yaAY6s36MlOmiafRL9jss99BhIKoIZvUyaSEEr8BV GCjVxdifgWg74dXRjOUaPdZcbPvcwXIIvqRuUvLHScYF2A492nSVXWrhNURTVGsbVFNVfK 5bgVfigxMYa6ZdDzPBj14eUqgu4lJhLfdAJqlZrEnDgUMjcmkK4QMgFiOCJKTfHnro3FzO TPW28ySl29MCnPdnOBDpFTD5Ba13xqwQZb2wthznCCNOkPYRUO48JzMRrZke6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWYQH5RbRz16yF; Mon, 13 Jan 2025 00:43: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 50D0h3aY036146; Mon, 13 Jan 2025 00:43:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D0h3wN036143; Mon, 13 Jan 2025 00:43:03 GMT (envelope-from git) Date: Mon, 13 Jan 2025 00:43:03 GMT Message-Id: <202501130043.50D0h3wN036143@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: 8b5058ec78a6 - main - genl: typo fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8b5058ec78a6fad972f48e6cd5613c2750f43ad6 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=8b5058ec78a6fad972f48e6cd5613c2750f43ad6 commit 8b5058ec78a6fad972f48e6cd5613c2750f43ad6 Author: Maxim Konovalov AuthorDate: 2025-01-13 00:40:47 +0000 Commit: Maxim Konovalov CommitDate: 2025-01-13 00:42:55 +0000 genl: typo fixes PR: 284017 --- usr.bin/genl/genl.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/genl/genl.1 b/usr.bin/genl/genl.1 index af0c6360ad83..253cc12e0dfc 100644 --- a/usr.bin/genl/genl.1 +++ b/usr.bin/genl/genl.1 @@ -57,7 +57,7 @@ Id of the available multicast group if any and it associated name Connect to the .Ar family protocol and subscribe to the -.Ar mulicast group +.Ar multicast group then print the received messages in a readable format if the protocol is known. So far only .Qq nlctrl @@ -65,7 +65,7 @@ and .Qq nlsysevent are known. If no .Ar multicast group -are provided then all the groups are subsribed to. +are provided then all the groups are subscribed to. .El .Sh SEE ALSO .Xr genetlink 4 , From nobody Mon Jan 13 00:46:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWYVq6VXTz5k8xs; Mon, 13 Jan 2025 00:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWYVq5TF8z43MS; Mon, 13 Jan 2025 00:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736729219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HkRZMapYj9cRa42IP3MHdjYzLO9sWvFNqcWZ1SRvjRM=; b=VfgLy0xDbA0Dy1eBMixGcTqlVjneMsTQHkhvyrVJvvt5WpJQikwWwt3/jco6dsx6xgCzZo 22OkH7hMr4O2ZUuDmfOZj2DulWSLTVzBmRzv7UzaLDKe8h+E4iGeLP3KpmoR9rKKyTKA21 ipzrHqPn6eEmxF/O1Twi/rM/P1WqaaiC+9b1k/jD+VluKjq7BaBCH5URykAfsvrRCzuWE0 mtsbcwnjG+C8Hi0xopxVrXWjkeXbp/qAY6aw/VTN+YyNzQN1IYOVbPpeD86r3n/MZwkilo P5y+8AQbt7375j27KStPvA39Y30bz+xQkplbgz82V3YAwXrxON/tzdvoq/rB2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736729219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HkRZMapYj9cRa42IP3MHdjYzLO9sWvFNqcWZ1SRvjRM=; b=UjV0vtrLOIu+5XvRBqfL54GTKl9fVAjiSHH6r12mklJUkg94XGpruxJ7xB9tF/6K9JWYvN vqyXJXvJxFpSWfHcH4r1ySNHRLQ48j/Dl3445no2wVrjjAxKEnNgykINCvWcKpvMJ4EK5H +Q4z4YGQhydoX+2lTI96plpT+wc65zcOnEEACjBI2arR7ki2t7C7PInsJMA0xvrELQqqvq RwQG5Q/5SMxTkBJZk9MpPzLVWu2KtEvTxBatkHL/HmMCfgJmoO777aH8RPRT/iolhtJcFe 1i/134i2gB/+WFrPKgv++arvxSCIGsiwi6hY5mU3q/Wzd4KonOoAE6Z/OJI3Ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736729219; a=rsa-sha256; cv=none; b=P6ipQE17VteC3edAQoFRd5lZFxDRw2YvbHZ7VcCS+ctjN/bJ/6hjtbS17Sq6hgNAaXmVv5 oB7kZYJGzSgHUp2yDQK245iEr6zbkVg7sw04J096LRWHNkYR97HmE79CaqVD2qJ70Z5GSB AOLRh5ygTiOm+nKVF7fs1xuwm5FrO2oQNRqwSIcdWK73tkxQ+xRpf9dGyLF+cU8eDwYl/4 x3QBfX1fwTs6dWi4FgHg5lGbTF+ALSKe2+2LZ1D1VE5LQaM/C2xm4SlFzLAiyj8X+h9DcT Fgrrd41jTK+PO4n80jRGQh/6HFDOrsnAD2y7SGgs+LBP08tvz6gvwFnkn+P5Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWYVq4llhz16kc; Mon, 13 Jan 2025 00:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50D0kx1S037489; Mon, 13 Jan 2025 00:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D0kxFL037486; Mon, 13 Jan 2025 00:46:59 GMT (envelope-from git) Date: Mon, 13 Jan 2025 00:46:59 GMT Message-Id: <202501130046.50D0kxFL037486@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: 0340a8c969d1 - main - genl: formatting fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 0340a8c969d1619bdcbd6ef64dd9202b2269d3f8 Auto-Submitted: auto-generated The branch main has been updated by maxim: URL: https://cgit.FreeBSD.org/src/commit/?id=0340a8c969d1619bdcbd6ef64dd9202b2269d3f8 commit 0340a8c969d1619bdcbd6ef64dd9202b2269d3f8 Author: Maxim Konovalov AuthorDate: 2025-01-13 00:46:29 +0000 Commit: Maxim Konovalov CommitDate: 2025-01-13 00:46:29 +0000 genl: formatting fix --- usr.bin/genl/genl.1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/genl/genl.1 b/usr.bin/genl/genl.1 index 253cc12e0dfc..e11bfbc440ab 100644 --- a/usr.bin/genl/genl.1 +++ b/usr.bin/genl/genl.1 @@ -63,7 +63,8 @@ So far only .Qq nlctrl and .Qq nlsysevent -are known. If no +are known. +If no .Ar multicast group are provided then all the groups are subscribed to. .El From nobody Mon Jan 13 04:24:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWfL045tbz5kSr6; Mon, 13 Jan 2025 04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWfL03RG8z56pK; Mon, 13 Jan 2025 04: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=1736742280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7U1XaJIo3WoJPlZ+nBVgKz8wn2KOzdNCaDRn1NKjCNk=; b=iz/cPXYNKSlvYvyJ5sxRcai5I9yVEsuCNISmc5M9kkoXThozYX52gSrpIYYAvY8rCp2zfL j639W/VlCbqYagSWXQDu/rW+dwB2iHjOSSwBngEhwg/gX1XKE4rciXtXY1fiaRrJaO2Rcl 8jyObOreknZuoPQB0d7tmGYHBi0wWFE3ZEEdtLpSGstE0sa268Sl5PF3zG4NTUQswpg6g7 WXz9Z1E58ADXn1M3rOkm+8ZO8P8vOwW0AkWFZyNGYtjmISWjjnrNukYhNNC5P9VcPqaHLA rojZzzdz5Pxcq5AeRmhshIl84llfrwvREa/tWSUoQtSmvF4iwe/+N384l9HMqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736742280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7U1XaJIo3WoJPlZ+nBVgKz8wn2KOzdNCaDRn1NKjCNk=; b=Kb4wM2ySk9e8lbtL8bNTdXyJ5BjyhWu9F/z+yflW53ijwuxAWBNTTD3Yr5ul3mfoA+4DPm T+cueztXJEX6BHgnjoI4IBGhsVKxWOnhuR2LDzGZkJhMNNdTZefhJfFJOOrySngPHjUIim c3bsc4Li5F+71ARmTlVwcv57yNbx/EEW4KMWvy8C99anJMTaA3/el1GrH9G2fC36bc1+/U vIcXmLASqPlMGD0BRWm0lJonNTzBA3rszs0Nb2kjprpFcdDiJNLXRLuOSzh0nk9zyj+D/H yQNpM5zRIXwRBwQ/skBGBqg4yMkTZLeryzr5ogCAyaRksYl0tKncFiI9cezXpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736742280; a=rsa-sha256; cv=none; b=DGAiPDs9ACdGgUge01tbBH0H8h1aSsf8Iz+Dt1NHdHJpjsn41wf/NXW0AFMZnNa7qBVh9z 6X91Q4c/apbXk/af2hqlK+pKzv0zRSX2uWGkD6mBg6uxlKtr98c/NOdQrBtOQw3hA5Z+Kx MzIrGln9lFTWQYhnG2khJ7XE0Fsg9pXkvPZOp8KjlfoCJctFUhJbe4mSO/wdV8ZIGHNSTw LPDzYWTh0cOq3yzVNb/l6CmXMhqppvsEHf6+N1gt2D6vVb7pCc1nkv7CGVDl+rrQSmi7bs 2q1/aA1xwCJYm//QGzEKT0iKhBFaIkqQBhRtMFSDBSAJh2jH4rpb7B1xIZEqPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWfL02kbszhG; Mon, 13 Jan 2025 04: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 50D4Oecp050387; Mon, 13 Jan 2025 04: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 50D4OeFq050384; Mon, 13 Jan 2025 04:24:40 GMT (envelope-from git) Date: Mon, 13 Jan 2025 04:24:40 GMT Message-Id: <202501130424.50D4OeFq050384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: e6de39be80e2 - stable/14 - MFC: libmagic: Unbreak for older FreeBSD releases. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6de39be80e2283517f3c51d3d238d851435898e Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=e6de39be80e2283517f3c51d3d238d851435898e commit e6de39be80e2283517f3c51d3d238d851435898e Author: Xin LI AuthorDate: 2025-01-08 04:42:16 +0000 Commit: Xin LI CommitDate: 2025-01-13 04:24:19 +0000 MFC: libmagic: Unbreak for older FreeBSD releases. PR: bin/273736 Reported by: philip (cherry picked from commit 7f8f120439b77e60a1070d87f4dc6cb9a43d0335) --- lib/libmagic/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 12cd382ab9bb..d642880d6096 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -1,6 +1,9 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +/* FreeBSD */ +#include + /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ @@ -21,8 +24,10 @@ /* Define to 1 if you have the header file. */ #ifndef __APPLE__ /* Cross building tools on macOS */ +#if __FreeBSD_version >= 1400079 || (__FreeBSD_version < 1400000 && __FreeBSD_version >= 1302500) #define HAVE_BYTESWAP_H 1 #endif +#endif /* Define to 1 if you have the header file. */ /* #undef HAVE_BZLIB_H */ From nobody Mon Jan 13 04:25:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWfM473Nxz5kSp2; Mon, 13 Jan 2025 04:25:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWfM46bQdz57C0; Mon, 13 Jan 2025 04:25:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736742336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a1G6/t4iF2YtEXUQinj6JYQCSJ0TQEjX6LpnaGTsP+o=; b=MS21ymLNNUYUPYRJ0xYs6H3nR0Sa2oM2n1K5G+AYcNgvy4vsJUuBFtRYtEIyjIO74gnudp ZuJPUzc1W1oJrSZq/F4ft5fqgcHy7Jqz4b1obJSROnwW+HWhFAgry/PVy/wUF4cMuED7oi atCE17C/nzzTDsLprmQNx+iqydlOuOufskVzhGC7ZgZP1mf6OXGwehRCEoHpNqukX9hWY2 4Zkpu3vl/glHnSAV8i0my2Hn7rvR6syt1x1m32fhgS9i5nx7foamYe8LQQZuAtr8BZRXY9 kEup+CqeS2Ea2WrO5TydOABrK9W60s87kO0pUUscd6wnIF2XxdyxULQgbMZsjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736742336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a1G6/t4iF2YtEXUQinj6JYQCSJ0TQEjX6LpnaGTsP+o=; b=LZEFcrkwTMBBGY9aKtKRNeRDO2ChBNU9IgSOeRBsPshTdv2HKHnAbxLZOWn0Y/AMaBPMJ4 /5V2v2A3fgsL8QNhFWgwm47H8l6vbb3zVuaQHMkAuzGAWM6HhJEIShtpAz0YO3GiMd/rC7 SzYD2Rp7f+zw8TTolV48i8KyLjhL6UU0OG7VsE7PT5GP91b0O2iyu/UUO051zWtQFruag6 u+BlzNwOG7kve8FiJozpXipu7A3Bt+A0NC+iIWqqEr61spjCyQjLKSDjKtv58MfV3UvmZB RbXPtDeoWRC+5B8qTFSP8bNCNlIP1GtgbijU/Q2Fa54tJnlCxjMzdj3CtwKV3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736742336; a=rsa-sha256; cv=none; b=hssQ4K6PBJ6tCkUynvclgsGF7/6gjVJKZPUdx4OSl4Cs9XdDDb0mL4fxDJoAnAEmNHafuO d8JeF9K55awpHM5ammRdXehepM6Hk991MPS5p8aKknx+4Io016vJI/yQrXnl6zeG+5NN51 GIpEhFZMPtiEywbspQeQLcgnpXlD7IJ0cY4Y72Ah+RId/VNvn+RMChnrvcS8B5xnVyZnZV Uzk2d1XhAc4TkJI0pq7ba1bUFE1in2Fu9nHVeLkBjWUFaeUxd63CL6ACO1VEVToepRXXwo KfZ4afEGJyhqN02jzSJPd+4jgr6Ug/N0S1POq4TgICiW2f05xccPgvk/0YJqzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWfM468yzzkD; Mon, 13 Jan 2025 04:25: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 50D4Pa6v050841; Mon, 13 Jan 2025 04:25:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D4PaeR050838; Mon, 13 Jan 2025 04:25:36 GMT (envelope-from git) Date: Mon, 13 Jan 2025 04:25:36 GMT Message-Id: <202501130425.50D4PaeR050838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 163951959866 - stable/13 - MFC: libmagic: Unbreak for older FreeBSD releases. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 163951959866377ebf6d9af84a412dd22b1a8983 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=163951959866377ebf6d9af84a412dd22b1a8983 commit 163951959866377ebf6d9af84a412dd22b1a8983 Author: Xin LI AuthorDate: 2025-01-13 04:25:29 +0000 Commit: Xin LI CommitDate: 2025-01-13 04:25:29 +0000 MFC: libmagic: Unbreak for older FreeBSD releases. PR: bin/273736 Reported by: philip (cherry picked from commit 7f8f120439b77e60a1070d87f4dc6cb9a43d0335) --- lib/libmagic/config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libmagic/config.h b/lib/libmagic/config.h index 12cd382ab9bb..d642880d6096 100644 --- a/lib/libmagic/config.h +++ b/lib/libmagic/config.h @@ -1,6 +1,9 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +/* FreeBSD */ +#include + /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ @@ -21,8 +24,10 @@ /* Define to 1 if you have the header file. */ #ifndef __APPLE__ /* Cross building tools on macOS */ +#if __FreeBSD_version >= 1400079 || (__FreeBSD_version < 1400000 && __FreeBSD_version >= 1302500) #define HAVE_BYTESWAP_H 1 #endif +#endif /* Define to 1 if you have the header file. */ /* #undef HAVE_BZLIB_H */ From nobody Mon Jan 13 07:59:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWl693w5wz5klhV; Mon, 13 Jan 2025 07:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWl693Fnsz3QVF; Mon, 13 Jan 2025 07:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736755185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqYFcBM4v8puvOi3n0MzBlATd6DjBuVayvKzwKpX3uk=; b=UtYsWQ+5a1GMah65+SjHJ+RM2UYxf4evNmbRZAU6PgCcfFj7gK4Y+NGZEEeBigU0WwOyD4 mGuEy16V+TqnE6e/UD3IpRwy3H3azMFsssEOl6W0uCI7UoUDuHdLQ8i8NKfTcA77PIlYFu ZjTcgH1Lhy3ofWsj7ohVz0f+F9kkc7c0D1JNGP15H+K4wtoVvnN0BifLiFsUcc96Al39Qe k7t0FFi/eueL1piP7gy91zJLId372UsQg0KxDpigQG5bgBpNS4t/y2zLUIG+9gRU50hXNg eIzZBh5dDJkf3ZSCprkDlD/jicFu2v/IPPx9MZwn4KL9sZxpqAIbpfz8gf+PnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736755185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqYFcBM4v8puvOi3n0MzBlATd6DjBuVayvKzwKpX3uk=; b=FplUA5TuwfqdbO3u/74el03qDS5e0nWww4LbaKVJXuYYNbhUpWtUdmNcJ48CMxOfw92kn3 mV8RvBl8mt445gjHWJnDIO+NQtJPPB3bhckk5qFE1urnVXcLeKqROk2t0QQNjmouxn0VuG 6ZsHrccMtoYp4aw221Jx8NYFXtTzwJlpJFUCqgc1QOAkUb18CPG8SbpeurhHVDOvexrHqq fSnUj64O/WqvCr7hl5JCG2JIDKvz8pGlYjmW1u262QxKPmAecVdSTSBuEFTMukpL/enB1s dK5IFDUTGUfl52twtqI0mlu4FEJBhkt8UXCpENUCf0G6oUys3Z2IU5MCmfR05A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736755185; a=rsa-sha256; cv=none; b=mykiMSjJNfV1822WiEQc8cboWpD0JWAnyC8rgoV2jv5JUSZBAexwZsrcFbKDm/utJGKgoM /1cERSaFUk8ETAwtsSyRJSfL6w31eqryyih0jZYlXXxFThMy8logpnrkm2KnENBxesX2b6 FxWXEYfX9YCS4YB8/c3bBRM+TGbG+ZM6G3lB/Bp9itMAiJpG3OXQa42tE7Yhc3M7SIiQud qfZn4/E8TrsFutqKFYqnsbtZE6pmRugOPQxvcssQL9Fe0kYOXviIrW79YdUfca8tmvQIoG 7oH0m1otJHvRRECsExlLp1KnbACJA7vyN/kHmTm7mSCZqMP2lbhkdPUT0DtuHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWl692KSyz5dY; Mon, 13 Jan 2025 07:59:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50D7xjUP044450; Mon, 13 Jan 2025 07:59:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50D7xjwq044447; Mon, 13 Jan 2025 07:59:45 GMT (envelope-from git) Date: Mon, 13 Jan 2025 07:59:45 GMT Message-Id: <202501130759.50D7xjwq044447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1f1894ed3415 - main - arm64: conf: Fix comment in std.rockchip List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f1894ed341519ced3d94c470c2cd01527af0902 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1f1894ed341519ced3d94c470c2cd01527af0902 commit 1f1894ed341519ced3d94c470c2cd01527af0902 Author: Emmanuel Vadot AuthorDate: 2025-01-13 08:00:58 +0000 Commit: Emmanuel Vadot CommitDate: 2025-01-13 08:01:50 +0000 arm64: conf: Fix comment in std.rockchip rk808 driver is obviously for the rk808 pmic and not rk805. Reported by: flo --- sys/arm64/conf/std.rockchip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/conf/std.rockchip b/sys/arm64/conf/std.rockchip index dc4dfadfde39..857cd7ed102b 100644 --- a/sys/arm64/conf/std.rockchip +++ b/sys/arm64/conf/std.rockchip @@ -23,7 +23,7 @@ device fan53555 # Fairchild Semi FAN53555/SYR82x Regulator # Power management controllers device rk8xx # RockChip RK8XX base support device rk805 # RockChip RK805 PMIC -device rk808 # RockChip RK805 PMIC +device rk808 # RockChip RK808 PMIC device rk817 # RockChip RK817 PMIC device syr827 # Silergy SYR827 PMIC device tcs4525 # TCS 4525 PMIC From nobody Mon Jan 13 16:06:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YWxvV1CXmz5kS4x; Mon, 13 Jan 2025 16:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWxvV0Vr2z45xd; Mon, 13 Jan 2025 16:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736784374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWmGftcMuvQd76tTuknyhdTtLYT7hu1/0XXFeicKKfg=; b=kuhU5tSZ2PLJj2HEZEb34ToKkS1J9rd3ZaQd84KpG1MM35p5dPbMXIB31wTe142REFNQVP 2Qu3h5zDF37is7zi1EpfQs/O8aheVmyKWROXs3oBD4XrW1EYeEl3r/51b49KQwXtgRd9+c Xa22noNoUj8q/0ahGkirpkzpR1O+hrvQ83Zgv6qUi9GTpa7ELSmKdnAr+sHYJlTCFyZhpW 1p/gzrgAkq6WTpzkHK3owromNh6oIOY2tGvuVxQpH60zLXWD2t1lpJWooymFjTGuRFwBIx /6ModNWIluw8NliKC2uUbk38t6dgmpoeLEkQzOmRTdRy7/oPBTIAGctcRDvYWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736784374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lWmGftcMuvQd76tTuknyhdTtLYT7hu1/0XXFeicKKfg=; b=nkeTpFcwvSQNKkloK8ITEkW5DVnmXSNbBK9SnE0dKS+qZlugqFydFsw2QfkAb8w8nl8AXb rqzgNJI9ONMMDtsXUkEOBbd11x6I221fqjMFCWbmWRhBbYJC8qgsNU+hmWdWgvp0PikCqd XRE1FlqumF1BRN9HzATZN1hE7+yg1xrlky5GyWmc2tM64iDVU/NKFrQfrY89ufvTUbZew9 JuA1MgKV5AYl5A+/Nt7QkJdic0Q96FMdiQfXaYmYeO+P1qlwmRNLfp+iJiewZ2IbDUj8xH v1tHYbTyYhZOiZ4qAIsYoix4TBqrI7yWF/G5NZLo6C32k123WTp6GQzX9TXINg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736784374; a=rsa-sha256; cv=none; b=Y7E4Z91hcf1DHpvwtm+P5BPL8bCjctKGD/Ge/XuiSrXC61vJe3Uyz5UOVl3q15eyfXXE5V UQBenhL1FGjpRs9wuSXyAUaAcUfrvQXQHsa195FsggFnli0dpdhMxS2SwqZ1+18ok6ZhNw F0FHTXahBEdtrWLPBLiJPiFcwH2/uAuZv2z2Fs74UjGb0pEpg2lAHeczE4nKUqqs52vknm lD0GKsn34UdLSlpihhUkZ6fYc+IAVChtY7Xy9d0qQ1pCHQJ1oGKgFxJOg5gRost0Dpw/yo 8zCayZ843k+DqsjFRi/S3kF5PU6toonmRM9Z8zgEGjRVxZGNV6dKeKP/ROm0UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YWxvT6yz2zdDx; Mon, 13 Jan 2025 16:06: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 50DG6DGY064134; Mon, 13 Jan 2025 16:06:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DG6D8Z064132; Mon, 13 Jan 2025 16:06:13 GMT (envelope-from git) Date: Mon, 13 Jan 2025 16:06:13 GMT Message-Id: <202501131606.50DG6D8Z064132@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: d57842ed2dad - main - depend-cleanup.sh: clean up after AArch64 libc SIMD merge List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: d57842ed2dad1c9bb8ae7271a8b5df772ac5213b Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=d57842ed2dad1c9bb8ae7271a8b5df772ac5213b commit d57842ed2dad1c9bb8ae7271a8b5df772ac5213b Author: Robert Clausecker AuthorDate: 2025-01-13 15:20:07 +0000 Commit: Robert Clausecker CommitDate: 2025-01-13 16:05:06 +0000 depend-cleanup.sh: clean up after AArch64 libc SIMD merge This should cover all the changed functions. Event: GSoC 2024 Reported by: andrew Approved by: emaste Differential Revision: https://reviews.freebsd.org/D48443 --- tools/build/depend-cleanup.sh | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 8aee1d0e9e71..6f97747183a8 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -239,3 +239,48 @@ if [ -h "$OBJTOP"/lib/libc/jemalloc.3 ]; then echo "Removing stale jemalloc.3 object" run rm -f "$OBJTOP"/lib/libc/jemalloc.3 fi + +if [ $MACHINE_ARCH = aarch64 ]; then + # 20250110 5e7d93a60440 add strcmp SIMD implementation + clean_dep lib/libc strcmp S + + # 20250110 b91003acffe7 add strspn optimized implementation + clean_dep lib/libc strspn c + + # 20250110 f2bd390a54f1 add strcspn optimized implementation + clean_dep lib/libc strcspn c + + # 20250110 89b3872376cb add optimized strpbrk & strsep implementations + clean_dep lib/libc strpbrk c + + # 20250110 79287d783c72 strcat enable use of SIMD + clean_dep lib/libc strcat c + + # 20250110 756b7fc80837 add strlcpy SIMD implementation + clean_dep lib/libc strlcpy c + + # 20250110 25c485e14769 add strncmp SIMD implementation + clean_dep lib/libc strncmp S + + # 20250110 bad17991c06d add memccpy SIMD implementation + clean_dep lib/libc memccpy c + + # 20250110 3dc5429158cf add strncat SIMD implementation + clean_dep lib/libc strncat c + + # 20250110 bea89d038ac5 add strlcat SIMD implementation + clean_dep lib/libc strlcat c + + # 20250110 3863fec1ce2d add strlen SIMD implementation + clean_dep lib/libc strlen S + + # 20250110 79e01e7e643c add bcopy & bzero wrapper + clean_dep lib/libc bcopy c + clean_dep lib/libc bzero c + + # 20250110 f2c98669fc1b add ASIMD-enhanced timingsafe_bcmp implementation + clean_dep lib/libc timingsafe_bcmp c + + # 20250110 3f224333af16 add timingsafe_memcmp() assembly implementation + clean_dep lib/libc timingsafe_memcmp c +fi From nobody Mon Jan 13 18:15:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX0mQ6Lg5z5kcXW; Mon, 13 Jan 2025 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mQ5csGz3KnH; Mon, 13 Jan 2025 18:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33Z404A5/fZi2pVUSqocKK76CbzypZkaEUFxZAOZyg4=; b=ivf5MHYyXGMjBoYL/ahcu2N66OYiFURAe/odkUH80QMiIxjxYYLCkLAzOve8JzSl3/Kq7F mNgBQUaSsWmDER5FfxjTQ6bEg/57xuuZ5v+PxXbjrVmmzucnElV5/hvCD4QpULTn/RAVmx Wnd2LpxNqw6QI92mIozBfC8LuGbtVpGgEtcBT9GjAFIdmXIFcm5om6ILS65FFqGKw4P6yY wPuEw17zi8xMAGu0dLcOy8fo+WWFT8aoGDNSg6DCwh6K0aBYOqaf9FfKFTVdRZoFSo72g0 YFNxHqT0myDEbXL4WK8iQf4FgKRIoJ7jydH7hCJmmFTj955Zz/ztKbFwo2g3qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33Z404A5/fZi2pVUSqocKK76CbzypZkaEUFxZAOZyg4=; b=JPmtsZi3QOwaHUcvesX40IlG2rFW5mmJ7kWdZvTE1qVlDOqITuNERZ6mHhqS09WyQZrUHA w7tPUteT/YsaLbb/I9PbxBkJbRTYxoP4yq+xeKLJz8cm2OFtuOYPejhjrS6Vvad8WDVvnf 2UkjJYkGfqtaVAQ8j2La+KSDgB5Ec7DKlLP6BVaKhiKLzkLkrbsVLIe/YK+i1JMgiZHutE jX2DGIVSVkbq2BopDp5Qzg5QRFFEqRzllr6V4hbwaUc4hbE1D/2mZPw891gp/KLO8aJEXl Azk6frmsKN23OVK82k29MXafeKbmnIIL57hUJ4GdIgR439D44IcEH0/aeTv0lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792118; a=rsa-sha256; cv=none; b=w6kaHfL0nyzYFuysjSJIgvPtyM9s/u0hhy/08Qh1yA44DWXtaEUCw+pXZvlFcoDnqDuuwv M5t4zM7yHLsUS+8l3nopdIq9eCfnrqIBkMI551np65dd8SboFXF8jL73JV/sGMIl4s7Mwd Yuk6HgMwd7kAwQYpBoKouZNUM2qg81Klxn7QaGaZihRzXrbwH+jFywMh/J3VfPRqOK5MDH kr8sm9CTGYCC/nXp3W6Oaalc6YmGYv9uGdM/1RBlgmjFfSbKkDaFjfbgI/awT462jLNXzs ISmkZwp7cl3hzA8DrVeGggEia6EKCtWhwRTzebWPDKw0ZXN4YqgAbfMkLYykPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX0mQ57Gyzj23; Mon, 13 Jan 2025 18:15: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 50DIFIO5007935; Mon, 13 Jan 2025 18:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFIVA007932; Mon, 13 Jan 2025 18:15:18 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:18 GMT Message-Id: <202501131815.50DIFIVA007932@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: 4155be454c46 - main - sockets: virtualize kern.ipc.soacceptqueue List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4155be454c46bc1ab725aca5c6969b064b74be38 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4155be454c46bc1ab725aca5c6969b064b74be38 commit 4155be454c46bc1ab725aca5c6969b064b74be38 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:51 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:11:39 +0000 sockets: virtualize kern.ipc.soacceptqueue PR: 219655 Differential Revision: https://reviews.freebsd.org/D48314 --- sys/kern/uipc_socket.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 470a2b3a51e4..7a76b561389a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -240,38 +240,39 @@ struct splice32 { * NB: The original sysctl somaxconn is still available but hidden * to prevent confusion about the actual purpose of this number. */ -static u_int somaxconn = SOMAXCONN; +VNET_DEFINE_STATIC(u_int, somaxconn) = SOMAXCONN; +#define V_somaxconn VNET(somaxconn) static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS) { int error; - int val; + u_int val; - val = somaxconn; + val = V_somaxconn; error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr ) return (error); /* * The purpose of the UINT_MAX / 3 limit, is so that the formula - * 3 * so_qlimit / 2 + * 3 * sol_qlimit / 2 * below, will not overflow. */ if (val < 1 || val > UINT_MAX / 3) return (EINVAL); - somaxconn = val; + V_somaxconn = val; return (0); } SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int), - sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size"); SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, - sizeof(int), sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, + sizeof(u_int), sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size (compat)"); static int numopensockets; @@ -1523,8 +1524,8 @@ solisten_proto(struct socket *so, int backlog) so->so_options |= SO_ACCEPTCONN; listening: - if (backlog < 0 || backlog > somaxconn) - backlog = somaxconn; + if (backlog < 0 || backlog > V_somaxconn) + backlog = V_somaxconn; so->sol_qlimit = backlog; mtx_unlock(&so->so_snd_mtx); From nobody Mon Jan 13 18:15:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX0mS1ZCQz5kcd4; Mon, 13 Jan 2025 18:15:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mR6DH1z3L9M; Mon, 13 Jan 2025 18:15:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OWxxXGVsZNedvDdQAMvOLMFAtkM85uFI4o+PGGkX24=; b=iqR62Y7CYLalpj2iF8HgrKITS79P6H/DnQzuilqlGfHa2sIQqNiFefDCp2rFKT3fSggD0k 7VbdcQiqYSFGs3wU9/RKOFewAdpZ9WljXoOPeQYRR5OqxahtmeabX644OYPN5MDIw46DIb wsC+72EfZ4sa3wumB/o1yUtpjNiHPhNvtQswtB2BbYoRfB06zlELdpM3AqgORCBdjWH1xs uUirGrYc+6yzfJj4/ZfAt93+oSO0hmg60HTAmbeuEu2wRKbukmCC9YjYAgRo4/6HtajRU8 0UYoxFkafiUyZe0DLRuhTJwdPlKAMn/mFERJrb2jjVH4jSMaM6nNqzFFKganIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OWxxXGVsZNedvDdQAMvOLMFAtkM85uFI4o+PGGkX24=; b=JDstso0gV4V3FDyWiicspq4QTjUY/BpbrInR9q4i4NWytrNdpL0SZSbb9vLuWISeAbX+nm gr0QYmnAZZ2smTJx76BZ0Hhh5LwAEGpag4etAGkNsTCIIds/wVXL41iYDNBnlEo8oK3kao kTTuCqfuNlKz4YN6ASxVZ7nSHGneQh+urgHavt6bMiGZx3ivAE0HJcTMUeWYVn8x0+vJFG J5DUaFZgmHSEsGDxhtpMLy6IZWNXYPaQSW6yaaYUYJ0MK3ht3XB5qt2mVsjlcWnZbQG4lE o+EP6CW4TQlpHQ9xszEgpZnClClNAhDrnq4AoEdTB+w9p1lBnHj7PiJI2pr/tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792119; a=rsa-sha256; cv=none; b=kO0CFp0niO4LxdciIEwtM1xwPjtH4Hebhuz/LStP7SjJ8xYSAkUNecusGsCextzrZQTFgE 5wP2TCOzdLDRTum6VmFraPNNbriDoMTGUmvEEh/8JZSoRyQBAfDzGuErV/VLYans5yzm6C JFIIR/DmajfKOhGfD0Od5/tqqyk5TslJrvSD8bikqQcCcMA7Ve8BmLnH1reQtpQXtk/sIH eD/JyncCD8VTckoZTNsN4qAzYfylDgKBPqFmrYW2JSKWJLcNZCRZmhz7TIQnRJEG1LTbG6 fqGuX+dx5LZMWiUn3iuJ9oHe3eCgh6A0FI6Cu9lKzv8ELVCnlgZb76p19mwNPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX0mR5qZyzhrH; Mon, 13 Jan 2025 18:15: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 50DIFJ2q007986; Mon, 13 Jan 2025 18:15:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFJtu007983; Mon, 13 Jan 2025 18:15:19 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:19 GMT Message-Id: <202501131815.50DIFJtu007983@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: 59498e099cc0 - main - sockets: virtualize kern.ipc.numopensockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59498e099cc055da7afca8266087b7668be6d7cb Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=59498e099cc055da7afca8266087b7668be6d7cb commit 59498e099cc055da7afca8266087b7668be6d7cb Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:58 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:11:46 +0000 sockets: virtualize kern.ipc.numopensockets To avoid breaking POLA on the host machine it reports the same value as before. In a VNET jail it now reports number of sockets in this jail. PR: 219655 Differential Revision: https://reviews.freebsd.org/D48315 --- sys/kern/uipc_socket.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 7a76b561389a..426316ac6ce8 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -275,9 +275,23 @@ SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, sizeof(u_int), sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size (compat)"); -static int numopensockets; -SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, - &numopensockets, 0, "Number of open sockets"); +static u_int numopensockets; +static int +sysctl_numopensockets(SYSCTL_HANDLER_ARGS) +{ + u_int val; + +#ifdef VIMAGE + if(!IS_DEFAULT_VNET(curvnet)) + val = curvnet->vnet_sockcnt; + else +#endif + val = numopensockets; + return (sysctl_handle_int(oidp, &val, 0, req)); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, numopensockets, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_numopensockets, "IU", "Number of open sockets"); /* * so_global_mtx protects so_gencnt, numopensockets, and the per-socket From nobody Mon Jan 13 18:15:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX0mW2JT6z5kcZq; Mon, 13 Jan 2025 18:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mV1jDyz3LHn; Mon, 13 Jan 2025 18:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vtj6H/CGN56bg7efba1PJ01yM8nse4jpEAHR1jL94+Q=; b=DEcpeoSs2tOa/uZqVK326m2d9LJtHYAB3w1m/IcExRPywWa12RklKyizZ1Z7D2q10u+Zyo 72byfI6xzLg77HwMgR6J+5w1wlhnENgyfdbjOUb9uprX3+75080c73dyRSHJeSp0RZYXh8 /KVpQKpGN8KXFk1X9KxuJA2cm0HmBs0B7h5G2YkM1gDrjQmgLJy//QjCnDU0zFFf52dQhP Vnuzmy3zomMKAmIRbVmBkrMtynetgvQtwdX6GcZ4FivEPdSl8G4slvltIbI5YAGgxKml1P c8EX52nmDcGRVpoHTT0ZB8A8kOhCmBPIGaGQMAwGBq0X9q5S0hwY9QisapPmyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vtj6H/CGN56bg7efba1PJ01yM8nse4jpEAHR1jL94+Q=; b=dtlmM9aHQtE5NC8bauSs0u8f/+Jg4vEsYewyUE66uoDHJMkT8n7Nqm+0JH1reYZQ5dJxrD NA7U1bFYmppz7dxDQYSrFV9GYOjHFdusqOGNDxxTOYL8GbptoKPr2Y36i/sPPuB86FbmlF I3fXJySRYu3OyRuuUzwJ8Qb4+4l4p05fB/X4CRTtvkEBxWKCvOBtBjm2z2JU/MIiOdszux Ih+wFzUqPZ+Y1cRN9Nd/gczvJQ0vjvt7oC9NsJZ3xFN58gFNAWIkpbfCy9l0TfW4tS/YAo zwKAUuRVTv6Td+DNJs2X2yWgNYZkQgRPsNJ7jHtTTfuhseU9oMzuMZlcaXKqFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792122; a=rsa-sha256; cv=none; b=WJHFQxqf6t/BZWQaKxJtV3u2q2Q4R8Tq6wbU2MKPb/AgrV4fYnKGYtHvE4bApLdIXxlefF pwBex00LaiO3O41H+uXrgR6/x5ze5+yJL81kS18VZux6gXhtqjnoaf8V5lBoI6Xeeu1g7l abbmaRE3I1xgXjdRvjIFUVeLOBVw3hWZZa1+QrGFiQZSxMFZCRkZ9pk8RhU+LXD/KlUrAE tpsg6BAk5dwoj6E4TE8t3lhm5OEI9yM39EEF/QIJcfOuiL/lKbKt6Q/ymiYX/sruiiLtPQ DTFr8LaZuqaJ3xQuxZ3Y+K1g6SlSRJUKDoYEm/3VO3aJ7HjvSdT2is6oBHg+8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX0mV0SfWzj26; Mon, 13 Jan 2025 18:15: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 50DIFLqF008091; Mon, 13 Jan 2025 18:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFLpj008089; Mon, 13 Jan 2025 18:15:21 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:21 GMT Message-Id: <202501131815.50DIFLpj008089@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: b84f41b4e82d - main - tcp: properly reset sackhint values when SACK recovery is done List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b84f41b4e82df373f8e682d45791b6ab636cd94e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b84f41b4e82df373f8e682d45791b6ab636cd94e commit b84f41b4e82df373f8e682d45791b6ab636cd94e Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:13:45 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:13:45 +0000 tcp: properly reset sackhint values when SACK recovery is done When the SACK scoreboard collapses, properly clear all the counters. The counters are used in tcp_compute_pipe(), which can be called anytime later after the SACK recovery. The returned result can be totally bogus, including both too large and too small values. PR: 283649 Reviewed by: rscheff Differential Revision: https://reviews.freebsd.org/D48236 --- sys/netinet/tcp_sack.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index f642acd4c46a..90d789f0e224 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -653,8 +653,6 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) * scoreboard). */ tp->snd_fack = SEQ_MAX(tp->snd_una, th_ack); - tp->sackhint.sacked_bytes = 0; /* reset */ - tp->sackhint.hole_bytes = 0; } /* * In the while-loop below, incoming SACK blocks (sack_blocks[]) and @@ -870,12 +868,26 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) } } - KASSERT(!(TAILQ_EMPTY(&tp->snd_holes) && (tp->sackhint.hole_bytes != 0)), - ("SACK scoreboard empty, but accounting non-zero\n")); - + KASSERT(delivered_data >= 0, ("delivered_data < 0")); KASSERT(notlost_bytes <= tp->sackhint.hole_bytes, ("SACK: more bytes marked notlost than in scoreboard holes")); + if (TAILQ_EMPTY(&tp->snd_holes)) { + KASSERT(tp->sackhint.hole_bytes == 0, + ("SACK scoreboard empty, but accounting non-zero\n")); + tp->sackhint.sack_bytes_rexmit = 0; + tp->sackhint.sacked_bytes = 0; + tp->sackhint.lost_bytes = 0; + } else { + KASSERT(tp->sackhint.hole_bytes > 0, + ("SACK scoreboard not empty, but has no bytes\n")); + tp->sackhint.delivered_data = delivered_data; + tp->sackhint.sacked_bytes += delivered_data - left_edge_delta; + KASSERT((tp->sackhint.sacked_bytes >= 0), ("sacked_bytes < 0")); + tp->sackhint.lost_bytes = tp->sackhint.hole_bytes - + notlost_bytes; + } + if (!(to->to_flags & TOF_SACK)) /* * If this ACK did not contain any @@ -886,11 +898,6 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) * for RFC6675 rescue retransmission. */ sack_changed = SACK_NOCHANGE; - tp->sackhint.delivered_data = delivered_data; - tp->sackhint.sacked_bytes += delivered_data - left_edge_delta; - tp->sackhint.lost_bytes = tp->sackhint.hole_bytes - notlost_bytes; - KASSERT((delivered_data >= 0), ("delivered_data < 0")); - KASSERT((tp->sackhint.sacked_bytes >= 0), ("sacked_bytes < 0")); return (sack_changed); } From nobody Mon Jan 13 18:15:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX0mT4Jxdz5kd05; Mon, 13 Jan 2025 18:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mT1m6Kz3LCY; Mon, 13 Jan 2025 18:15:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hkDzCs/nDMLxYCQSAgq1ZqQrnlXtgclp/wscZbWFnLU=; b=A2TqX0qlqbCLP0qJ1evQpNYVVoZB4sujRZgyRK1QWRcHJIEVkzrSz02QCbfrzadSiobqtr 09lmV04h2naLv9+nzvhdOXfVKbRhVQ60JEAllnQelhKY3C2z1s+lG2m8RDtygGUipqHNQB 6r5hxJpPYY2Pd8gR4sDCh9FmH3a6kXi7FyYZJ6O3os1TugbM8IWYS1xiXeHcIX1OXIo5+U MotDvlUGC9ZTwLZdAipTwrdliJxW/RV3wZ3gh2zfCLltchbSS8xtHscIS7lPKCOvA0r8Dk mKt9KCUNwDAK+Gss+i4q2xsZEt4+kFxan7suJegvAiAkqda/FLtN9RIXYRrIKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hkDzCs/nDMLxYCQSAgq1ZqQrnlXtgclp/wscZbWFnLU=; b=ANYJOagESx8Idf/IyyjGCXQ6jigvg/R2TJMYOLZ6RIICaEN+70mJG/gKE4dCkQuLYvIyDy 3iRT+14x9gquS8lvpSAezHShwkK2kfCRSjaZcvAWMk1vgqLA4cFYkfz2LKFFIwFf5HlFke GhhUzwgm3JmRz0RPegmFu50fDyD4Ny4e6A/hkTZ521y1Ul6uEq+9qGXrykfF+NtiLRiBlN /2Wg6Ih+mjMZvrayH8Cg3BFrAAdIe0+EjKDL0XubUlxdq4xRepKNw07LvyS+KUysuYQyLW XngmJmN+ltvQnWboul4uKqyKFYrr873QlGbOUuI+mtkTZsS2TF0GlBow0BX4Vg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792121; a=rsa-sha256; cv=none; b=NRkswQ6aOWhXIRC04c7q2J6hqDixJnITnxNB+Bxw4fvq0cK/1ZlApIG8b4jdEgZlpokhCt y0+iPrRbSpdaWvEQG6jY3thICxByCyZDzcQ0tIWcWRtS9zG1RkUbteP0ptY352wXzdLYCb YZfagiZ2NudmeL1J+fmt5KIGjV2FN5xuLFBWwWAYRoHZErcRIrv7mj4Q6c1XC+S/VXh1Tn xYlbDtLiHUtDuv4Z7S+XWuE76aCwQ95qGsivqy2f7ybhQ4R/TctiuBx+oG+LcyvYyFAxyo Tqf/9PxI3p92GDiY0YexSFjZkgpB8okal21RQLSGWcW3IYQKwuAMG6Cg1/t7rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX0mS6W9Szj24; Mon, 13 Jan 2025 18:15: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 50DIFK5j008034; Mon, 13 Jan 2025 18:15:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFKZN008031; Mon, 13 Jan 2025 18:15:20 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:20 GMT Message-Id: <202501131815.50DIFKZN008031@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: 72c11c40ab5b - main - tcp: make sack_rxmit in tcp_output() a bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72c11c40ab5b091a30cddbd4b8d007ac7c29fcf9 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=72c11c40ab5b091a30cddbd4b8d007ac7c29fcf9 commit 72c11c40ab5b091a30cddbd4b8d007ac7c29fcf9 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:13:30 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:13:30 +0000 tcp: make sack_rxmit in tcp_output() a bool Also make this variable initialization, as well as accompanying sackhole pointer, slightly more readable. NFC. Reviewed by: rscheff, tuexen, rrs Differential Revision: https://reviews.freebsd.org/D48235 --- sys/netinet/tcp_output.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 9df5b3dd42b0..74a229012508 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -203,7 +203,7 @@ tcp_default_output(struct tcpcb *tp) unsigned ipoptlen, optlen, hdrlen, ulen; unsigned ipsec_optlen = 0; int idle, sendalot, curticks; - int sack_rxmit, sack_bytes_rxmt; + int sack_bytes_rxmt; struct sackhole *p; int tso, mtu; struct tcpopt to; @@ -211,6 +211,7 @@ tcp_default_output(struct tcpcb *tp) struct tcp_log_buffer *lgb; unsigned int wanted_cookie = 0; unsigned int dont_sendalot = 0; + bool sack_rxmit; #ifdef INET6 struct ip6_hdr *ip6 = NULL; const bool isipv6 = (inp->inp_vflag & INP_IPV6) != 0; @@ -287,10 +288,8 @@ again: /* * Still in sack recovery , reset rxmit flag to zero. */ - sack_rxmit = 0; sack_bytes_rxmt = 0; len = 0; - p = NULL; if ((tp->t_flags & TF_SACK_PERMIT) && (IN_FASTRECOVERY(tp->t_flags) || (SEQ_LT(tp->snd_nxt, tp->snd_max) && (tp->t_dupacks >= tcprexmtthresh))) && @@ -317,6 +316,7 @@ again: * moves past p->rxmit. */ p = NULL; + sack_rxmit = false; goto after_sack_rexmit; } else { /* Can rexmit part of the current hole */ @@ -343,12 +343,15 @@ again: * Wouldn't be here if there would have been * nothing in the scoreboard to transmit. */ - sack_rxmit = 1; if (len > 0) { off = SEQ_SUB(p->rxmit, tp->snd_una); KASSERT(off >= 0,("%s: sack block to the left of una : %d", __func__, off)); } + sack_rxmit = true; + } else { + p = NULL; + sack_rxmit = false; } after_sack_rexmit: /* @@ -409,7 +412,7 @@ after_sack_rexmit: * If sack_rxmit is true we are retransmitting from the scoreboard * in which case len is already set. */ - if (sack_rxmit == 0) { + if (!sack_rxmit) { if ((sack_bytes_rxmt == 0) || SEQ_LT(tp->snd_nxt, tp->snd_max)) { len = imin(sbavail(&so->so_snd), sendwin) - off; } else { @@ -557,7 +560,7 @@ after_sack_rexmit: if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg && (tp->t_port == 0) && ((tp->t_flags & TF_SIGNATURE) == 0) && - ((sack_rxmit == 0) || V_tcp_sack_tso) && + (!sack_rxmit || V_tcp_sack_tso) && (ipoptlen == 0 || (ipoptlen == ipsec_optlen && (tp->t_flags2 & TF2_IPSEC_TSO) != 0)) && !(flags & TH_SYN)) @@ -981,7 +984,7 @@ send: */ SOCK_SENDBUF_UNLOCK(so); error = EMSGSIZE; - sack_rxmit = 0; + sack_rxmit = false; goto out; } len = tp->t_maxseg - optlen - ipoptlen; @@ -1063,7 +1066,7 @@ send: if (m == NULL) { SOCK_SENDBUF_UNLOCK(so); error = ENOBUFS; - sack_rxmit = 0; + sack_rxmit = false; goto out; } @@ -1107,7 +1110,7 @@ send: SOCK_SENDBUF_UNLOCK(so); (void) m_free(m); error = ENOBUFS; - sack_rxmit = 0; + sack_rxmit = false; goto out; } } @@ -1136,7 +1139,7 @@ send: m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; - sack_rxmit = 0; + sack_rxmit = false; goto out; } #ifdef INET6 @@ -1233,7 +1236,7 @@ send: * case, since we know we aren't doing a retransmission. * (retransmit and persist are mutually exclusive...) */ - if (sack_rxmit == 0) { + if (!sack_rxmit) { if (len || (flags & (TH_SYN|TH_FIN)) || tcp_timer_active(tp, TT_PERSIST)) th->th_seq = htonl(tp->snd_nxt); From nobody Mon Jan 13 18:15:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX0mX2VWsz5kcj6; Mon, 13 Jan 2025 18:15:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX0mW1stsz3KqZ; Mon, 13 Jan 2025 18:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4CRESgTLiv/muXLOQBregguYpjBFhGmGhAu/uc/C0k=; b=pKcL/VB17+jr9rVXNP+A7IGFvVFOCJKiLebgl414Ih6dj6JposTKZD1JMFkJWEhUYGeXxy EdvxSrkOqjiQ1sNz+ZVzkP3uX4HD+QKw+hTh0YTTmNPKg3oJRbURnKR6HojcsjJXaPbQ7d kFbBR5MKmkO5VM+2DpcTNN7YCcZmQJB8ex5FZE6OlLm/hs/UG4LwEiqBbM6fcn08zOPdlQ CXvCR++LdMCnQ+uCLT/E9R4JFfcDfSrots7qJEmpd8Lm+jrZDzAkOLJLVQ3Bw2du1rdcQo 12PJCV8lPmWEAEHlSn+ZradrkwZezQU7UZtklEPYgGisPbbRIdLiczOG7qXS+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736792123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r4CRESgTLiv/muXLOQBregguYpjBFhGmGhAu/uc/C0k=; b=d7PxN1kTgoiTZWqBrutdhRAdCynVK3BjJwVHFjjtauTdhCiB3ADbkS1Svwk6jmRyprNbpD hlghzXaETK/+QO9S2iH4SaqUCLA9BsCSvBmfnaEojBbGj9qlcG8G+ax2xA45tdysngQANg TRgRTCZJgfEknTJ3yt+et7XOVZ7sZOppEal7+Xj/0kU8ngGkvR0HrY8LwtOZmhxt7/WRdm D5jXppuXIGEH8boptM/jhuTjRm7MbwmmMRdCUFcIRSIfeVG3wyvez/7uyAGE+a0hrG0xlz MhDHTVWRqQ7kqfrJjTKUfGtUlR9YdtNb4cjZj1Ubr8S21ll0go65SJT9SXj76Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736792123; a=rsa-sha256; cv=none; b=ZZFPw5ZLBMDQWVSm9jUMvMPZpV7TiNbzAKwjbFx+aLjPUL7Zj7tmZp33SGqSEHj0czqUFZ pPmCMZ5eDLjJhi4K2jYt+erKpEEIUb7UDtA9MZZ0agh85gEAP+3wj01q7stBtMDYykPHvX HzUvOQbXdKCobY/mX6PBudZLXbOeHbM9QbUEMyxY69i5mKN3UJCZsCQSdPmW06/ejdUM9s jmr54nk7Ym2Gi2o8ihx8CJS28Ad0zdheBwRQmgoh7gYgsnk865c0+2BRxPEdf4ov2dd1pa QvdM5HOfRkbc0cdzpW6P7KLUa0ax88sE0hnK585I/kyC5H8ewTFTeUG0O4lflQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX0mW16FXzhb4; Mon, 13 Jan 2025 18:15: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 50DIFNV7008139; Mon, 13 Jan 2025 18:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DIFNIt008136; Mon, 13 Jan 2025 18:15:23 GMT (envelope-from git) Date: Mon, 13 Jan 2025 18:15:23 GMT Message-Id: <202501131815.50DIFNIt008136@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: 1043b36b2054 - main - tcp: don't send beyond receivers advertised window List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1043b36b2054ffb32aadfe1c276684bf463db59a Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1043b36b2054ffb32aadfe1c276684bf463db59a commit 1043b36b2054ffb32aadfe1c276684bf463db59a Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:13:54 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 18:13:54 +0000 tcp: don't send beyond receivers advertised window When calculating length of data to be sent, we may do some congestion calculations, but we shall never send a byte beyond (snd_una + snd_wnd). In 7dc78150c730e we started to use tcp_compute_pipe() instead of (snd_wnd - off). This function makes an estimate of how much data is in flight. It can return a value smaller and larger than (snd_nxt - snd_una). It will return a value larger when we have retransmitted some data from SACK holes, and smaller once those retransmitted SACK holes are acked. We may use tcp_compute_pipe() for length calculation, but always capped by the send offset 'off', which (snd_nxt - snd_una). PR: 283649 Reviewed by: rscheff Differential Revision: https://reviews.freebsd.org/D48237 Fixes: 7dc78150c730e90fa2afdaba3aa645932b30c429 --- sys/netinet/tcp_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 74a229012508..135e7d8493e2 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -421,8 +421,9 @@ after_sack_rexmit: * sending new data, having retransmitted all the * data possible in the scoreboard. */ - len = imin(sbavail(&so->so_snd) - off, - sendwin - tcp_compute_pipe(tp)); + len = imax( + imin(sbavail(&so->so_snd), sendwin) - + imax(tcp_compute_pipe(tp), off), 0); } } From nobody Mon Jan 13 19:23:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX2H61GCtz5kjNH; Mon, 13 Jan 2025 19:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2H60GYbz3VvM; Mon, 13 Jan 2025 19:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tV+l5cTHG4xfuO1q8qMSR74fPyGlUqgsSbW37LIHNt4=; b=Mz6+vzjqVrW55ondpopd9W2gCFfA9UV7D9Ld0iv6t3MM1zAGgsbsGJ23aL0kQ8awqIKMZV 6PkCsDjCnnsh1VgDZFePOuPE4/jBtVUjZr0KIkwrNWOGsDjqOR7ksGSMf73D6Q3IwKo837 72pAlR5wUgtjriXUCkBB0sMA4ldTXR6BQbWoUIPZmIbIs5A2Ej/xDX7i8CDpwCY7/YRx7U AtsmZkgne5DwLU3ZHY3B8Dq5Vow0d/up6QqwnL6NPRM4sZj9LD8v0XRZoODPE314jbN8Ir ORAZFsv53ifIJfQFZRB74eVyD9ZhLzJM+ykBf0aSzU6UZUrZR38RhJX5xAH1qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tV+l5cTHG4xfuO1q8qMSR74fPyGlUqgsSbW37LIHNt4=; b=skJFbkHAn5XDnE+7qTmUwKFWT6fWu8sno17lSK2gUwvIt3m0l0QhBZoZRFb9W92W97Gi39 cmRMpVQHgyMwDnpuOKG1BrGhcgF6d9stlIx8gvNXZJBriU7I3o4uhhG1QJVuCF6dv1Q8t+ CrgbJt5IjNWEtPJWLFyWSGPGMKADMU5ks45w1awVYkp0j1cQFqN4RfHte0O/FwVHnEvQIY sHt8GiLpg4gZGb6V7+grLtbSaFhfyq7tSNhMyE+RQYIANunYCtbZWkXrp0yeShAKRALHft YlR07uCV9ros4nxHhVwjAsi9RoK1USVpfiq3mTWX0KZ47Tw37W6AZfwfNrpBwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796210; a=rsa-sha256; cv=none; b=tE/2PtNd+uTfjBf2lAM6j4uEvGe0dOu/r6x3nSwQVlBwMzYgOnZmbivY35uCLqzq5ja74z EPCGZIRsZBDjXaMmjx4B4VqVEMWa2F9eQx+YMDwEZNrsg32a9WUEWiH74nt/mw9BORCEsi mROW8VS6CUG1IGRP1uP/UeyZnIEHytKxOsMEh8zF1aftV2ihkJyB56g6G7Lnvr4i/bRfvZ 3O5IvqnTBHo7MTWDV0jTuyGj9QC/KtyS4QrWWGCSx/ezI+u6DlqxlW5niljuboXezYZtPg 4F826IL/sLPJ8CggvTjc3rQ5Lk5aKpeDczPrLt7J3xS2qUftO3TUCrfKE0bOoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX2H56m32zjTN; Mon, 13 Jan 2025 19:23: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 50DJNTcv039230; Mon, 13 Jan 2025 19:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJNTjZ039227; Mon, 13 Jan 2025 19:23:29 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:23:29 GMT Message-Id: <202501131923.50DJNTjZ039227@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: a57a2c01aacc - main - ffs_blkpref_ufsX(): do not iterate over startcg twice List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 commit a57a2c01aacc5e2a29fa33d50aecc516e37cecd0 Author: Konstantin Belousov AuthorDate: 2025-01-05 23:00:10 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:22:44 +0000 ffs_blkpref_ufsX(): do not iterate over startcg twice Tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48378 --- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 713dcf1ca97a..01bfdb85c2e6 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -1496,7 +1496,7 @@ ffs_blkpref_ufs1(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); @@ -1608,7 +1608,7 @@ ffs_blkpref_ufs2(struct inode *ip, fs->fs_cgrotor = cg; return (cgdata(fs, cg)); } - for (cg = 0; cg <= startcg; cg++) + for (cg = 0; cg < startcg; cg++) if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) { fs->fs_cgrotor = cg; return (cgdata(fs, cg)); From nobody Mon Jan 13 19:23:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX2H732Trz5kjNJ; Mon, 13 Jan 2025 19:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2H713kvz3VvN; Mon, 13 Jan 2025 19:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9KdzXJjwlf30RTT5ZAlKK+E6v0e5Xx3XmoocNeafZw=; b=oAZl02mdflbWWKnyKjzDnZEUKRD9uodxDqFSDfLvt2q7v4Tm4kHijIVa+PEv0jd4zI0t03 zjG07gbcMH3L160sBImIKWkzr4vsJtjQDi4gElnu1uveBnat1JLX4wdwJGOgr9enEwJylQ 9AlUk6cjq/yAezY8uHteSCAdFKbQml/6HdJ8S+9VQWXNE+JqYymwFoIKl44kCUYIw2zWMS WqdJgqSfIfZlU/gj9y6lV00eN3o9QM4rGnR144W7MziRdldRQbHPLOuyJu1ufAr7HS0ygA SD6Fs65Wuf6QIp2vxtKXv26zB09vETxAkDQ+HSdqEE+j8z9Rao832cIB/yTTfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M9KdzXJjwlf30RTT5ZAlKK+E6v0e5Xx3XmoocNeafZw=; b=Tz5LGzK5/motLXvjVucBZ50bftDY/idAhu+PPjJDrax4SwixBCasE/I6MiZLM/UBG7IkJZ q+Lbnir04CW21sLnbOeXND4MtSpB7txbeZOU3v+w+XD62nkkbfehPE4aJ/4C4xzDIeLW3z K8lD0ABkidLZZ257O6O+cmkXR50DcN0GMtoqJDCOSX+GKKTDzGAg9D7g3AbteTKY20SlGw h5lsCWUmbFN6VyyZZo+wqFjifuRxUoA99gTIIzaRJJr5VH2pG1KzqnFWtqxvRDw3jm0Sth mVZ7e8wb08bTtJ8mgFpmmDLUY/gFi/Y13tFQPIlyUPZxWPHSAxfQuqGBndZP6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796211; a=rsa-sha256; cv=none; b=wXARqf/S6/rpucTtydEx1hODxJOQtYdkfOJf/KAk1FRRdiVPu8U9vulKwbVhiXPfESrRj+ 2pXlrQ87GSmGRwzq2IlHEVpZtA/kInhPNbwXLTE5PGaQ2rGqDYGe3g1XQUax0HamLtwgud lBIAzj+sEBGthpGonUW56mOoShGNPnrt10/nPB8X/C9YL4JZvaPG2OEGerqJB+RQJvt3JI jlfzsJVugO2mlKXDNlulVENVLNlUsvF4hM7mUlJS/CRXVAldipV6yRkWhWrnh3GG97Z8gx hTM1W+RL9wDuHbi9fv6StSv1P2weOwvx4bjpKXTe93bW40dE9XGh2RFfv7HeDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX2H70gLSzkJX; Mon, 13 Jan 2025 19:23: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 50DJNVHo039279; Mon, 13 Jan 2025 19:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJNVnc039276; Mon, 13 Jan 2025 19:23:31 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:23:31 GMT Message-Id: <202501131923.50DJNVnc039276@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: dc37121d3210 - main - ffs_reallocblks(): ensure that pref cg is valid List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc37121d3210d08c96a883ebfed780660e7e2b39 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc37121d3210d08c96a883ebfed780660e7e2b39 commit dc37121d3210d08c96a883ebfed780660e7e2b39 Author: Konstantin Belousov AuthorDate: 2025-01-05 22:51:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:22:54 +0000 ffs_reallocblks(): ensure that pref cg is valid ffs_blkpref_ufsX() must return in-range pref frag number, otherwise calculated cg index is out of range for fs, causing out of range accesses to the structures sized by the number of cg, e.g. the fs_maxcluster[] array in ffs_clusteralloc(). The easiest way to trigger it is to overflow the volume. In collaboration with: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC afer: 1 week Differential revision: https://reviews.freebsd.org/D48378 --- sys/ufs/ffs/ffs_alloc.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 01bfdb85c2e6..265daef14812 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -681,6 +681,7 @@ ffs_reallocblks_ufs1( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -947,6 +948,7 @@ ffs_reallocblks_ufs2( * groups that we will search. */ cg = dtog(fs, pref); + MPASS(cg < fs->fs_ncg); for (i = min(maxclustersearch, fs->fs_ncg); i > 0; i--) { if ((newblk = ffs_clusteralloc(ip, cg, pref, len)) != 0) break; @@ -1438,8 +1440,11 @@ ffs_blkpref_ufs1(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din1->di_db[UFS_NDADDR - 1] != 0) + ip->i_din1->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din1->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1450,8 +1455,11 @@ ffs_blkpref_ufs1(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din1->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1506,6 +1514,8 @@ ffs_blkpref_ufs1(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1550,8 +1560,11 @@ ffs_blkpref_ufs2(struct inode *ip, * place it immediately following the last direct block. */ if (indx == -1 && lbn < UFS_NDADDR + NINDIR(fs) && - ip->i_din2->di_db[UFS_NDADDR - 1] != 0) + ip->i_din2->di_db[UFS_NDADDR - 1] != 0) { pref = ip->i_din2->di_db[UFS_NDADDR - 1] + fs->fs_frag; + if (dtog(fs, pref) >= fs->fs_ncg) + pref = 0; + } return (pref); } /* @@ -1562,8 +1575,11 @@ ffs_blkpref_ufs2(struct inode *ip, if (lbn == UFS_NDADDR) { pref = ip->i_din2->di_ib[0]; if (pref != 0 && pref >= cgdata(fs, inocg) && - pref < cgbase(fs, inocg + 1)) + pref < cgbase(fs, inocg + 1)) { + if (dtog(fs, pref + fs->fs_frag) >= fs->fs_ncg) + return (0); return (pref + fs->fs_frag); + } } /* * If we are at the beginning of a file, or we have already allocated @@ -1618,6 +1634,8 @@ ffs_blkpref_ufs2(struct inode *ip, /* * Otherwise, we just always try to lay things out contiguously. */ + if (dtog(fs, prevbn + fs->fs_frag) >= fs->fs_ncg) + return (0); return (prevbn + fs->fs_frag); } @@ -1968,6 +1986,7 @@ ffs_clusteralloc(struct inode *ip, ump = ITOUMP(ip); fs = ump->um_fs; + MPASS(cg < fs->fs_ncg); if (fs->fs_maxcluster[cg] < len) return (0); UFS_UNLOCK(ump); From nobody Mon Jan 13 19:30:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX2Qq6w2fz5kjdL; Mon, 13 Jan 2025 19:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2Qq66gMz3WTk; Mon, 13 Jan 2025 19:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yOUwBGEByw9UOevQfAqbChtTUhqZoDsR0mL+h381kAM=; b=h3wXWHarL6JVB48Ebc80s67Pk3UeChmapYpDmFZJP8FLdnI+Z6bJ+KrOyIcfqF4UGVXzJf oIb2Lt5oqy9Lhn28WK4c8F/Lw5/suZ0GqghsqcWpS8u8pyH94F+XBOEYSynN64f2F841pb nNcgpLNf3qabIyhnbXHwwvvY7hAWUQtKyrPbaZntj9S+h7GV1Lw8U9KcZhu9gmGwxDLnyg SvhCce96TdAfqgnNKyqFnxO5H2lYQIS1+qPkgYCEe97I3mFpjsJNKAw3jqjCl0X7pDAV5x RpfknJMQaI83RDMIvE4oOpjgBdlzKsG000Jyj5pmOE5qd6HLDNrfTgqfQIUiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yOUwBGEByw9UOevQfAqbChtTUhqZoDsR0mL+h381kAM=; b=HHWkKEg453Gz6gZ0V8Wkm3awE8aYTPtewAgk3MpPIQzmfbUSI6RlmfrP8Mw1cX0GNJZTZ/ 20v1VNn4OWU7vkpDqrHKo9Jmg9avphqwoB9UxFuOO9BU0B05em6WeTZnmJw8ILW002pWfa FlguqQF2+jrnmKFKsr9jlp+hi70rj6RF3gM0GaYmhkSwn1CrgOWE/p21bsnEBYtJkrjoDs D5OF5ju72MOMWLCMqRdDGy6LNAZtoh5r5mdHck8F/sDtSz6pJ4XazHFNehZdxPRgnZ0QQ1 SYswY45qtilECt/JON6HeNcdCAT3ubz+6nAg8yawMCyvllT1lxBlRC3IJPRBiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796611; a=rsa-sha256; cv=none; b=MVZ+KYpDBYuAUcxSZJ2xcDoKqIGMrx/gZgOhxoupRnHVrxoUHRz/KpkgX+IO8th+tUitvK N9E/MwAio72KkSsEhTJkeeWDO8tLLaO0baP+3rhZGeHcxzSQh4plHARGwNsmIR43Dpr4if h9jYgkM/uDxDANI4ppnuYrw59t+wfoN5wY5Vm4PjPf1qsXsMdfcP2elUgU3EJk6b2DuPd0 4uDvFrJp2jGkJYM/CgT4kJvZ4M4TcQjUAqUAQLIb1TRIq9Qi8Qarc5/YMuotSPdjy8OcoV FV5CgMayhrbzdygSbzTbnn4VtKBBl15p7fBBqMSgqRgUsHjmN9IT5YnmwqPCOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX2Qq5Kypzklc; Mon, 13 Jan 2025 19:30: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 50DJUBni046445; Mon, 13 Jan 2025 19:30:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJUBQX046437; Mon, 13 Jan 2025 19:30:11 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:30:11 GMT Message-Id: <202501131930.50DJUBQX046437@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: cf322978d73a - main - mb_unmapped_to_ext(): return error code on error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf322978d73a3ed4958cb64cc4f1b47ceb53a03e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cf322978d73a3ed4958cb64cc4f1b47ceb53a03e commit cf322978d73a3ed4958cb64cc4f1b47ceb53a03e Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:01 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:29:31 +0000 mb_unmapped_to_ext(): return error code on error to allow to distinguish the causes of failure. Reviewed by: markj Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48265 --- sys/kern/kern_mbuf.c | 41 +++++++++++++++++++++++++++-------------- sys/sys/mbuf.h | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 73c98209474a..26be33658ab9 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -936,8 +936,8 @@ mb_unmapped_free_mext(struct mbuf *m) mb_free_extpg(old_m); } -static struct mbuf * -_mb_unmapped_to_ext(struct mbuf *m) +static int +_mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres) { struct mbuf *m_new, *top, *prev, *mref; struct sf_buf *sf; @@ -947,9 +947,15 @@ _mb_unmapped_to_ext(struct mbuf *m) u_int ref_inc = 0; M_ASSERTEXTPG(m); + + if (m->m_epg_tls != NULL) { + /* can't convert TLS mbuf */ + m_freem(m); + *mres = NULL; + return (EINVAL); + } + len = m->m_len; - KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", - __func__, m)); /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { @@ -1048,7 +1054,8 @@ _mb_unmapped_to_ext(struct mbuf *m) atomic_add_int(refcnt, ref_inc); } m_free(m); - return (top); + *mres = top; + return (0); fail: if (ref_inc != 0) { @@ -1065,13 +1072,15 @@ fail: } m_free(m); m_freem(top); - return (NULL); + *mres = NULL; + return (ENOMEM); } -struct mbuf * -mb_unmapped_to_ext(struct mbuf *top) +int +mb_unmapped_to_ext(struct mbuf *top, struct mbuf **mres) { - struct mbuf *m, *next, *prev = NULL; + struct mbuf *m, *m1, *next, *prev = NULL; + int error; prev = NULL; for (m = top; m != NULL; m = next) { @@ -1087,12 +1096,15 @@ mb_unmapped_to_ext(struct mbuf *top) */ prev->m_next = NULL; } - m = _mb_unmapped_to_ext(m); - if (m == NULL) { - m_freem(top); + error = _mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (top != m) + m_free(top); m_freem(next); - return (NULL); + *mres = NULL; + return (error); } + m = m1; if (prev == NULL) { top = m; } else { @@ -1111,7 +1123,8 @@ mb_unmapped_to_ext(struct mbuf *top) prev = m; } } - return (top); + *mres = top; + return (0); } /* diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 434f29feddcf..9373a3c3d656 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -813,7 +813,7 @@ struct mbuf *mb_alloc_ext_plus_pages(int, int); struct mbuf *mb_mapped_to_unmapped(struct mbuf *, int, int, int, struct mbuf **); int mb_unmapped_compress(struct mbuf *m); -struct mbuf *mb_unmapped_to_ext(struct mbuf *m); +int mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres); void mb_free_notready(struct mbuf *m, int count); void m_adj(struct mbuf *, int); void m_adj_decap(struct mbuf *, int); From nobody Mon Jan 13 19:30:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX2Qs1F18z5kjb5; Mon, 13 Jan 2025 19:30:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2Qr6LRnz3WhM; Mon, 13 Jan 2025 19:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eGyCLOysHMihXzEHe3JjqyfONPhJGsL5tCmo0ow1QHo=; b=UXdVnTx1GPdufcdV+5Smoz9D414BrTjiVn72FMEeIplkMyItLYgJGUjoiVGjqJhAQxPlVs RF2LRMUxrpo4MUVp9ShZ4B6kATekdesuRu/CUx0V9We/SJ/pXdmR8fcjITAJivN6iGd3Oo lKpOYvA2DEmSNlWFP9Ak02/QyTR0+STA7HfA01aWcUA2gyH1WFb42U2aOZyytip3Hrn+sL 6nXaiDuwEqWDnQ/m7xLBSr/jHTy2d+7DEmewAKZ9tc8XKU4D5CZP1sQ43IpW4M80BrccCu Jc+Y5lvM3IYRf8hW+lFWRLQUP6bDH/O7IekIFAKBip9q2MmwkcJCeiM2gE56Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eGyCLOysHMihXzEHe3JjqyfONPhJGsL5tCmo0ow1QHo=; b=OEKb7/W+JVG9n6XFW4oGRxeUoqiy7RBfI20GFt5W7Vm6HTUnEDK5GjZtZNUgpuNI+nfY6Y thnZip4blhFjutiwNz60mPUwidJE9yYkUpVhZQs7UAbaq2DrPjzI+kWUhjeu4DDcoYXM35 8XNck2q0mvOt0S0r4mkJlpq71b6FpHydfEEurtimeWpmH6IKuJ0nnp1HoCUNxklwm7xZDa GDshaoL8sktA8rHi76KRRmfupZANvO5reouPbknPNfR5moi7ULUqHshRFmHrFVqz6RIlxl rk+BaGDUislJRRP0pS757xNPautQpli4wuchqu0PWpTDufG12V1KH4kTUyKnag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796612; a=rsa-sha256; cv=none; b=usIgSsjJpJ/8j2zS4szAR/r+c3ei9jIT06NK3InlxyLIdvJzZB9NNAcAC6Y2uVRjxHl28R aQWe1cK3J2J2lAeZyjsqc1MX5FKYf+prWAJrob6uK6L+RU3XwG479jLkVkZkNORAyN5EnC MgXYnPd9aWUMeo5Fo2QGvQyq3VYt6HAZlfP1GPlUGGR/D9KXJEKOKxZhPNaat5+udC2Ghm YNyz6wV7q6RrDqCxrussPcAU+bGTrxm23EEsuoEM2OGU8o+AyNdtfsltN4eSLQGmwbjbaa Ibz9SiYlWEC72kElsC1AcJp4X8/TrJU3kwzhLoH99eLXhzGM0J+PTcS0SzcLPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX2Qr5gCzzkJY; Mon, 13 Jan 2025 19:30: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 50DJUCUY047122; Mon, 13 Jan 2025 19:30:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJUCFg047113; Mon, 13 Jan 2025 19:30:12 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:30:12 GMT Message-Id: <202501131930.50DJUCFg047113@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: b0e020764aae - main - ipsec + ktls: cannot coexists List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0e020764aae970545357b0f146dcba7b4b55864 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0e020764aae970545357b0f146dcba7b4b55864 commit b0e020764aae970545357b0f146dcba7b4b55864 Author: Konstantin Belousov AuthorDate: 2024-12-28 08:30:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:29:31 +0000 ipsec + ktls: cannot coexists but instead of tripping the assert in debug kernel, and silently falling into UB for prod, skip IPSEC processing for KTLS framed packets when mb_unmapped_to_ext() failed. Reviewed by: markj Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48265 --- sys/netinet/ip_output.c | 33 +++++++++++++++++++++++++-------- sys/netinet6/ip6_output.c | 34 ++++++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 770a95dae659..4f5d8b7279ba 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -667,17 +667,25 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IPSTAT_INC(ips_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv4, ifp, m, inp, mtu)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } /* * Check if there was a route for this packet; return error if not. @@ -731,11 +739,20 @@ sendit: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IPSTAT_INC(ips_odropped); - error = ENOBUFS; goto bad; + } else { + m = m1; } } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 9e4985cdc6cd..c6907835bc67 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -792,18 +792,26 @@ nonh6lookup: * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { - IP6STAT_INC(ip6s_odropped); - error = ENOBUFS; - goto bad; + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == ENOMEM) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } + /* XXXKIB */ + goto no_ipsec; } + m = m1; if ((error = IPSEC_OUTPUT(ipv6, ifp, m, inp, mtu == 0 ? ifp->if_mtu : mtu)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } +no_ipsec:; } #endif /* IPSEC */ @@ -1106,10 +1114,20 @@ passout: /* Ensure the packet data is mapped if the interface requires it. */ if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) { - m = mb_unmapped_to_ext(m); - if (m == NULL) { + struct mbuf *m1; + + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if_printf(ifp, "TLS packet\n"); + /* XXXKIB */ + } else if (error == ENOMEM) { + error = ENOBUFS; + } IP6STAT_INC(ip6s_odropped); - return (ENOBUFS); + return (error); + } else { + m = m1; } } From nobody Mon Jan 13 19:30:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX2Qt1f8yz5kjg9; Mon, 13 Jan 2025 19:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX2Qs6ggqz3WWl; Mon, 13 Jan 2025 19:30:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9yOrajK+CsUPvYLRwtTDogIseexOk7dTkTDQWykEis=; b=dDxFFEgkISji1yCvqdnqagYWWTprBkKVCJj7TEqDdoNqgvNDfWo8CUFJI3OgOZQCQQNwgG AFBria9G45CrSpL6d6s+0B0XWB0pUj3AS+oOJIVFTIhTnI4tVIw03z6NhIFrhqive8DisE FHJhwZ1sATRbxaUFTPglp03KbDdzhnoA6WRz1PUKoqzyBgqEqcRvwaHEP5+OGbNqTz2nED 7yd6gcZNHXIlIniF3cDp7tmnPeV0lXX0PYxGcDO24d/q1kbWqJwYpMUC4hIgkWlUvhDjvt vPVrMrTp4a0wQDYuebfqQDHYgCJdwNHdN49XWRDxmg7xgHQr5FIkn3pW+vZqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736796613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9yOrajK+CsUPvYLRwtTDogIseexOk7dTkTDQWykEis=; b=RGHW98MRkdRYlG6Hx50whm6z6ck3oepxhW2FRgORlIFM2babix6TBmUiBgKDSQlmOot4MY YTyWslZtGd9hG99DvzURVlhNB/MJHPE87PCDXKwjdF/xUwgyAss47VIGki2OTn63an83ly 2+q25TM5k9l0BdNhl+7fZrKpVRk8OX+oLCfMxGBv/AVqMspXRx7UTsHj632HlreifocJyJ rhw+ZFHs3aA6kTiU5pEGuxByVrPpCuW9qTtDJq06Iuol6PmAmY0AQOzZxjnpD06ej4PrkR 2itmJ/vkAaBKuJKetJ31M2hPaF4+77+SmYBuyTl4M7ZeJTzLURRWQ9JJcPVLRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736796613; a=rsa-sha256; cv=none; b=WebluRphEleI4cxZnL7yCRe9miX/+soLv3uo+BWq2/JUKzQdVPbeUQ4VVTkACuRSnz6WQa CGvgjl7MF/ynDiURXlnTHguFV4Aui4PfZoQIlbOEEkZNjMMzGCu2zhjr+ClyvdxtCXIvPf pCevZ1eoZkRsPm/LOVMuCDiHnng5m0FXvQrNv6QM3NOQyzvZ5r1j5Jw4K84vhYQatnDf/s dUMJMWAfNVgB2nhnWudgDbSs7I6lCEF6SCDj6+HtM3nO2C2Q4ykbw2cwnv3F2umatWTSmQ XkwPW9PK+xbUZVCKZkowSUjBnBBKgkSpWoC888DTVVqk3KUSCTpy1WXljTHqcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX2Qs67ghzkb8; Mon, 13 Jan 2025 19:30: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 50DJUDtv047827; Mon, 13 Jan 2025 19:30:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DJUDJv047814; Mon, 13 Jan 2025 19:30:13 GMT (envelope-from git) Date: Mon, 13 Jan 2025 19:30:13 GMT Message-Id: <202501131930.50DJUDJv047814@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: 0ff2d00d2aa3 - main - ipsec: allow it to work with unmapped mbufs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ff2d00d2aa37cd883ffd8c7363dddef9cba267e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0ff2d00d2aa37cd883ffd8c7363dddef9cba267e commit 0ff2d00d2aa37cd883ffd8c7363dddef9cba267e Author: Konstantin Belousov AuthorDate: 2024-12-29 07:12:26 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-13 19:29:32 +0000 ipsec: allow it to work with unmapped mbufs Only map mbuf when a policy is looked up and indicates that IPSEC needs to transform the packet. If IPSEC is inline offloaded, it is up to the interface driver to request remap if needed. Fetch the IP header using m_copydata() instead of using mtod() to select policy/SA. Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D48265 --- sys/net/if_ipsec.c | 8 ++-- sys/netinet/ip_output.c | 22 +++------- sys/netinet6/ip6_output.c | 14 ------- sys/netipsec/ipsec.c | 64 +++++++++++++++-------------- sys/netipsec/ipsec.h | 14 ++++--- sys/netipsec/ipsec_output.c | 96 ++++++++++++++++++++++++++++++-------------- sys/netipsec/ipsec_support.h | 2 + sys/netipsec/subr_ipsec.c | 18 ++------- sys/netipsec/xform_tcp.c | 2 +- 9 files changed, 126 insertions(+), 114 deletions(-) diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index 849127f75de6..df10af66471c 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -353,7 +353,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) IPSEC_RLOCK_TRACKER; struct ipsec_softc *sc; struct secpolicy *sp; - struct ip *ip; + struct ip *ip, iph; uint32_t af; int error; @@ -375,7 +375,8 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) } /* Determine address family to correctly handle packet in BPF */ - ip = mtod(m, struct ip *); + ip = &iph; + m_copydata(m, 0, sizeof(*ip), (char *)ip); switch (ip->ip_v) { #ifdef INET case IPVERSION: @@ -415,7 +416,8 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) switch (af) { #ifdef INET case AF_INET: - error = ipsec4_process_packet(ifp, m, sp, NULL, ifp->if_mtu); + error = ipsec4_process_packet(ifp, m, ip, sp, NULL, + ifp->if_mtu); break; #endif #ifdef INET6 diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 4f5d8b7279ba..9317d5d57e1d 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -667,26 +667,19 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { - struct mbuf *m1; + struct ip ip_hdr; - error = mb_unmapped_to_ext(m, &m1); - if (error != 0) { - if (error == ENOMEM) { - IPSTAT_INC(ips_odropped); - error = ENOBUFS; - goto bad; - } - /* XXXKIB */ - goto no_ipsec; - } - m = m1; if ((error = IPSEC_OUTPUT(ipv4, ifp, m, inp, mtu)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } -no_ipsec:; + + /* Update variables that are affected by ipsec4_output(). */ + m_copydata(m, 0, sizeof(ip_hdr), (char *)&ip_hdr); + hlen = ip_hdr.ip_hl << 2; } + /* * Check if there was a route for this packet; return error if not. */ @@ -695,9 +688,6 @@ no_ipsec:; error = EHOSTUNREACH; goto bad; } - /* Update variables that are affected by ipsec4_output(). */ - ip = mtod(m, struct ip *); - hlen = ip->ip_hl << 2; #endif /* IPSEC */ /* Jump over all PFIL processing if hooks are not active. */ diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index c6907835bc67..c48101aa2990 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -792,26 +792,12 @@ nonh6lookup: * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { - struct mbuf *m1; - - error = mb_unmapped_to_ext(m, &m1); - if (error != 0) { - if (error == ENOMEM) { - IP6STAT_INC(ip6s_odropped); - error = ENOBUFS; - goto bad; - } - /* XXXKIB */ - goto no_ipsec; - } - m = m1; if ((error = IPSEC_OUTPUT(ipv6, ifp, m, inp, mtu == 0 ? ifp->if_mtu : mtu)) != 0) { if (error == EINPROGRESS) error = 0; goto done; } -no_ipsec:; } #endif /* IPSEC */ diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c index 9b18cedc7a80..8d604a24eeea 100644 --- a/sys/netipsec/ipsec.c +++ b/sys/netipsec/ipsec.c @@ -286,8 +286,9 @@ static int ipsec_in_reject(struct secpolicy *, struct inpcb *, const struct mbuf *); #ifdef INET -static void ipsec4_get_ulp(const struct mbuf *, struct secpolicyindex *, int); -static void ipsec4_setspidx_ipaddr(const struct mbuf *, +static void ipsec4_get_ulp(const struct mbuf *, const struct ip *, + struct secpolicyindex *, int); +static void ipsec4_setspidx_ipaddr(const struct mbuf *, struct ip *, struct secpolicyindex *); #endif #ifdef INET6 @@ -488,8 +489,8 @@ ipsec_getpcbpolicy(struct inpcb *inp, u_int dir) #ifdef INET static void -ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *spidx, - int needport) +ipsec4_get_ulp(const struct mbuf *m, const struct ip *ip1, + struct secpolicyindex *spidx, int needport) { uint8_t nxt; int off; @@ -498,21 +499,10 @@ ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *spidx, IPSEC_ASSERT(m->m_pkthdr.len >= sizeof(struct ip), ("packet too short")); - if (m->m_len >= sizeof (struct ip)) { - const struct ip *ip = mtod(m, const struct ip *); - if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) - goto done; - off = ip->ip_hl << 2; - nxt = ip->ip_p; - } else { - struct ip ih; - - m_copydata(m, 0, sizeof (struct ip), (caddr_t) &ih); - if (ih.ip_off & htons(IP_MF | IP_OFFMASK)) - goto done; - off = ih.ip_hl << 2; - nxt = ih.ip_p; - } + if (ip1->ip_off & htons(IP_MF | IP_OFFMASK)) + goto done; + off = ip1->ip_hl << 2; + nxt = ip1->ip_p; while (off < m->m_pkthdr.len) { struct ip6_ext ip6e; @@ -565,17 +555,18 @@ done_proto: } static void -ipsec4_setspidx_ipaddr(const struct mbuf *m, struct secpolicyindex *spidx) +ipsec4_setspidx_ipaddr(const struct mbuf *m, struct ip *ip1, + struct secpolicyindex *spidx) { - ipsec4_setsockaddrs(m, &spidx->src, &spidx->dst); + ipsec4_setsockaddrs(m, ip1, &spidx->src, &spidx->dst); spidx->prefs = sizeof(struct in_addr) << 3; spidx->prefd = sizeof(struct in_addr) << 3; } static struct secpolicy * -ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir, - int needport) +ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, struct ip *ip1, + u_int dir, int needport) { struct secpolicyindex spidx; struct secpolicy *sp; @@ -583,8 +574,8 @@ ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir, sp = ipsec_getpcbpolicy(inp, dir); if (sp == NULL && key_havesp(dir)) { /* Make an index to look for a policy. */ - ipsec4_setspidx_ipaddr(m, &spidx); - ipsec4_get_ulp(m, &spidx, needport); + ipsec4_setspidx_ipaddr(m, ip1, &spidx); + ipsec4_get_ulp(m, ip1, &spidx, needport); spidx.dir = dir; sp = key_allocsp(&spidx, dir); } @@ -597,13 +588,13 @@ ipsec4_getpolicy(const struct mbuf *m, struct inpcb *inp, u_int dir, * Check security policy for *OUTBOUND* IPv4 packet. */ struct secpolicy * -ipsec4_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error, - int needport) +ipsec4_checkpolicy(const struct mbuf *m, struct inpcb *inp, struct ip *ip1, + int *error, int needport) { struct secpolicy *sp; *error = 0; - sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_OUTBOUND, needport); + sp = ipsec4_getpolicy(m, inp, ip1, IPSEC_DIR_OUTBOUND, needport); if (sp != NULL) sp = ipsec_checkpolicy(sp, inp, error); if (sp == NULL) { @@ -630,12 +621,13 @@ ipsec4_checkpolicy(const struct mbuf *m, struct inpcb *inp, int *error, * rip_input() and sctp_input(). */ int -ipsec4_in_reject(const struct mbuf *m, struct inpcb *inp) +ipsec4_in_reject1(const struct mbuf *m, struct ip *ip1, struct inpcb *inp) { struct secpolicy *sp; #ifdef IPSEC_OFFLOAD struct ipsec_accel_in_tag *tag; #endif + struct ip ip_hdr; int result; #ifdef IPSEC_OFFLOAD @@ -643,7 +635,13 @@ ipsec4_in_reject(const struct mbuf *m, struct inpcb *inp) if (tag != NULL) return (0); #endif - sp = ipsec4_getpolicy(m, inp, IPSEC_DIR_INBOUND, 0); + + if (ip1 == NULL) { + ip1 = &ip_hdr; + m_copydata(m, 0, sizeof(*ip1), (char *)ip1); + } + + sp = ipsec4_getpolicy(m, inp, ip1, IPSEC_DIR_INBOUND, 0); result = ipsec_in_reject(sp, inp, m); key_freesp(&sp); if (result != 0) @@ -651,6 +649,12 @@ ipsec4_in_reject(const struct mbuf *m, struct inpcb *inp) return (result); } +int +ipsec4_in_reject(const struct mbuf *m, struct inpcb *inp) +{ + return (ipsec4_in_reject1(m, NULL, inp)); +} + /* * IPSEC_CAP() method implementation for IPv4. */ diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h index 8f3e8f02d88b..f8c5b10e7bd6 100644 --- a/sys/netipsec/ipsec.h +++ b/sys/netipsec/ipsec.h @@ -325,6 +325,7 @@ VNET_DECLARE(int, natt_cksum_policy); #endif struct inpcb; +struct ip; struct m_tag; struct secasvar; struct sockopt; @@ -336,7 +337,7 @@ int ipsec_if_input(struct mbuf *, struct secasvar *, uint32_t); struct ipsecrequest *ipsec_newisr(void); void ipsec_delisr(struct ipsecrequest *); struct secpolicy *ipsec4_checkpolicy(const struct mbuf *, struct inpcb *, - int *, int); + struct ip *, int *, int); u_int ipsec_get_reqlevel(struct secpolicy *, u_int); @@ -351,12 +352,13 @@ size_t ipsec_hdrsiz_internal(struct secpolicy *); void ipsec_setspidx_inpcb(struct inpcb *, struct secpolicyindex *, u_int); -void ipsec4_setsockaddrs(const struct mbuf *, union sockaddr_union *, - union sockaddr_union *); +void ipsec4_setsockaddrs(const struct mbuf *, const struct ip *, + union sockaddr_union *, union sockaddr_union *); int ipsec4_common_input_cb(struct mbuf *, struct secasvar *, int, int); -int ipsec4_check_pmtu(struct ifnet *, struct mbuf *, struct secpolicy *, int); -int ipsec4_process_packet(struct ifnet *, struct mbuf *, struct secpolicy *, - struct inpcb *, u_long); +int ipsec4_check_pmtu(struct ifnet *, struct mbuf *, struct ip *ip1, + struct secpolicy *, int); +int ipsec4_process_packet(struct ifnet *, struct mbuf *, struct ip *ip1, + struct secpolicy *, struct inpcb *, u_long); int ipsec_process_done(struct mbuf *, struct secpolicy *, struct secasvar *, u_int); diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 73a32c71fffc..8d8a304e7af4 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -111,14 +111,13 @@ static size_t ipsec_get_pmtu(struct secasvar *sav); #ifdef INET static struct secasvar * -ipsec4_allocsa(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, - u_int *pidx, int *error) +ipsec4_allocsa(struct ifnet *ifp, struct mbuf *m, const struct ip *ip, + struct secpolicy *sp, u_int *pidx, int *error) { struct secasindex *saidx, tmpsaidx; struct ipsecrequest *isr; struct sockaddr_in *sin; struct secasvar *sav; - struct ip *ip; /* * Check system global policy controls. @@ -142,7 +141,6 @@ next: if (isr->saidx.mode == IPSEC_MODE_TRANSPORT) { saidx = &tmpsaidx; *saidx = isr->saidx; - ip = mtod(m, struct ip *); if (saidx->src.sa.sa_len == 0) { sin = &saidx->src.sin; sin->sin_len = sizeof(*sin); @@ -188,13 +186,14 @@ next: * IPsec output logic for IPv4. */ static int -ipsec4_perform_request(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, - struct inpcb *inp, u_int idx, u_long mtu) +ipsec4_perform_request(struct ifnet *ifp, struct mbuf *m, struct ip *ip1, + struct secpolicy *sp, struct inpcb *inp, u_int idx, u_long mtu) { struct ipsec_ctx_data ctx; union sockaddr_union *dst; struct secasvar *sav; struct ip *ip; + struct mbuf *m1; int error, hwassist, i, off; bool accel; @@ -209,7 +208,7 @@ ipsec4_perform_request(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, * determine next transform. At the end of transform we can * release reference to SP. */ - sav = ipsec4_allocsa(ifp, m, sp, &idx, &error); + sav = ipsec4_allocsa(ifp, m, ip1, sp, &idx, &error); if (sav == NULL) { if (error == EJUSTRETURN) { /* No IPsec required */ (void)ipsec_accel_output(ifp, m, inp, sp, NULL, @@ -225,6 +224,8 @@ ipsec4_perform_request(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, IPSEC_INIT_CTX(&ctx, &m, inp, sav, AF_INET, IPSEC_ENC_BEFORE); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0) goto bad; + /* Re-calculate *ip1 after potential change of m in the hook. */ + m_copydata(m, 0, sizeof(*ip1), (char *)ip1); hwassist = 0; accel = ipsec_accel_output(ifp, m, inp, sp, sav, AF_INET, mtu, @@ -240,16 +241,23 @@ ipsec4_perform_request(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, } #if defined(SCTP) || defined(SCTP_SUPPORT) if ((m->m_pkthdr.csum_flags & CSUM_SCTP & ~hwassist) != 0) { - struct ip *ip; - - ip = mtod(m, struct ip *); - sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2)); + sctp_delayed_cksum(m, (uint32_t)(ip1->ip_hl << 2)); m->m_pkthdr.csum_flags &= ~CSUM_SCTP; } #endif if (accel) return (EJUSTRETURN); + error = mb_unmapped_to_ext(m, &m1); + if (error != 0) { + if (error == EINVAL) { + if (bootverbose) + if_printf(ifp, "Tx TLS+IPSEC packet\n"); + } + return (error); + } + m = m1; + ip = mtod(m, struct ip *); dst = &sav->sah->saidx.dst; /* Do the appropriate encapsulation, if necessary */ @@ -317,19 +325,18 @@ bad: } int -ipsec4_process_packet(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, - struct inpcb *inp, u_long mtu) +ipsec4_process_packet(struct ifnet *ifp, struct mbuf *m, struct ip *ip1, + struct secpolicy *sp, struct inpcb *inp, u_long mtu) { - return (ipsec4_perform_request(ifp, m, sp, inp, 0, mtu)); + return (ipsec4_perform_request(ifp, m, ip1, sp, inp, 0, mtu)); } int -ipsec4_check_pmtu(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, - int forwarding) +ipsec4_check_pmtu(struct ifnet *ifp, struct mbuf *m, struct ip *ip1, + struct secpolicy *sp, int forwarding) { struct secasvar *sav; - struct ip *ip; size_t hlen, pmtu; uint32_t idx; int error; @@ -341,13 +348,12 @@ ipsec4_check_pmtu(struct ifnet *ifp, struct mbuf *m, struct secpolicy *sp, goto setdf; /* V_ip4_ipsec_dfbit > 1 - we will copy it from inner header. */ - ip = mtod(m, struct ip *); - if (!(ip->ip_off & htons(IP_DF))) + if ((ip1->ip_off & htons(IP_DF)) == 0) return (0); setdf: idx = sp->tcount - 1; - sav = ipsec4_allocsa(ifp, m, sp, &idx, &error); + sav = ipsec4_allocsa(ifp, m, ip1, sp, &idx, &error); if (sav == NULL) { key_freesp(&sp); /* @@ -398,14 +404,14 @@ setdf: } static int -ipsec4_common_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, - int forwarding, u_long mtu) +ipsec4_common_output1(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, + struct ip *ip1, int forwarding, u_long mtu) { struct secpolicy *sp; int error; /* Lookup for the corresponding outbound security policy */ - sp = ipsec4_checkpolicy(m, inp, &error, !forwarding); + sp = ipsec4_checkpolicy(m, inp, ip1, &error, !forwarding); if (sp == NULL) { if (error == -EINVAL) { /* Discarded by policy. */ @@ -425,7 +431,7 @@ ipsec4_common_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, */ /* NB: callee frees mbuf and releases reference to SP */ - error = ipsec4_check_pmtu(ifp, m, sp, forwarding); + error = ipsec4_check_pmtu(ifp, m, ip1, sp, forwarding); if (error != 0) { if (error == EJUSTRETURN) return (0); @@ -433,7 +439,7 @@ ipsec4_common_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, return (error); } - error = ipsec4_process_packet(ifp, m, sp, inp, mtu); + error = ipsec4_process_packet(ifp, m, ip1, sp, inp, mtu); if (error == EJUSTRETURN) { /* * We had a SP with a level of 'use' and no SA. We @@ -447,6 +453,28 @@ ipsec4_common_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, return (error); } +static int +ipsec4_common_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, + struct ip *ip1, int forwarding, u_long mtu) +{ + struct ip ip_hdr; + struct ip *ip; + + if (((m->m_flags & M_PKTHDR) != 0 && m->m_pkthdr.len < sizeof(*ip)) || + ((m->m_flags & M_PKTHDR) == 0 && m->m_len < sizeof(*ip))) { + m_free(m); + return (EACCES); + } + if (ip1 != NULL) { + ip = ip1; + } else { + ip = &ip_hdr; + m_copydata(m, 0, sizeof(*ip), (char *)ip); + } + + return (ipsec4_common_output1(ifp, m, inp, ip, forwarding, mtu)); +} + /* * IPSEC_OUTPUT() method implementation for IPv4. * 0 - no IPsec handling needed @@ -464,7 +492,7 @@ ipsec4_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, u_long mtu) if (m_tag_find(m, PACKET_TAG_IPSEC_OUT_DONE, NULL) != NULL) return (0); - return (ipsec4_common_output(ifp, m, inp, 0, mtu)); + return (ipsec4_common_output(ifp, m, inp, NULL, 0, mtu)); } /* @@ -475,16 +503,20 @@ ipsec4_output(struct ifnet *ifp, struct mbuf *m, struct inpcb *inp, u_long mtu) int ipsec4_forward(struct mbuf *m) { + struct ip ip_hdr; + + m_copydata(m, 0, sizeof(ip_hdr), (char *)&ip_hdr); /* * Check if this packet has an active inbound SP and needs to be * dropped instead of forwarded. */ - if (ipsec4_in_reject(m, NULL) != 0) { + if (ipsec4_in_reject1(m, &ip_hdr, NULL) != 0) { m_freem(m); return (EACCES); } - return (ipsec4_common_output(NULL /* XXXKIB */, m, NULL, 1, 0)); + return (ipsec4_common_output(NULL /* XXXKIB */, m, NULL, &ip_hdr, + 1, 0)); } #endif @@ -874,6 +906,9 @@ ipsec_process_done(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, struct xform_history *xh; struct secasindex *saidx; struct m_tag *mtag; +#ifdef INET + struct ip *ip; +#endif int error; if (sav->state >= SADB_SASTATE_DEAD) { @@ -884,8 +919,9 @@ ipsec_process_done(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, switch (saidx->dst.sa.sa_family) { #ifdef INET case AF_INET: + ip = mtod(m, struct ip *); /* Fix the header length, for AH processing. */ - mtod(m, struct ip *)->ip_len = htons(m->m_pkthdr.len); + ip->ip_len = htons(m->m_pkthdr.len); break; #endif /* INET */ #ifdef INET6 @@ -943,7 +979,7 @@ ipsec_process_done(struct mbuf *m, struct secpolicy *sp, struct secasvar *sav, case AF_INET: key_freesav(&sav); IPSECSTAT_INC(ips_out_bundlesa); - return (ipsec4_perform_request(NULL, m, sp, NULL, + return (ipsec4_perform_request(NULL, m, ip, sp, NULL, idx, 0)); /* NOTREACHED */ #endif diff --git a/sys/netipsec/ipsec_support.h b/sys/netipsec/ipsec_support.h index 0cbfe6ddfee5..26f5e8a82d87 100644 --- a/sys/netipsec/ipsec_support.h +++ b/sys/netipsec/ipsec_support.h @@ -30,6 +30,7 @@ #ifdef _KERNEL #if defined(IPSEC) || defined(IPSEC_SUPPORT) struct ifnet; +struct ip; struct mbuf; struct inpcb; struct tcphdr; @@ -56,6 +57,7 @@ int udp_ipsec_pcbctl(struct inpcb *, struct sockopt *); #endif #ifdef INET int ipsec4_in_reject(const struct mbuf *, struct inpcb *); +int ipsec4_in_reject1(const struct mbuf *m, struct ip *ip1, struct inpcb *inp); int ipsec4_input(struct mbuf *, int, int); int ipsec4_forward(struct mbuf *); int ipsec4_pcbctl(struct inpcb *, struct sockopt *); diff --git a/sys/netipsec/subr_ipsec.c b/sys/netipsec/subr_ipsec.c index 2f7e0f09882e..bb8b62a841c6 100644 --- a/sys/netipsec/subr_ipsec.c +++ b/sys/netipsec/subr_ipsec.c @@ -61,8 +61,8 @@ #ifdef INET void -ipsec4_setsockaddrs(const struct mbuf *m, union sockaddr_union *src, - union sockaddr_union *dst) +ipsec4_setsockaddrs(const struct mbuf *m, const struct ip *ip1, + union sockaddr_union *src, union sockaddr_union *dst) { static const struct sockaddr_in template = { sizeof (struct sockaddr_in), @@ -73,18 +73,8 @@ ipsec4_setsockaddrs(const struct mbuf *m, union sockaddr_union *src, src->sin = template; dst->sin = template; - if (m->m_len < sizeof (struct ip)) { - m_copydata(m, offsetof(struct ip, ip_src), - sizeof (struct in_addr), - (caddr_t) &src->sin.sin_addr); - m_copydata(m, offsetof(struct ip, ip_dst), - sizeof (struct in_addr), - (caddr_t) &dst->sin.sin_addr); - } else { - const struct ip *ip = mtod(m, const struct ip *); - src->sin.sin_addr = ip->ip_src; - dst->sin.sin_addr = ip->ip_dst; - } + src->sin.sin_addr = ip1->ip_src; + dst->sin.sin_addr = ip1->ip_dst; } #endif #ifdef INET6 diff --git a/sys/netipsec/xform_tcp.c b/sys/netipsec/xform_tcp.c index d52051d415a8..d3d4d6c4d734 100644 --- a/sys/netipsec/xform_tcp.c +++ b/sys/netipsec/xform_tcp.c @@ -240,7 +240,7 @@ setsockaddrs(const struct mbuf *m, union sockaddr_union *src, switch (ip->ip_v) { #ifdef INET case IPVERSION: - ipsec4_setsockaddrs(m, src, dst); + ipsec4_setsockaddrs(m, ip, src, dst); break; #endif #ifdef INET6 From nobody Mon Jan 13 20:07:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX3GS1b68z5klkN; Mon, 13 Jan 2025 20:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX3GS0Vlfz3bLm; Mon, 13 Jan 2025 20: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=1736798880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ExZAnKtP+n+NfVb9/SxBvQtaOzMaOSSeJGWkR1OMFTM=; b=KfQotQ3qUfHxJVqIJhEOs/J2Y9T46WYjXyInMVhm+Pj7yfWTTXOUQcOoQPzpb3poLZm638 nyYb+l7hWPghYp0uzWwjoNJuY0NPyPBjeMKM9ZwX/wND13aMFggbgbMjRVvDqwCw5+7QR2 fXSwhoevQwOBhiD6HQyxqWLkkc+Lv3Lgt83GOBMeRZnD5iAO2XQAn08fWOgc8UTazWAYRo 8odAdvEL50LXy2nFj9einh1BXaXHqwrehkpzntssDEJ7j3qoUia6lb3/c8ozzxpy/MumbG BcIMxIJszS4cl4h0GvmV7uhRU7xaGvw9W9QWi9fNGdsPvC8MBDGXigl+mkekTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736798880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ExZAnKtP+n+NfVb9/SxBvQtaOzMaOSSeJGWkR1OMFTM=; b=kl7n5jf3mozR/y/YXPDO3pNBhVOrrvYpNMEiFRWtj0Fe35MT4K1hKmLcQPMs6Nya0MOhF4 MjudM/c2OyrbNfhvbdaG+KGoXa3HkAhgchkebNJq1GkaSC9smxzo0YnFDz04opUkC0vMrU biqxV3j3JSYo9zHJm9t8s3/4hgcoKs8DvSvhsf/365muYG6B+7mEqtFnrz6QlTsmlg6GjD ZzzhZfgDorAme0OBC2SKIEopFPx6Jb6L6kELY2kswG/85ZWHlYtGSE5GYr7W1xPYSnVRyX RELcv4u3GQoCMvIORKgPk/eLOQirEfu27w7TMrTzYtGrgoHQyLAObbSTa+jDRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736798880; a=rsa-sha256; cv=none; b=SCc73gK0DmqMBQDXgs/h6JXPa2ir/kPWvXNKU5kY+mrDPIeWmjV8qe7YrW3ZAHfXZIQcHh HPc0nhmX17PfovqdqChW4n9vrCcRGKWZm88u/Gg4JRy4nKtlli3U5IqMSpFWdumSfmJ9JN BFIYgIShAEEp3U1uu3NIlbT4pip9oy1i8pSZ2W+UmshLBE43Gx7jcwBQKbcaJtARARwBtz q8fjPH4l8+T0gx4g7a1I82ERDPeWIgy1rU6paB5InXOsZGHsJLOPonXpBQFFQMPvCJ1V1Q nm8dBTcixAIfCnURhl4fmcrjNNVdx6skISmJrEqM4PztqkhoQOuIMC6b8vv72w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX3GR75dGzlnp; Mon, 13 Jan 2025 20: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 50DK7xCg016895; Mon, 13 Jan 2025 20: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 50DK7xim016892; Mon, 13 Jan 2025 20:07:59 GMT (envelope-from git) Date: Mon, 13 Jan 2025 20:07:59 GMT Message-Id: <202501132007.50DK7xim016892@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: 6751f65e6af1 - main - nvmf: Defer the post-sync shutdown handler to SHUTDOWN_PRI_LAST List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6751f65e6af15348abdc6106cf54c8335d45e49b Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6751f65e6af15348abdc6106cf54c8335d45e49b commit 6751f65e6af15348abdc6106cf54c8335d45e49b Author: John Baldwin AuthorDate: 2024-10-31 15:03:41 +0000 Commit: John Baldwin CommitDate: 2025-01-13 20:04:29 +0000 nvmf: Defer the post-sync shutdown handler to SHUTDOWN_PRI_LAST nda(4) has its own shutdown handler that runs at SHUTDOWN_PRI_DEFAULT that calls ndaflush() that could run after the nvmf handler. Instead, give a the flush a chance to run before the graceful shutdown of the controller. While here, be a bit more defensive in the post-sync case and shutdown the consumers (sim and /dev/nvmeXnY devices) before destroying the queue pairs so that if any requests are submitted after the post-sync handler they fail gracefully instead of trying to use a destroyed queue pair. Reported by: Sony Arpita Das Sponsored by: Chelsio Communications --- sys/dev/nvmf/host/nvmf.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/dev/nvmf/host/nvmf.c b/sys/dev/nvmf/host/nvmf.c index 09d5cecdfad6..77d3081243f6 100644 --- a/sys/dev/nvmf/host/nvmf.c +++ b/sys/dev/nvmf/host/nvmf.c @@ -554,7 +554,7 @@ nvmf_attach(device_t dev) sc->shutdown_pre_sync_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, nvmf_shutdown_pre_sync, sc, SHUTDOWN_PRI_FIRST); sc->shutdown_post_sync_eh = EVENTHANDLER_REGISTER(shutdown_post_sync, - nvmf_shutdown_post_sync, sc, SHUTDOWN_PRI_FIRST); + nvmf_shutdown_post_sync, sc, SHUTDOWN_PRI_LAST); return (0); out: @@ -776,6 +776,18 @@ nvmf_shutdown_post_sync(void *arg, int howto) callout_drain(&sc->ka_rx_timer); nvmf_shutdown_controller(sc); + + /* + * Quiesce consumers so that any commands submitted after this + * fail with an error. Notably, nda(4) calls nda_flush() from + * a post_sync handler that might be ordered after this one. + */ + for (u_int i = 0; i < sc->cdata->nn; i++) { + if (sc->ns[i] != NULL) + nvmf_shutdown_ns(sc->ns[i]); + } + nvmf_shutdown_sim(sc); + for (u_int i = 0; i < sc->num_io_queues; i++) { nvmf_destroy_qp(sc->io[i]); } From nobody Mon Jan 13 21:28:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX53r2RmDz5kqsk; Mon, 13 Jan 2025 21:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX53r1dVqz3jyT; Mon, 13 Jan 2025 21:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736803736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMZOF1B4o2Vnxf0ZYd25V66L2QlaFlHl6XqfGmXoKr0=; b=PlVS3vM0+C1tuggbwYybt6PIYy7GT883GU9ym2Y2n5OxCzoHYNRlVvJ0xCNYhYeCpD3bli LdDTC/qylcyyGVqXl+IFwBKCasN+suziefc3rJnbCTFdghtNdeNdY1Gm1RjUiuBk9UZATn g3FZ+nPdTUdRcyTbLk1ju0wy5Irl/7ncwMbazD9ozeCPAwgEL0RnadlBYldVetIJazl94J K5fURkHDsYbUt9+3dOFn9S9N+sOps8DnDiL+fvCbjZP34jAToak9a248S1PIuzU/KLcso+ MzDQctDeHrUwUJClM3yVrK536Fmz36dywezgYNIyK+NmXCcj9fvhwXOVl8QReQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736803736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMZOF1B4o2Vnxf0ZYd25V66L2QlaFlHl6XqfGmXoKr0=; b=ieuGVuxXxxPI/koZKmxAyvbw7iFgDGtMBNxtnGSosgWfHpNERaDp06vd5FXEQl09W/OfiI I61XwA4ZWsGQ2sht8ispK7fVTIymzqQRMCBfJVz4PR2XnUS3g90i0/+FJ4F9zoWEptorPM 1FgUtpniq0W0eNcPV0OXa78D/f9yKtB4OCbrdWj9wG8HBXWWv63tZGLfshbLPt4xZbdmNH wSr0/zQntMcW/AWX+hCL/InGzfRxLDJROl7F9wI3NzHdIx2JEBwUs9/m7iIa4l+fKG4ulL Sie87MlLFgGxHdRkr213/P5bmONxQJLaJde8G/RNO8BIBXXxIDDZHs570g0Fsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736803736; a=rsa-sha256; cv=none; b=Dms4f+Lo+y+joeEZR6VnPn3Pc44JXLJyCPt7AtJVsu0lvja08Qsz8J9x0SjzeuS0hpZqQF 030DFYyeftuIBRho3PDlyl3G9pdEIli1LUVkmm0FX/0Q9TY59gFjiWstc7Pt/8JXUyipPY r5eloMPYE7PHzHGwJ5hgi/+eyeQc6mfW0prl/Wws21Z26Tvs1k8IgkXTKKUDziM4frHwcA BcC8eFRDuSmvl7dG2xxBa/k+kpksPPH26FX8wiz39Lwr57XdVXuz2P4T6jLoCvVB4wCwz4 F9Y5MaBgByPMBWHeGzomWqN9e803UDeqS75NXdlP/4DTB/eK9ubN7gmHv7yMkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX53r17s0znn4; Mon, 13 Jan 2025 21:28: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 50DLSuPj066564; Mon, 13 Jan 2025 21:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DLSuAQ066561; Mon, 13 Jan 2025 21:28:56 GMT (envelope-from git) Date: Mon, 13 Jan 2025 21:28:56 GMT Message-Id: <202501132128.50DLSuAQ066561@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: 63f28490237f - main - ng_ksocket: fix build without INET6 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63f28490237fd8a8646c897e93b82e1ee0962502 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=63f28490237fd8a8646c897e93b82e1ee0962502 commit 63f28490237fd8a8646c897e93b82e1ee0962502 Author: Gleb Smirnoff AuthorDate: 2025-01-13 21:27:32 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 21:27:32 +0000 ng_ksocket: fix build without INET6 Fixes: 9234a50752cd47887849d4665af0f9f4abdefb5d --- sys/netgraph/ng_ksocket.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c index 43a2747224f3..74b2e211c0ed 100644 --- a/sys/netgraph/ng_ksocket.c +++ b/sys/netgraph/ng_ksocket.c @@ -44,6 +44,8 @@ * version of a socket... kindof like the reverse of the socket node type. */ +#include "opt_inet6.h" + #include #include #include @@ -313,7 +315,7 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type, sin->sin_len = sizeof(*sin); break; } - +#ifdef INET6 case PF_INET6: { struct sockaddr_in6 *const sin6 = (struct sockaddr_in6 *)sa; @@ -366,7 +368,7 @@ ng_ksocket_sockaddr_parse(const struct ng_parse_type *type, sin6->sin6_len = sizeof(*sin6); break; } - +#endif /* INET6 */ default: return (EINVAL); } @@ -424,7 +426,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type, *off += sizeof(*sin); return(0); } - +#ifdef INET6 case PF_INET6: { const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa; @@ -443,7 +445,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type, *off += sizeof(*sin6); return(0); } - +#endif /* INET6 */ default: return (*ng_ksocket_generic_sockaddr_type.supertype->unparse) (&ng_ksocket_generic_sockaddr_type, From nobody Mon Jan 13 21:28:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX53s4Psyz5kqwT; Mon, 13 Jan 2025 21:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX53s2WLlz3jpr; Mon, 13 Jan 2025 21:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736803737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bm8f++XJ3GCJMC+axkzuRyw8CG9fcIIBig4UjDSnti0=; b=QW05vmg1UIQIV2fn1CezJ4QRH4FB49fTTJbHzUAMFc6A/41O54L64j+H1esAyFt05sgc2d d7ZpYEXpPw6mFjXzcUu55Jvpp4Z2nCAIQyFcmHlvu0DfbYJVhkv7ZZzc8ixqzRWgInohGN DU4HYBtr2Lj1pWTmHQqZYIeh/USp5huJnwyup/onZxZzsgaCENs1Fhnk1DbHjPFBMS/TXV X0Gap22ZinIICTGa/7X3seLqv3zJcLsBIjs1eBcR7+XiQubqwsDPhHog1n9oQY9pVDod3U ycPYV7AQD6l5Vx6NAsTLPUWWlJQHPL/BpZh2zjHDNIYXj4a50mcBiL1q9CWQJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736803737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bm8f++XJ3GCJMC+axkzuRyw8CG9fcIIBig4UjDSnti0=; b=f9aNtXp4LmDe3ZZVQp3SYBTmArvlb/hIWmJj+mJ5yNuyWXJ0p+K2ETG5IY07kUa7QKUSZH C7V3ln3o7ss1Eh5awZya6UFPQGIwJPQG73730oNzAiJH0mA9XRuEzqZ2H6iZHMwMg++tmX jVbY6PFq6oG+d7zYNR9I4cf6X+toHrK55oFLb6t0CiL/wcf8L2lP30EFnHcdB8zbYJPpN7 nXJVho0/o3CIf/+FFEa3awCePT2y99hjKnSfvPxXrADcwEiGn1S33hi1MsIEJlC5PWzDDe R4Ca5YK3UhAltNX9cOS54tT0VkX3ra0lnOgL5hRF25V8MRn+C0cYwmBMSpBaAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736803737; a=rsa-sha256; cv=none; b=fJFQszY69r/5PdEoqTf345SazwLESds6eCkdqZrPADhYGumqrj9fh5NYOOB8NPBoCHORRj lRqBmRkCdK8aUORQUbYoQg9nhqlvRwfptJoaT5mjzBSi1GHZfET9U4B2Y7cmgMjdHl1Pqo hyElhg0tbWBtL94sQQIvstAcg23iHVLQm6ssSYPNVy+gpbIsT5/MGPSQKnu1VJ0jHVXlB8 XVECrSBwXLGRP+HCt+MBqUg3yzpSyOFdNYNzZKjkjDME/oRHlDZD0dUFsOtl8XsbKiZq9G WykiQEGQGZpuqOKih1mWyrV9Lchhc4V/phVeLmlLIsRQouQ43mhKJxpCST53NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX53s26fWzndt; Mon, 13 Jan 2025 21:28: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 50DLSvMP066634; Mon, 13 Jan 2025 21:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50DLSv5Z066631; Mon, 13 Jan 2025 21:28:57 GMT (envelope-from git) Date: Mon, 13 Jan 2025 21:28:57 GMT Message-Id: <202501132128.50DLSv5Z066631@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: 6ed3486980c9 - main - netlink: avoid underflow of groups bitset index List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ed3486980c95bfa2cbc0b19739e93e8c0df9f67 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6ed3486980c95bfa2cbc0b19739e93e8c0df9f67 commit 6ed3486980c95bfa2cbc0b19739e93e8c0df9f67 Author: Gleb Smirnoff AuthorDate: 2025-01-13 21:27:32 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-13 21:27:53 +0000 netlink: avoid underflow of groups bitset index The subtraction is absolutely unnecessary and created an underflow with 926d2eadcb67. I don't see why it was useful before 926d2eadcb67 and even before edf5608bfef3. The bitset addresses bits from zero to NLP_MAX_GROUPS-1. Note that check of user supplied argument for NETLINK_ADD_MEMBERSHIP and NETLINK_DROP_MEMBERSHIP socket options is already correct !(optval >= NLP_MAX_GROUPS). Fixes: 926d2eadcb671dd26431a1082d4c49c3d5ad7f22 --- sys/netlink/netlink_domain.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 45d427f43166..00eb2923eddf 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -138,8 +138,7 @@ nl_port_lookup(uint32_t port_id) static void nl_add_group_locked(struct nlpcb *nlp, unsigned int group_id) { - MPASS(group_id <= NLP_MAX_GROUPS); - --group_id; + MPASS(group_id < NLP_MAX_GROUPS); /* TODO: add family handler callback */ if (!nlp_unconstrained_vnet(nlp)) @@ -151,8 +150,7 @@ nl_add_group_locked(struct nlpcb *nlp, unsigned int group_id) static void nl_del_group_locked(struct nlpcb *nlp, unsigned int group_id) { - MPASS(group_id <= NLP_MAX_GROUPS); - --group_id; + MPASS(group_id < NLP_MAX_GROUPS); BIT_CLR(NLP_MAX_GROUPS, group_id, &nlp->nl_groups); } @@ -160,8 +158,7 @@ nl_del_group_locked(struct nlpcb *nlp, unsigned int group_id) static bool nl_isset_group_locked(struct nlpcb *nlp, unsigned int group_id) { - MPASS(group_id <= NLP_MAX_GROUPS); - --group_id; + MPASS(group_id < NLP_MAX_GROUPS); return (BIT_ISSET(NLP_MAX_GROUPS, group_id, &nlp->nl_groups)); } From nobody Tue Jan 14 00:11:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YX8gQ34fnz5l1Ys; Tue, 14 Jan 2025 00:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YX8gQ2NgQz40Xw; Tue, 14 Jan 2025 00:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736813490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=08pLxRajbFc8ESxM0jljYbf39UV9CTGnOpVzKwqKBAc=; b=xUKH/rpU2LQV5FKdb39L4OvBltlHHzDyLcdnKIR5yn8JiSkIHNTt8SMHTaD3FfXkIFpayA 4C1UoZ338AQzYNlgIY+2dZND3+GnvUR0OWTTUO2sJh0MUJ/BM4bnACBrQax6vsuO6gUGcA BOB3LposwUryEzg6q8Ri4Zxjd9dXbMF7v9ATNbw8+385Y1VNXwvtzA9bpshc2lSt4iOu4C lXHrtODP43MoeBw+0zxxksh2yDu8m5dpKzJiR5hZrBpY6lCLvZ/7TCX9C0W0gS/Sf30wZf 9QR22dvnP+oLiHWib/7xQr2tjrWNNqN5NAiax8+yWXM48LtwDBmdAFYkUD261g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736813490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=08pLxRajbFc8ESxM0jljYbf39UV9CTGnOpVzKwqKBAc=; b=C8yJZqA+8cIoZxgqERfrSYlLsmo5LQFQfZAywYPBPcnqICBLSQrIrGVJZQZvqVZI5y2ItI 09PUy+lr0WVSyPI+zno+LnhLwLL0IcIPGnUmzN0kKMu2BMPamEPE1mE4iRPZuNfWocuevr o/jF7THqOCw1Bpp77D0O+wzl0SMm/ZkSyXan6/qJXSqBLDyWXdQSmsc6DsaFGJRhFAf9+C qndSD+hQja3TkS+oiUyUIoMWWbFuNH2TFkKePZPXI05r0TRiXazaljsXK7+PBXxZhSq2m6 Inv0d7X+UyaOXTyJ/fcCzdtSFeCukfrnmpg9w7hUV2AyTnnPM1vfZV/Rdo5hcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736813490; a=rsa-sha256; cv=none; b=FYls8kuZKC9Ah8KcPiJdXHeDZSHRvjwUbyc/mNUragEfiF3GsohhAsGn/blSqxWqh5/Tb1 GR+ZtViCF4AXVKzjv0YkPXssJqQFit9MJD5OUIhm3mFYzAOw/lEzd2d2UlguGOsmJTi3yD 2dwgLXXC3zbypRO749kitMC1HNsUIOQ4ZT4WpQoa3Y3m7TPB7ARMYmV8nUX8hHDR8hdoQ6 IyfOi5ePDWFs96fVEM8sU3030JjV+56hIvTz+hCzmPIpr/nlm03Nj0kFsO0bFtIb96mogl xjnzyC+knbnQI/4ffMP9u4TR1pYAC7Apfn8V2LwYqXnQ0cNmCiHGOdEgqfzw5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YX8gQ1srwzsvP; Tue, 14 Jan 2025 00:11: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 50E0BU5M078560; Tue, 14 Jan 2025 00:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E0BUoH078557; Tue, 14 Jan 2025 00:11:30 GMT (envelope-from git) Date: Tue, 14 Jan 2025 00:11:30 GMT Message-Id: <202501140011.50E0BUoH078557@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: f167ba73574a - main - rtwn: fix RTWN_RIDX_VHT_MCS() macro List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: f167ba73574a3e1757dd95265aa0211cb16c365e Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=f167ba73574a3e1757dd95265aa0211cb16c365e commit f167ba73574a3e1757dd95265aa0211cb16c365e Author: Adrian Chadd AuthorDate: 2025-01-13 03:14:21 +0000 Commit: Adrian Chadd CommitDate: 2025-01-14 00:11:18 +0000 rtwn: fix RTWN_RIDX_VHT_MCS() macro Add parenthesis as appropriate. Oops! --- sys/dev/rtwn/if_rtwn_ridx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/rtwn/if_rtwn_ridx.h b/sys/dev/rtwn/if_rtwn_ridx.h index 0a1ea35303f1..616ba8d6d724 100644 --- a/sys/dev/rtwn/if_rtwn_ridx.h +++ b/sys/dev/rtwn/if_rtwn_ridx.h @@ -53,7 +53,7 @@ * goes from 44 -> 83. */ #define RTWN_RIDX_VHT_MCS_SHIFT 44 -#define RTWN_RIDX_VHT_MCS(s, i) (RTWN_RIDX_VHT_MCS_SHIFT + ((10*s) + i)) +#define RTWN_RIDX_VHT_MCS(s, i) (RTWN_RIDX_VHT_MCS_SHIFT + ((10*(s)) + (i))) /* * The total amount of rate indexes, CCK, OFDM, HT MCS0..31, From nobody Tue Jan 14 02:54:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXDH56JTbz5j0BF; Tue, 14 Jan 2025 02:54:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXDH55qDNz3QV2; Tue, 14 Jan 2025 02:54:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736823249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tG9H3C32ffqlk4fpEHxrCw/JHb4wZQbqAOoS23NOpXo=; b=PrQXulFIeeKwHmVqzcRP5C6DqpEWmo59fkQt6OK8pG4w7L/HZF1JcpTMf/6VAWlX/tcr1r hSbxx2zuhIJ31FwcrSEgcObj/M+JJxWpMP55TrkPsGG0HC4RjxY3i5pdLdMO29rrgL/Nua mUHK0wz8WhS7rfUDS1iUMy4Rmvn1JAp3gV5XQKv/aC0YpLQudbD6EJuZlIqoAC1yQzhYT3 /eFjYKI1uF3s86hdFHS7Ggo/axIylgkJB5aGusMLOEwYyWZD+49NhtJgk+i4ePKa9ajYTr f6xzsM43G4qJi7P9Oa3F66iwxwSLEpXDwHyXq4FVxIS5y7X4nqXMdcalphIW2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736823249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tG9H3C32ffqlk4fpEHxrCw/JHb4wZQbqAOoS23NOpXo=; b=AeQNILUh6OTOC6ZhWvYoMDKGqKl8htJfn871q2R3fU+92rcgP/z4O9v4BYgVgwM6zeqTov VbGJDpnEQjY3TS/phVLLuYzVeQn9kPwkI/kbpU9iCxUag3SIijCoa+/2or1wi98TZ/io1v USODsf0EjGwcCv+gsBjk+wYEXoT6yCzCKNkUEGnvQi+0W+ewa7B292NDzQRnWeiiIWyXA6 WryYktFux0At8cbLHK7DFgIY4Sut5d97LqsSna7tYZ7Czdb/gNQRCgte1+fH8XG28OK+9f lDg2856ihg6WKBZanAdub/OUF0fx3piZ8G3gknVUmPPQACby64bbkQ9Et68GaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736823249; a=rsa-sha256; cv=none; b=uqaiYmPI3FEA8B5e0dRpGE8aObjKmAjxh4f730ZFaOanT6IEd1BQeHfwMBDBaANxpsuzTp pM+0fLiqIzmxcgNdG3t+b4du/aT/LoXwtSuuL6hI86/qaIZUmQ1bO73yuuRLa3zTwgbWLj sBU1LT7oni/JqvyB1XH+Y8MpVNB6SBTPv42XlIbDVXdEs32tFKCCsOmyZJgJuouQVCMy7b 4F/rs7MaTDxKEDWtX8lqSsP4iivis3jeofScom6uZDRJf2EH7qkZX7ChwaHbb9UZNL5O4m JNtH13aURDYIPH1sfDgip8r25q5B6S0LbCK8UD5AhGol8lLxZ7GfuXL5VTSawQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXDH55P1XzyT9; Tue, 14 Jan 2025 02:54: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 50E2s99Y081043; Tue, 14 Jan 2025 02:54:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E2s9g3081040; Tue, 14 Jan 2025 02:54:09 GMT (envelope-from git) Date: Tue, 14 Jan 2025 02:54:09 GMT Message-Id: <202501140254.50E2s9g3081040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone Subject: git: 9110e31e1df7 - stable/14 - tcpdump/print-pflog: Print uid with host endianness List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9110e31e1df788495d62c74b1a969c6deb303423 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=9110e31e1df788495d62c74b1a969c6deb303423 commit 9110e31e1df788495d62c74b1a969c6deb303423 Author: Eric A. Borisch AuthorDate: 2025-01-03 00:21:52 +0000 Commit: Joseph Mingrone CommitDate: 2025-01-14 02:49:14 +0000 tcpdump/print-pflog: Print uid with host endianness PR: 283799 Reported by: Eric A. Borisch Reviewed by: jrm, kp Fixes: 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9 (cherry picked from commit d72f87c0fd1418bdb814594ea8fc76a202f7d5c6) --- contrib/tcpdump/print-pflog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/tcpdump/print-pflog.c b/contrib/tcpdump/print-pflog.c index e54d33ac13bb..71bf01f07555 100644 --- a/contrib/tcpdump/print-pflog.c +++ b/contrib/tcpdump/print-pflog.c @@ -119,8 +119,8 @@ pflog_print(netdissect_options *ndo, const struct pfloghdr *hdr) ND_PRINT("%s", tok2str(pf_reasons, "unkn(%u)", GET_U_1(hdr->reason))); - if (GET_BE_U_4(hdr->uid) != UID_MAX) - ND_PRINT(" [uid %u]", (unsigned)GET_BE_U_4(hdr->uid)); + if (GET_HE_U_4(hdr->uid) != UID_MAX) + ND_PRINT(" [uid %u]", GET_HE_U_4(hdr->uid)); if (ridentifier != 0) ND_PRINT(" [ridentifier %u]", ridentifier); From nobody Tue Jan 14 04:21:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXGCg5CzKz5j5xM; Tue, 14 Jan 2025 04:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXGCg4jWDz3bCn; Tue, 14 Jan 2025 04:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736828479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmI6nlbhYdsfqMPBIJV09xR5QuI4jiG5TGsj185pQRk=; b=OfbO2gXL/HOcR1cES9403OYZ5IbDCNNtJLbN8Rl/3uEeEOI64/rrqVkPI39Wg7KuEwdXav 3/dKkdtilNkALcTXT/GafL6JoEtd0e106LBAaJsB+SGUMv/3bO/earo/4ToLy3QBVOLHoU 45puRpJWdD+cz0JibBy57n4zyOrUL1iU6tv056BTXOeL8jLr5UXk6p/YeobkFGJfMrpkrS Ed5fBxM6kjTyOfNVm2TQVilmnVnGqwpel29vwDvktmweVi4FObxRWIdzXQ01z10rcIbufl jwSMPSU5F0JMFKN60kC0CrsGhJv/FIlH0p6q+wMYoHGlpVBeRse1epb+tM76+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736828479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UmI6nlbhYdsfqMPBIJV09xR5QuI4jiG5TGsj185pQRk=; b=dphnrR3HQpdHqe8lnkRVRKNIb3LIloy/DPpd/XA3VMx4aRPRrLdAc61Lnm7WfB5ZAJm+G6 v+yRtKlCdvjUY8uv4nPlzr3DzfsVKYqibyASo4fR61C7zlvmxqC925n7R3YyyNLI32XiR0 ScZn36XPOW39DuZhIv+dEcNmrZiXJPwk6MJ7iCH8otofhz33xADwt9X5SSzdEn3ds/M9lj U+JXnczsEGGdDjiWl6CvJE1mxKkiJ0LydEQwNIF6XDohd2bofNT3V8be63Sj93LFrpGgCb iOlifCHfu7EzMoVXweRqgvg443ewNQVjefPvYlEkVkt2rM0ntj6qg34WwZgAhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736828479; a=rsa-sha256; cv=none; b=NkCdOPD0TmLNRCW9AYwW5GTrOUfICorTD3lAkwP4YS82sHrMem9QJ06FnnO8JN4JGSiDOs k8vfTINeeWcteP2YvTSE04045dJYEy0eUq5B78bgXC6AGeiTu7iELkDKfq4Nz2hHfbNzaF kgeAO12/H6jO++jb0Sqq1yaPqgnvRg6yjpv4MNXqcKiN/5LUDsPe24spA1lFfhgvppAA8a vwU8054RmMhj7QmBhjHF9hP2BqDMFT8tKOUDC1//IaNYFAuxzvh3Dq1FCaDGGsCdNPBfD1 RwuRR9r+zyBcnXHRza/zErvQBbylYSrhobBTO6z4UCkfIxB98L54BNVMeXAnew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXGCg463Cz11ZH; Tue, 14 Jan 2025 04:21: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 50E4LJuE046193; Tue, 14 Jan 2025 04:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E4LJ82046190; Tue, 14 Jan 2025 04:21:19 GMT (envelope-from git) Date: Tue, 14 Jan 2025 04:21:19 GMT Message-Id: <202501140421.50E4LJ82046190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 42d4bcc6c560 - stable/14 - sys/sys/kernel.h: Remove SI_SUB_DONE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 42d4bcc6c5607b666413db88978e0cc1181de6c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=42d4bcc6c5607b666413db88978e0cc1181de6c4 commit 42d4bcc6c5607b666413db88978e0cc1181de6c4 Author: Zhenlei Huang AuthorDate: 2024-12-31 16:01:21 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-14 04:20:49 +0000 sys/sys/kernel.h: Remove SI_SUB_DONE It was not used since 9a7add6d01f3. Reviewed by: mhorne, imp Fixes: 9a7add6d01f3 init_main: Switch from sysinit array to SLIST MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47915 (cherry picked from commit 81f9d3b11f310b28e4bf8cc2ad2d84e4aadd929d) --- sys/sys/kernel.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index f547ff4690de..e07dc7031bb8 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -87,7 +87,6 @@ extern volatile int ticks; */ enum sysinit_sub_id { SI_SUB_DUMMY = 0x0000000, /* not executed; for linker */ - SI_SUB_DONE = 0x0000001, /* processed */ SI_SUB_TUNABLES = 0x0700000, /* establish tunable values */ SI_SUB_COPYRIGHT = 0x0800001, /* first use of console */ SI_SUB_VM = 0x1000000, /* virtual memory system init */ From nobody Tue Jan 14 04:34:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXGWM0c0Pz5j6Ym; Tue, 14 Jan 2025 04:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXGWM00j3z3cxg; Tue, 14 Jan 2025 04:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CiugQtBSalOSSVOaLthjsY7WzgZc6sDY0BMMhs6+RUw=; b=ByiJ3bGC9QcWLWEoQMb+rOdD0SxzFftoAc4KcbrD6qjvg2/c/2Fy1fgP5+RHq/emtTQUhF MsG0/qEGim5j7IFvltx4ftbHB4tX8yavvi/G9pt8/r/hjJJ9cEChqTnjBQi/JOKSul0cUI Jk1iZ0RcybRvrl3VOUgbo6+DBE7TWJXBuZP5WQHKAfSnRCEIpLFsQtQPnzk6I/TnS1s8gs Eyi79dNy0920c6iKvW+PMAXt2YAokKlsqGvKLE7v2uBZsGIu7O96idSXY5FsDrlv9934su EJCEUHn4PTbZmmMJ82Cd9qNHILzm+ohfp3vuPZ+S0WCWPUhwsy+/wjc2QeCSAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CiugQtBSalOSSVOaLthjsY7WzgZc6sDY0BMMhs6+RUw=; b=ESjgA5ojd6Xlg1VHuhhaQgINSKjd/gRBRp3lEoxEaICY6rBYiuOBt36lGODHN9BQBDl/yA kIoq80lNaHhp0cYOqIqqGKCoeGM0J6zsBy+m2JUdyRjCki6FLSIHoFOhF7NZ5+geSYvwrp BjIogSatfPFzvpKgiY05b75zHjYefk/H+RvMK9APAV7TdpfKwDMt7GWi2SrDhrk/iB4O92 yxlBbV5qmGU2dAMGd/qDzKvoOLW3z/b7qQ2rMCI5LLsmInIjAO1FL0YppPG30hH9jqT6AU bQYbfeOIm9iHNU9Ryaxvj0cC6qRGMSIRBsCWrYVNVozyvvf3MmD2OOLAWAQeLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736829295; a=rsa-sha256; cv=none; b=qxWf96dBLLcE6Ga2ppkNOBj12Y4SWUOG/sXLg9d0xfRZhzlbfiCM8+kByukN1aR0iZvlD8 8pyVFKN2L4pqDjAmPImf2WvaoYEldmFeXscdf9QALMFFOYE1Uuv2wnWGZLhRa49hLzeLR2 ULlXX0TKcFjLSS3WLjlpmflDBYyRi6/2JMHQyCo/Ok6l9pIT48kCynyMMH3SNBdwMZ971a KDWKsAIxJrIIRJIh8dEiKG444KsVQ2mqPRw4xv13CA+qtyNFRIpI/exooOJA7WxkA2YP51 udDbqYvs2cIG6S0RV4QlHQO1H3nzxsNrjVbb3ImcT+XLtnRTbG9dD7SXMSE97w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXGWL6dMJz113F; Tue, 14 Jan 2025 04:34: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 50E4Ysts072507; Tue, 14 Jan 2025 04:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E4Ys6L072504; Tue, 14 Jan 2025 04:34:54 GMT (envelope-from git) Date: Tue, 14 Jan 2025 04:34:54 GMT Message-Id: <202501140434.50E4Ys6L072504@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: f45f66fadacc - main - rtwn: explicitly configure RTS based on basic rates List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: f45f66fadacc2efff3c2ff64e3528b8dbaad3673 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=f45f66fadacc2efff3c2ff64e3528b8dbaad3673 commit f45f66fadacc2efff3c2ff64e3528b8dbaad3673 Author: Adrian Chadd AuthorDate: 2024-12-19 02:11:28 +0000 Commit: Adrian Chadd CommitDate: 2025-01-14 04:33:44 +0000 rtwn: explicitly configure RTS based on basic rates The NIC/firmware initialises the initial RTS/CTS rate to something high, like OFDM48. That's not going to be very reliable. It's not a problem right now as we program in the RTS/CTS value to use in the TX descriptor setup path based on the control rate for the given frame TX rate, and like the INIDATA/driver rate stuff in the TX descriptor, the TX descriptor RTS/CTS rate overrides the INIRTS rate. However when it's time to flip on firmware based rate control, the initial rate needs to not be OFDM48. Yes, the firmware and hardware does have some rate retry schedule for RTS/CTS frames, but there's no point in wasting short retries trying to do OFDM48 based RTS/CTS setup. Add some warning logging if there are no basic or RTS/CTS rates available, and leave things at default. If this happens in production for someone then it would be good to know and what the rate mask was. Locally tested: * RTL8192CU, STA mode (with/without firmware rate control enabled locally) Differential Revision: https://reviews.freebsd.org/D48140 --- sys/dev/rtwn/if_rtwn.c | 8 +++++--- sys/dev/rtwn/if_rtwn_rx.c | 35 +++++++++++++++++++++++++++++++++++ sys/dev/rtwn/if_rtwn_rx.h | 1 + 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index f9950c5acf4d..2003fa7d20be 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -1308,12 +1308,14 @@ rtwn_calc_basicrates(struct rtwn_softc *sc) ieee80211_free_node(ni); } - - if (basicrates == 0) + if (basicrates == 0) { + device_printf(sc->sc_dev, + "WARNING: no configured basic rates!\n"); return; + } - /* XXX also set initial RTS rate? */ rtwn_set_basicrates(sc, basicrates); + rtwn_set_rts_rate(sc, basicrates); } static int diff --git a/sys/dev/rtwn/if_rtwn_rx.c b/sys/dev/rtwn/if_rtwn_rx.c index e5ddc7a3cb97..9b7c93fee9b6 100644 --- a/sys/dev/rtwn/if_rtwn_rx.c +++ b/sys/dev/rtwn/if_rtwn_rx.c @@ -134,6 +134,41 @@ rtwn_set_basicrates(struct rtwn_softc *sc, uint32_t rates) rtwn_setbits_4(sc, R92C_RRSR, R92C_RRSR_RATE_BITMAP_M, rates); } +/* + * Configure the initial RTS rate to use. + */ +void +rtwn_set_rts_rate(struct rtwn_softc *sc, uint32_t rates) +{ + uint8_t ridx; + + /* + * We shouldn't set the initial RTS/CTS generation rate + * as the highest available rate - that may end up + * with trying to configure something like MCS1 RTS/CTS. + * + * Instead, choose a suitable low OFDM/CCK rate based + * on the basic rate bitmask. Assume the caller + * has filtered out CCK modes in 5GHz. + */ + rates &= (1 << RTWN_RIDX_CCK1) | (1 << RTWN_RIDX_CCK55) | + (1 << RTWN_RIDX_CCK11) | (1 << RTWN_RIDX_OFDM6) | + (1 << RTWN_RIDX_OFDM9) | (1 << RTWN_RIDX_OFDM12) | + (1 << RTWN_RIDX_OFDM18) | (1 << RTWN_RIDX_OFDM24); + if (rates == 0) { + device_printf(sc->sc_dev, + "WARNING: no configured basic RTS rate!\n"); + return; + } + ridx = fls(rates) - 1; + + RTWN_DPRINTF(sc, RTWN_DEBUG_RA, + "%s: mask=0x%08x, ridx=%d\n", + __func__, rates, ridx); + + rtwn_write_1(sc, R92C_INIRTS_RATE_SEL, ridx); +} + static void rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int8_t rssi, int is_cck) diff --git a/sys/dev/rtwn/if_rtwn_rx.h b/sys/dev/rtwn/if_rtwn_rx.h index 3108f1d4cde4..751173d0f80f 100644 --- a/sys/dev/rtwn/if_rtwn_rx.h +++ b/sys/dev/rtwn/if_rtwn_rx.h @@ -23,6 +23,7 @@ void rtwn_get_rates(struct rtwn_softc *, const struct ieee80211_rateset *, const struct ieee80211_htrateset *, uint32_t *, uint32_t *, int *, int); void rtwn_set_basicrates(struct rtwn_softc *, uint32_t); +void rtwn_set_rts_rate(struct rtwn_softc *, uint32_t); struct ieee80211_node * rtwn_rx_common(struct rtwn_softc *, struct mbuf *, void *); void rtwn_adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, From nobody Tue Jan 14 04:34:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXGWN29P4z5j6vt; Tue, 14 Jan 2025 04:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXGWN0pcLz3ct8; Tue, 14 Jan 2025 04:34:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ou3YgW3WP9hLafYOdfCfZM8Z0NuBZSqLBDeg6pFw/U4=; b=Icvqt9W4YR2rcGBS8t3/806+k4HYxMJQNqeLqCgpgkRpKQ6WGV82dXOzl9QiIn/7Ewrmkw hmB5+NWghiyio5aOIWUGuD3beMipF+c+gkyZTfqAQIx1AhxIE78wJLZ3ZHfY/fGqbkJw+z VrvsuX3ye9PnvZKsmOpBCJMWvLHZiPS2TsVK18Hx4kwNglyjim1Pedq9kVbIWJsUjYnMWu jNMyK5+bebwCrP3rpwNLsj2t/lQJmNqf+I6XSCEZ3/Mjr+agAwQE0NWw7Q1ctp6sMVFrtE RbvYPsijEgUlrLIKJ1/9fzgCXGfg4gqG3p8hkFAxyNj3VYSiNe2BIPaGxFGYEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ou3YgW3WP9hLafYOdfCfZM8Z0NuBZSqLBDeg6pFw/U4=; b=DNzO2e69jdOkiMBoaYcY/8OBlXSMiIdoEHbfhxdAYKzwEyA6opYPPYmla6OMgK438quuGI mK40oHTxR1ejH03O2cjk00ZgpGM1mL2K9JnO3rwCU/05uinm46IVBmQ/zlCC7jvbWtPz4a 2/CAbr5frDdf+DD8j45ZeY25mb0WU2hUtIl4b02rGZCzpDnlDNVz/swgDnqH6cHM1fZd67 zZMBwHO51mjw7gcBD325eltnkqbUW1+8iOZaIqV643DGlgNcjkk2rnjHC3La2laX33sgqp 5Mv80aXYQwIhGZ0yT06m1Nn49CfE2CtDC0qTR+NJu9E64Tn/0UbMU3fITSfwNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736829296; a=rsa-sha256; cv=none; b=Qcs/8J88e5O2KP/U4GZMy0RTDIGefejVup7wLR2xPOjrpTDh2mtqt1Ya9CSMH0+ak2HXe5 AXzuLTz7Hh0onxnTw5kiCsrHAdtXJpTLSP6O18+Ed9BCo3WzKPhXg/lIWMKf+klJcOc+UJ BV+NJ3uPH1nbvlUGmwuCHAN3BkID1gsThmo4rA61M1Rfblp09Z6BE5zMaFdhGNF+d1LMg/ YuNsi3IwkVVUEC8l1qwboGYsqG8+/QFqPKRVZ+kcW4JDKtYDi21H1knlgIoCjRwGYftTMM lwH930OEurv/o3nfz7rN8R5GH6RvEt7LWN7jb+IkmiBwRl9T9Vwl1R55S6O3vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXGWN0D7lz11d5; Tue, 14 Jan 2025 04:34: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 50E4YtXo072558; Tue, 14 Jan 2025 04:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E4Ytvl072555; Tue, 14 Jan 2025 04:34:55 GMT (envelope-from git) Date: Tue, 14 Jan 2025 04:34:55 GMT Message-Id: <202501140434.50E4Ytvl072555@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: ea347b7fda20 - main - rtwn: refactor out datarate and short preamble setup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: ea347b7fda20e1437c1b2c363e12a4f29d8ca8f0 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ea347b7fda20e1437c1b2c363e12a4f29d8ca8f0 commit ea347b7fda20e1437c1b2c363e12a4f29d8ca8f0 Author: Adrian Chadd AuthorDate: 2024-12-19 02:43:47 +0000 Commit: Adrian Chadd CommitDate: 2025-01-14 04:33:56 +0000 rtwn: refactor out datarate and short preamble setup Refactor out the datarate setup and short preamble setup. These will eventually be slightly different based on whether firmware rate control is being performed or not. Locally tested: * RTL8192CU, STA mode Differential Revision: https://reviews.freebsd.org/D48141 --- sys/dev/rtwn/rtl8192c/r92c_tx.c | 47 +++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index d5cbc3ad9db9..9d975e98d95b 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -257,6 +257,34 @@ r92c_check_enable_ccx_report(struct rtwn_softc *sc, int macid) return true; } +static void +r92c_fill_tx_desc_datarate(struct rtwn_softc *sc, struct r92c_tx_desc *txd, + uint8_t ridx, bool force_rate) +{ + + /* Force this rate if needed. */ + if (sc->sc_ratectl == RTWN_RATECTL_FW && !force_rate) { + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, 0)); + } else { + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); + txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); + } + + /* Data rate fallback limit (max). */ + txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE_FB_LMT, 0x1f)); +} + +static void +r92c_fill_tx_desc_shpreamble(struct rtwn_softc *sc, struct r92c_tx_desc *txd, + uint8_t ridx, bool force_rate) +{ + const struct ieee80211com *ic = &sc->sc_ic; + + if (RTWN_RATE_IS_CCK(ridx) && ridx != RTWN_RIDX_CCK1 && + (ic->ic_flags & IEEE80211_F_SHPREAMBLE)) + txd->txdw4 |= htole32(R92C_TXDW4_DATA_SHPRE); +} + void r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, void *buf, uint8_t ridx, bool force_rate, int maxretry) @@ -327,9 +355,7 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, #endif } - if (RTWN_RATE_IS_CCK(ridx) && ridx != RTWN_RIDX_CCK1 && - (ic->ic_flags & IEEE80211_F_SHPREAMBLE)) - txd->txdw4 |= htole32(R92C_TXDW4_DATA_SHPRE); + r92c_fill_tx_desc_shpreamble(sc, txd, ridx, force_rate); prot = IEEE80211_PROT_NONE; if (RTWN_RATE_IS_HT(ridx)) { @@ -359,16 +385,13 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, qsel)); rtwn_r92c_tx_setup_macid(sc, txd, macid); - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); - /* Data rate fallback limit (max). */ - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE_FB_LMT, 0x1f)); + + /* Fill in data rate, data retry */ + r92c_fill_tx_desc_datarate(sc, txd, ridx, force_rate); + txd->txdw4 |= htole32(SM(R92C_TXDW4_PORT_ID, uvp->id)); r92c_tx_raid(sc, txd, ni, ismcast); - /* Force this rate if needed. */ - if (sc->sc_ratectl != RTWN_RATECTL_FW) - txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - if (!hasqos) { /* Use HW sequence numbering for non-QoS frames. */ rtwn_r92c_tx_setup_hwseq(sc, txd); @@ -423,10 +446,8 @@ r92c_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni, txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT)); /* Set TX rate index. */ - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, ridx)); - txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE_FB_LMT, 0x1f)); + r92c_fill_tx_desc_datarate(sc, txd, ridx, true); /* force rate */ txd->txdw4 |= htole32(SM(R92C_TXDW4_PORT_ID, uvp->id)); - txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); r92c_tx_raid(sc, txd, ni, ismcast); if (!IEEE80211_QOS_HAS_SEQ(wh)) { From nobody Tue Jan 14 04:34:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXGWP6kxLz5j6BK; Tue, 14 Jan 2025 04:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXGWP3D7jz3cVn; Tue, 14 Jan 2025 04:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6X7LW/pb8a35j13rnHeHgmoGb49RNU3GULrE3NJhLaI=; b=PVS88Fz4aV0b4Tn8LMDpUmNCbTCYjT83XmFgf+pnZPgBeQBdEAD0riT8bxxcvZo03QCz6v RcL4/ydFVt8GnJdjfUQv6VJjLZFVOam0luwnnxdcF/iIE3Y0lM79Ll3vsdAnNfEVHA2HhN YzlnQMVonKJc+0mugjs2I/obz+EeAtKDnEpFXuaOP10gRwJAU1CFNMutCc3rGdVDY415fK DktI4Kyr2e4qEvFGM1LsyzPTp0q/DWOGdu88hmX6SNAyPICBIDE3OgMtiMUTxuipsxD1DG Yrnk24eoyAV77bnK+R8GgufsyHpJNhYc4tPHsiGn1E+3s6BqPpSPVtnyWts5oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6X7LW/pb8a35j13rnHeHgmoGb49RNU3GULrE3NJhLaI=; b=oWjo//QbeZZamVTgubRumoeghLhyy8mFzEwEB5uysYiFM3h6aGSt3rSIvgIvHrd1FrCdDV YTURFQYWCgH14FoF1Qf7iaoRVGC1+cyqR5p+o+IJrObiSsZ4MywGwOQAv73b54GHvOKacj WttuJ6w5nc2SLT2BX18/MG5eQ8zQ8FRgUlHZCnzv3fte0RlZnZMAyyHWDnlWt4XknlavL1 PD+QaJ4RlWtyfzq8QxV2FoPjGTkSNegegY6Ymfck5pF/VOup0OfHGt1qBd1ZBy/1GfAaIC QgUxD0aQalaX9psPsB76nOeAKEuVl+M+1a9ZHq7tL1fdNsLt78/OkkKZFLgNuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736829297; a=rsa-sha256; cv=none; b=Z4orjFnroVdWHLe2k+NxUtDOgLyLyonEjQYgI+qIo4UCnvgxuxgnHBiak7BO2hzAyccFf2 ffTMUVzcyWwbqb/jXcB/dHSNJ1cJk0+dT3BU3UDVM6S3dozPyKYSlK5BFXGVHSCb1bCjKj L2bPav5FXkNqXdNppSX6NvskrFkMUV4XO3ggVfd4ddt5jGid0ztBhX+WtUVAjZeOfABOY8 XWU3KF2S+V5uuceK4tU/Av5uXqydrZiweDnNx3ybI6G1v815wJJ9nDqz3xFlDJ8OJ8FU9t gqVGve9k0Kkh4GqOpyXpD0FsxEnoiM0VRac506hHmIIheIIAl9FmmKo+7Thbbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXGWP1XxHz11g1; Tue, 14 Jan 2025 04:34: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 50E4YvmN072625; Tue, 14 Jan 2025 04:34:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E4Yvmd072622; Tue, 14 Jan 2025 04:34:57 GMT (envelope-from git) Date: Tue, 14 Jan 2025 04:34:57 GMT Message-Id: <202501140434.50E4Yvmd072622@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: ce7fca19287c - main - rtwn: refactor out the r92c path protection decision / configuration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: ce7fca19287cb218794da6fcbe320946485cd67a Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=ce7fca19287cb218794da6fcbe320946485cd67a commit ce7fca19287cb218794da6fcbe320946485cd67a Author: Adrian Chadd AuthorDate: 2024-12-19 03:35:58 +0000 Commit: Adrian Chadd CommitDate: 2025-01-14 04:34:14 +0000 rtwn: refactor out the r92c path protection decision / configuration * refactor out the r92c path protection (RTS/CTS) decision * handle firmware rate control being enabled - if DRVRATE isn't set then the RTSRATE field is ignored and instead RRSR/INIRTS registers are used (and the firmware/hardware will do RTS rate adaptation / retry.) * when making protection decisions with firmware rate control, default to the channel mode rather than rate index. This works on RTL8192CU both with firmware rate control and driver rate control. Locally tested: * RTL8192CU, STA - firmware and net80211 rate control Differential Revision: https://reviews.freebsd.org/D48142 --- sys/dev/rtwn/rtl8192c/r92c_tx.c | 100 +++++++++++++++++++++++++++++++--------- 1 file changed, 78 insertions(+), 22 deletions(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index 9d975e98d95b..6b013de0c536 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -77,10 +77,14 @@ r92c_tx_set_ht40(struct rtwn_softc *sc, void *buf, struct ieee80211_node *ni) static void r92c_tx_protection(struct rtwn_softc *sc, struct r92c_tx_desc *txd, - enum ieee80211_protmode mode, uint8_t ridx) + enum ieee80211_protmode mode, uint8_t ridx, bool force_rate) { struct ieee80211com *ic = &sc->sc_ic; uint8_t rate; + bool use_fw_ratectl; + + use_fw_ratectl = + (sc->sc_ratectl == RTWN_RATECTL_FW && !force_rate); switch (mode) { case IEEE80211_PROT_CTSONLY: @@ -95,17 +99,27 @@ r92c_tx_protection(struct rtwn_softc *sc, struct r92c_tx_desc *txd, if (mode == IEEE80211_PROT_CTSONLY || mode == IEEE80211_PROT_RTSCTS) { - if (RTWN_RATE_IS_HT(ridx)) + if (use_fw_ratectl) { + /* + * If we're not forcing the driver rate then this + * field actually doesn't matter; what matters is + * the RRSR and INIRTS configuration. + */ + ridx = RTWN_RIDX_OFDM24; + } else if (RTWN_RATE_IS_HT(ridx)) { rate = rtwn_ctl_mcsrate(ic->ic_rt, ridx); - else + ridx = rate2ridx(IEEE80211_RV(rate)); + } else { rate = ieee80211_ctl_rate(ic->ic_rt, ridx2rate[ridx]); - ridx = rate2ridx(IEEE80211_RV(rate)); + ridx = rate2ridx(IEEE80211_RV(rate)); + } txd->txdw4 |= htole32(SM(R92C_TXDW4_RTSRATE, ridx)); /* RTS rate fallback limit (max). */ txd->txdw5 |= htole32(SM(R92C_TXDW5_RTSRATE_FB_LMT, 0xf)); - if (RTWN_RATE_IS_CCK(ridx) && ridx != RTWN_RIDX_CCK1 && + if (!use_fw_ratectl && RTWN_RATE_IS_CCK(ridx) && + ridx != RTWN_RIDX_CCK1 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE)) txd->txdw4 |= htole32(R92C_TXDW4_RTS_SHORT); } @@ -285,6 +299,49 @@ r92c_fill_tx_desc_shpreamble(struct rtwn_softc *sc, struct r92c_tx_desc *txd, txd->txdw4 |= htole32(R92C_TXDW4_DATA_SHPRE); } +static enum ieee80211_protmode +r92c_tx_get_protmode(struct rtwn_softc *sc, const struct ieee80211vap *vap, + const struct ieee80211_node *ni, const struct mbuf *m, + uint8_t ridx, bool force_rate) +{ + const struct ieee80211com *ic = &sc->sc_ic; + enum ieee80211_protmode prot; + + prot = IEEE80211_PROT_NONE; + + /* + * If doing firmware rate control, base it the configured channel. + * This ensures that for HT operation the RTS/CTS or CTS-to-self + * configuration is obeyed. + */ + if (sc->sc_ratectl == RTWN_RATECTL_FW && !force_rate) { + struct ieee80211_channel *chan; + enum ieee80211_phymode mode; + + chan = (ni->ni_chan != IEEE80211_CHAN_ANYC) ? + ni->ni_chan : ic->ic_curchan; + mode = ieee80211_chan2mode(chan); + if (mode == IEEE80211_MODE_11NG) + prot = ic->ic_htprotmode; + else if (ic->ic_flags & IEEE80211_F_USEPROT) + prot = ic->ic_protmode; + } else { + if (RTWN_RATE_IS_HT(ridx)) + prot = ic->ic_htprotmode; + else if (ic->ic_flags & IEEE80211_F_USEPROT) + prot = ic->ic_protmode; + } + + /* XXX fix last comparison for A-MSDU (in net80211) */ + /* XXX A-MPDU? */ + if (m->m_pkthdr.len + IEEE80211_CRC_LEN > + vap->iv_rtsthreshold && + vap->iv_rtsthreshold != IEEE80211_RTS_MAX) + prot = IEEE80211_PROT_RTSCTS; + + return (prot); +} + void r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, void *buf, uint8_t ridx, bool force_rate, int maxretry) @@ -292,7 +349,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, #ifndef RTWN_WITHOUT_UCODE struct r92c_softc *rs = sc->sc_priv; #endif - struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; struct rtwn_vap *uvp = RTWN_VAP(vap); struct ieee80211_frame *wh; @@ -357,24 +413,22 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, r92c_fill_tx_desc_shpreamble(sc, txd, ridx, force_rate); - prot = IEEE80211_PROT_NONE; - if (RTWN_RATE_IS_HT(ridx)) { + prot = r92c_tx_get_protmode(sc, vap, ni, m, ridx, + force_rate); + + /* + * Note: Firmware rate control will enable short-GI + * based on the configured rate mask, however HT40 + * may not be enabled. + */ + if (sc->sc_ratectl != RTWN_RATECTL_FW && + RTWN_RATE_IS_HT(ridx)) { r92c_tx_set_ht40(sc, txd, ni); r92c_tx_set_sgi(sc, txd, ni); - prot = ic->ic_htprotmode; - } else if (ic->ic_flags & IEEE80211_F_USEPROT) - prot = ic->ic_protmode; - - /* XXX fix last comparison for A-MSDU (in net80211) */ - /* XXX A-MPDU? */ - if (m->m_pkthdr.len + IEEE80211_CRC_LEN > - vap->iv_rtsthreshold && - vap->iv_rtsthreshold != IEEE80211_RTS_MAX) - prot = IEEE80211_PROT_RTSCTS; + } /* NB: checks for ht40 / short bits (set above). */ - if (prot != IEEE80211_PROT_NONE) - r92c_tx_protection(sc, txd, prot, ridx); + r92c_tx_protection(sc, txd, prot, ridx, force_rate); } else /* IEEE80211_FC0_TYPE_MGT */ qsel = R92C_TXDW1_QSEL_MGNT; } else { @@ -438,9 +492,11 @@ r92c_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni, params->ibp_try0)); } if (params->ibp_flags & IEEE80211_BPF_RTS) - r92c_tx_protection(sc, txd, IEEE80211_PROT_RTSCTS, ridx); + r92c_tx_protection(sc, txd, IEEE80211_PROT_RTSCTS, ridx, + true); if (params->ibp_flags & IEEE80211_BPF_CTS) - r92c_tx_protection(sc, txd, IEEE80211_PROT_CTSONLY, ridx); + r92c_tx_protection(sc, txd, IEEE80211_PROT_CTSONLY, ridx, + true); rtwn_r92c_tx_setup_macid(sc, txd, RTWN_MACID_BC); txd->txdw1 |= htole32(SM(R92C_TXDW1_QSEL, R92C_TXDW1_QSEL_MGNT)); From nobody Tue Jan 14 04:34:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXGWQ6wbZz5j6w0; Tue, 14 Jan 2025 04:34:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXGWQ3RRvz3cyD; Tue, 14 Jan 2025 04:34:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrnGvJrga2w/cTHfOs3LHVquXYGa5iEM/+Gfif2kncc=; b=c17p5nLmQcCHbHp8GwtbnrSXK4irBW3EcEA8CBcR7XAyCZltblprfHQAvWJ0n20IiOd6BW jjCI2DUNPosJ1M9kEqde7njZFbQmrl2MtlL/hGALZdMPLXtXqfQYv1Uft/3DaI4Ur/HZKh 1kJy9LKhssXoYQ8paHSS3Ysxu2O6MYv/tbzAqIUazUOZrPzm0FTLkMsGzq4eg4GzcZPCWd lKkbk4LF2+oSA2m4mUgaIo5vGZ8FbQFh9l1ogC+LzgbqLXOSrqn2dZ3vBXut0GFYXYF3km t2zgZ870ss47UYpAZHY3scwm4kLzyMaBqk5g2tLgY7DRRHvLrS0j2MQUCXWHjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736829298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrnGvJrga2w/cTHfOs3LHVquXYGa5iEM/+Gfif2kncc=; b=vE7sV3F1Vb38jdg2LOd8xgduH2XBNIdKfTskMnrLg9H0mgrHtHl8agTI4BN6MPps6cVdYG BB8JpEVL0OsF56D2CMOs0tX/Ox7KtFpmIdF1pBKEXVOPJoahChGlk4b2uGGMlSe3AwpwrX FjKBDi9WxXRvBzcmQnx/HpmXji+jsg1e9xWFNHFmwY0P1KnfIdNeIWBsfktwfcJUrp5+77 NTEt5WK+wqVn0YrAt1AX/dauPnYGlltXw1rOyJCkhUg4YmahEUQbLujlDdl8A4vuawu8q4 f7iDid+/UCUOL3VV+4CWF4ROMycaeMEqarjkZq7MJiGklvSj2T2ArHtJ4U8Rrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736829298; a=rsa-sha256; cv=none; b=p+Cz1T3k4kJvFpj2uIJjA9pSXVDn75veGYV3swDQWAoJX/B2LUFi51wRFXAw9PzyDfKvpB Z7a3eEMWzP2joHrxpjVHlE2068M9LQGbFysZ0RfE1gjBjrAfmP7mnSerLMMYVWrxmryNSZ tx2embTRZmk7EyWxmUj2TtqA0I4Tw7inYQqGkoW6sG+E34Z6IXkFer14M1LLW/jI28bwWx WabVgix99bdRqWAHyo86TBOCesYdPqLztLgkxNXY1EL3G5EfZ8jiv3C4fvt9WA1Y55GiBi Yml7fkr7Iw7lBtR4l4fsmHTTa37w8uCGmVrm8lI1VolgBvyxNAf7yTUo+j6Pmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXGWQ2NrLz11g2; Tue, 14 Jan 2025 04:34: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 50E4Yw0W072697; Tue, 14 Jan 2025 04:34:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E4Ywf8072694; Tue, 14 Jan 2025 04:34:58 GMT (envelope-from git) Date: Tue, 14 Jan 2025 04:34:58 GMT Message-Id: <202501140434.50E4Ywf8072694@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: 8896f36587f4 - main - rtwn: allow firmware rate control to be enabled for rtl8192cu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 8896f36587f46864fe5281c39de1f7f8aa5a0e33 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=8896f36587f46864fe5281c39de1f7f8aa5a0e33 commit 8896f36587f46864fe5281c39de1f7f8aa5a0e33 Author: Adrian Chadd AuthorDate: 2024-12-19 03:39:07 +0000 Commit: Adrian Chadd CommitDate: 2025-01-14 04:34:35 +0000 rtwn: allow firmware rate control to be enabled for rtl8192cu Although there's no RTS/CTS rate control available yet, the support is enough to enable firmware rate control for experimenting. This won't be enabled by default - users will need to set a tunable before loading the driver (eg kenv dev.rtwn.0.ratectl=2) but it is enough for experimentation, feedback and continued work. Locally tested: * RTL8192CU, STA mode Differential Revision: https://reviews.freebsd.org/D48143 Reviewed by: bz, emaste --- sys/dev/rtwn/rtl8192c/usb/r92cu_init.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c b/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c index 10d812dd7a80..91b1b78edb01 100644 --- a/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c +++ b/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c @@ -373,11 +373,7 @@ r92cu_post_init(struct rtwn_softc *sc) if (sc->sc_flags & RTWN_FW_LOADED) { struct r92c_softc *rs = sc->sc_priv; - if (sc->sc_ratectl_sysctl == RTWN_RATECTL_FW) { - /* XXX firmware RA does not work yet */ - sc->sc_ratectl = RTWN_RATECTL_NET80211; - } else - sc->sc_ratectl = sc->sc_ratectl_sysctl; + sc->sc_ratectl = sc->sc_ratectl_sysctl; /* Start C2H event handling. */ callout_reset(&rs->rs_c2h_report, rs->rs_c2h_timeout, From nobody Tue Jan 14 08:57:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXNL32Wzdz5kPT9; Tue, 14 Jan 2025 08:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXNL31jdXz424H; Tue, 14 Jan 2025 08:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DNsR4hutgGyrq9RkuwqTdT23bflXwIxYWvFXk0asA0=; b=YJBL8d3ojw3i0UQQ2iQ17ScDht0eTVWpNiwodvB3Tuj89zo3wUvCejHy43fIqTOdy6YMnz IAVm6g/cpXSWdNNQSs3w1RjF+2yIOQVab3uGBg5ag6VXZO1X9G19qM5hnQhLs/pbyN0YF8 hzbCbK17MsZj+3zjwijbfrh2UgPNr5vYq9lCLTXts7UOo3AKH4Y5XSzZa31mkfin2MhSW2 0LuvSiHrbDmw0GhELS7ELILcXyUg/4i6Wmnc6Y61B1Pmar6EWkt6TNSoum0dCOeQnwFFPV SeuMhsSQ6ahy4pGSwlG9q7hMEfCkmTf7/9f+hnZvVp1MtKccwjAU/Jp75Dl6vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DNsR4hutgGyrq9RkuwqTdT23bflXwIxYWvFXk0asA0=; b=CRD+Ili6XtcTs1GfqiplmFL9MCTAIkS9zYMjd8FBnGvqkwfrU0b0EVIJuHWV68/HllUmrQ mkjN6IkLocZP4rl+fcXLKLWBEzKptdaucBNSXkxVFbcF3u8H1qHhQd8kni9W5M5Gy8T75g aTEk0W/UGJHFTZfGYKduj8PtgiNYCXLHugH+Ce9PaEku5ssyD4sFcKMtbqsR0hcE5OTuWJ gQdP2w+iyTAXgPoNcaoY/xIiNMhe9UX6JGuHXh8iBgaMhb/Dnbsro3v4LvDoggzcjqubvy hSWXCvdrRXbWGOySz6pJlpgnB6DjZrarc5ir0tafLbN06a8ShTKMhMOPYvy/6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736845035; a=rsa-sha256; cv=none; b=O9njuft49mxnGhwa8vaqgs5zrNeSiDiwms6uMNApYj3sz28xDKQXzWKIJcZcKoupDjaiBP cgDyVw/Td9obIXW1QMS/lTBVmYGkT3iM5vGmtAo4ClE//3t+2mO2rUqMcQOGFEAtphIYiA DTQx5ZtqlPGsfphfenJ0ZFd1V5zV/RjnPpFB+hz4ShmGN+2yC8F9kWEWz0cRjLL6Ufo8nt vYYIv88aAghrgYZKdLvCAybvk+QlONDypUKpJuA4ywakpsNO/Mhv3jQ+efoMbvMwnv+f7c TrAtG7nUcW+otJ7vW4O9uBoYL8cru3/UxFQr1m6mbFFUju5EvzYVWbWiX91iRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXNL31JQTz18q4; Tue, 14 Jan 2025 08:57: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 50E8vFk1058881; Tue, 14 Jan 2025 08:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E8vFiB058878; Tue, 14 Jan 2025 08:57:15 GMT (envelope-from git) Date: Tue, 14 Jan 2025 08:57:15 GMT Message-Id: <202501140857.50E8vFiB058878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: aa8067cbe7c6 - stable/14 - open(2): allow O_PATH | O_CREAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aa8067cbe7c65fa30c0bf92c9e24207ed6b9f665 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aa8067cbe7c65fa30c0bf92c9e24207ed6b9f665 commit aa8067cbe7c65fa30c0bf92c9e24207ed6b9f665 Author: Konstantin Belousov AuthorDate: 2025-01-06 11:01:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 08:56:41 +0000 open(2): allow O_PATH | O_CREAT (cherry picked from commit cc0d806f63e833b9e011c0665905b2208b436c8b) --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index fbb1e1cdda92..45a9a0c2bd48 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1147,7 +1147,7 @@ openatfp(struct thread *td, int dirfd, const char *path, * except O_EXEC is ignored. */ if ((flags & O_PATH) != 0) { - flags &= ~(O_CREAT | O_ACCMODE); + flags &= ~O_ACCMODE; } else if ((flags & O_EXEC) != 0) { if (flags & O_ACCMODE) return (EINVAL); From nobody Tue Jan 14 08:57:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXNL43D24z5kP1f; Tue, 14 Jan 2025 08:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXNL427Yrz42TV; Tue, 14 Jan 2025 08:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TVz78caoWkTq/pEiphuhNdTfJmTAUJHhjNv3TQErUYk=; b=DwUdLyr3YU+VpV7TFp1mGoARAVwuz0WBuZ8lw008L9li+3R8eT5nYyLOGRXSqwFcSiOkBX Ls2YJ2U+DtTQ5LDWeDiJSHKAeqAVm4Kmtcg88JHkC73qI0fWAOltFSVc12jfhJhWdIjn5Q bQhZhVqlr1CPSbWjcAJHBBbdjAbFhAleIC7VpbI8O6yGGv3mSvoFwErUSQ/Uff1kV42hTw 0bkvsGNNfe//mRDJzfDtdd7GMNSvEtvurgp2Paj1OmA9H/Vb+FHh5pRD81e0638AWAfuCf DoO+23BBauAu050vpdF+vCLQu4WYnZ2iS9xD6JvdzO3lcjUf9q3YTgS+oJwWGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TVz78caoWkTq/pEiphuhNdTfJmTAUJHhjNv3TQErUYk=; b=xWDyv/wl5dT7RH7OQCQZ6BnDy5UmYIGNF0WOnrnkokCy8h3CsR2L1LgWscZguefFof5nq4 b8WPOYTSmf/lYi27KbmrYPuH++hmIatGhPSI73g2VHey15/JOkxiEtD+3oX17uTNACTj9F yp5Idcm/nf476yYdJh7gc381+01jyKVFq5c9EV3JFgb7B5o+7GBHBZJkx3D2Wr70ErrOJJ GWkpXLsZNd2jDnI1SxFZm+pUf1aKDIXZQWmUeVMFJospPlkqVpYkcGVrTiYzR3zeJ0QcXA RRXxfrP8fGPSnAblWUlXotTPkNJyVxL9HIubcKBqJLMEc9LVAeAchD0v3VpwYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736845036; a=rsa-sha256; cv=none; b=PpWNFTpY4ZQDgYOq7kZ3zyQfasWYf5x5hgtYYe/A1DSMbvcbIIqVhflCkX3bXGiQKMupQP fb45u8EX+gp+omapTybfbf/akj8DZ6jnces9jspTAm7wxK7lg5Zm9Fj6zs+lE6xx6CdwXD K1y3f5qt4ois1PIQlhb8uN/fES5Kv0iirKYF3X/wkz9LjtlxOodZQFnaAAjYKR+d7sS/iX a5co2VMJfUzu0JTl05yUyIfS0dFnBIrsjdK7+Ai8j9TzAaIuW+gAAwKeOX/OYTDI6u6YLt clbJMePA+QSaE+qEU367b2Yf6H339YbzpAYeKQ8JGtOG2Ot/maL4Qbkf+3BzgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXNL41d9Qz184G; Tue, 14 Jan 2025 08:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50E8vGRW058946; Tue, 14 Jan 2025 08:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E8vGgt058943; Tue, 14 Jan 2025 08:57:16 GMT (envelope-from git) Date: Tue, 14 Jan 2025 08:57:16 GMT Message-Id: <202501140857.50E8vGgt058943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1b2bf32658e5 - stable/14 - path_test: adjust test for open(O_PATH | O_CREAT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1b2bf32658e5a0dfb572e256370cb772255d2ad5 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1b2bf32658e5a0dfb572e256370cb772255d2ad5 commit 1b2bf32658e5a0dfb572e256370cb772255d2ad5 Author: Konstantin Belousov AuthorDate: 2025-01-06 22:07:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 08:56:41 +0000 path_test: adjust test for open(O_PATH | O_CREAT) (cherry picked from commit 749b3b2c0629f44f6b0044992dfb2ce5ac7e562b) --- tests/sys/file/path_test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 911c7c7075f0..b3b8b7cebd4d 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -684,10 +684,14 @@ ATF_TC_BODY(path_io, tc) size_t page_size; int error, fd, pathfd, sd[2]; - /* It shouldn't be possible to create new files with O_PATH. */ + /* It is allowed to create new files with O_PATH. */ snprintf(path, sizeof(path), "path_io.XXXXXX"); ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); - ATF_REQUIRE_ERRNO(ENOENT, open(path, O_PATH | O_CREAT, 0600) < 0); + pathfd = open(path, O_PATH | O_CREAT, 0600); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open(O_PATH|O_CREAT)")); + /* Ensure that this is indeed O_PATH fd */ + ATF_REQUIRE_ERRNO(EBADF, write(pathfd, path, strlen(path)) == -1); + CHECKED_CLOSE(pathfd); /* Create a non-empty file for use in the rest of the tests. */ mktfile(path, "path_io.XXXXXX"); From nobody Tue Jan 14 08:57:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXNL55W48z5kPWq; Tue, 14 Jan 2025 08:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXNL53RKjz42MT; Tue, 14 Jan 2025 08:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NEqgrSCqKDrusFBilzYTmEJpfXFQ6/Q7sY53tSYtB40=; b=Dv8PTF68NUffqGhUK8iviENrtTbDzqdv19ITgTw8UerXWios4G60nL8c4qT10rcZl7CuFu kyl1XzlrYRzDrcTPpjQiZxqfHhvS90twm820Rse/lxP/Duep1kClhtjMQK4WfNy0wyERoc sM2OB7LdGikUa4abNOiaZtzb0T/KZ5jHtbBu39dWgy5BJExpfOULV1YIADtytkIDojKvFF uZJnxlqkGn2OyOB9ejrQxCQYUf3vtb6CnS+nYyTs1Gz5+yL+FEWE/HEPjqngYESDYgjg72 uofJjKkOVNdAZjRG7n09bI9izg1awb/cGfkhSu83UCMNsvEPW9X6WMrCZRIwmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736845037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NEqgrSCqKDrusFBilzYTmEJpfXFQ6/Q7sY53tSYtB40=; b=LkG1wDoE567vV3rpWsoCCumSt4H+wvPaiD/ZXqy/tmVzLl2WMdvStEaLYu5UHpJqfWMEkd 4rI7Fe5isoR7sUUTAJTipBVDDEeVKRzA2P01f3J7Y4OGFmmEIe1V39msL07nDMfsKQijbm BkR3t1sbySsq3Z8qrqdaNOcIe20eh3tkfv6bmeU8iO7njTvPF99LEAcCmdBko7o1wMPk2o 4bMmQWx3C5+BwIxhsQZwxEb3fB3eWPneU4JTa+dTSH//jrPEmpfjgH/4ds9m5Hilo1XR2C 3BqJnCkPqomNWugGWIVdkMcyIPvAR3Q8fbf2axa6HvbhId/ajfYXzH3QsVNB+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736845037; a=rsa-sha256; cv=none; b=NK5wdZCxtepBEgqpCNogrE8XjN1z6WF2hLfpcAFaA0KYq78qKRF3002c51/dTXjO4duthh lkyZZa3WtWmwrLsywtkwuAiMfKiYjEDahMMnZA0dL3ewEIMZ261ywLZ1MXCFWRShNTnzx5 WEbNFJsWIDCddDhD6IuEKo7AeumNK4EQPK28NihaCY+SdAGuLmi7HC/lmV4gWK9QiTwuIG 1Wfv1If14F05tY+8ZG2ULjKcJdJ9eBEnz3SA874x/UvPxDHocEaDddMetPA/0nJL7b3w6b /pb0mciCcUQWTqKvPqoO6cmLaJWbacZMnjQjjqNIBXe3/KefGO36qD0iizAkow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXNL52yVmz18n7; Tue, 14 Jan 2025 08:57: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 50E8vHRf059007; Tue, 14 Jan 2025 08:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50E8vHZu059004; Tue, 14 Jan 2025 08:57:17 GMT (envelope-from git) Date: Tue, 14 Jan 2025 08:57:17 GMT Message-Id: <202501140857.50E8vHZu059004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: df3796cc68fc - stable/14 - pci_find_cap_method(): limit number of iterations for finding a capability List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: df3796cc68fc22fc164049ca25c45f646581203a Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=df3796cc68fc22fc164049ca25c45f646581203a commit df3796cc68fc22fc164049ca25c45f646581203a Author: Konstantin Belousov AuthorDate: 2025-01-06 23:29:18 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 08:56:41 +0000 pci_find_cap_method(): limit number of iterations for finding a capability PR: 283815 (cherry picked from commit 6ba2c036a0117ac02f9979b7dc49f15e9c1ea9c9) --- sys/dev/pci/pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8236b8bde41a..1a415f676ff7 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1513,6 +1513,7 @@ pci_find_cap_method(device_t dev, device_t child, int capability, pcicfgregs *cfg = &dinfo->cfg; uint32_t status; uint8_t ptr; + int cnt; /* * Check the CAP_LIST bit of the PCI status register first. @@ -1539,9 +1540,11 @@ pci_find_cap_method(device_t dev, device_t child, int capability, ptr = pci_read_config(child, ptr, 1); /* - * Traverse the capabilities list. + * Traverse the capabilities list. Limit by total theoretical + * maximum number of caps: capability needs at least id and + * next registers, and any type X header cannot contain caps. */ - while (ptr != 0) { + for (cnt = 0; ptr != 0 && cnt < (PCIE_REGMAX - 0x40) / 2; cnt++) { if (pci_read_config(child, ptr + PCICAP_ID, 1) == capability) { if (capreg != NULL) *capreg = ptr; From nobody Tue Jan 14 10:37:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ21lqBz5kVl9; Tue, 14 Jan 2025 10:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ20lVWz3C3j; Tue, 14 Jan 2025 10:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZGbrWKc+G7el/hbxeRD8caJn+Aw7OFXxxPY7STXh/o=; b=PiShlUTdSkLcO8mI/H09Wl3xL3HthKe7mkNAZAiRVMQDX87DJXURpDl66euqAonldK3Wli 0kvL5SORu9PsRJzz+t4iH94kqhXxmtthk5LAacjKn9dd2QBjFAcho87Xfuy+WDSUCDj6jr xqsr8b6ErSQq3WavG2ctpfzTgWMD5SIVnY5+4NGfLX1FzE3EcpOAk83hU3PG+YGykSNTFv 3mjNDNTpixTqOQsEBqcTDh7EAEngIBaU82dWXp50XHYRB1caiZIyLk5y5/VgyJYtvkwMhG eCmrJaS1X6C7ye7QUwxJQhFode5hvxnQo2/Y1CPLDToqKSZ00JhCZvK8G9GzGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bZGbrWKc+G7el/hbxeRD8caJn+Aw7OFXxxPY7STXh/o=; b=uxEqQiDduZ9CuFp2c8Cx+rgJNxSIHKH2ruUprEQjiv4/YtZOvtg8iwhy242R/cRiLSwX2f faih2RdvwIdW0j6HSlq/lh7zJWmmG8mlIV0lSijz5uu7gV6QZfqyUJXE1jTcGF9y9tgFDj NkaWxswVgGTBJ9dyfmFk300JL/fLu43aGy7lfR2b40Z8Ftz4z6LJDVP7Ntkg1SyY6OyGe2 mJz/VqAR8ujSCMwlxirD5G13jmyxO2pHVShbboo6MzywBWc6cca839ApYrvjBwLHXV7Dwo Ce+LZnPvApH3lZ901v3HXcGMjWwaYD5NjUZLaw05Pxxv83qFj8icG52gRfVULw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851066; a=rsa-sha256; cv=none; b=uafiNQ2k/qPdUmxzZIKbBpkfHQn+YXH418uRAiZMD63pgWjzQ78HEPQ5uFrY/xmxhGJ3SY SbI29OgXaG1ne3jY8DJfh4fJQGkD0AmKXlnGkmeD3XzFHCgkgpfyjM+eRW/iZfvB2ztWJN lJq8aJ0XFDmzVQ+aQdFjsofPVuvcUrEdIRpZQGnpntY4wPozd8h72Ang56dpOn06E7XM1M bpntckjCDDwUzFWOo0WnK6i7sBerysnKpgtC+fM/oHT6edXiNqfhhxLTqFmKmPtR9PTNIt cn6WKB0fpNDpKYk5QridhPaXaDzxGCWvKszYmmk2sFKaQ1IIMKOn8glfSdCJ/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ2030dz1CHj; Tue, 14 Jan 2025 10:37: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 50EAbjBL047736; Tue, 14 Jan 2025 10:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbj9o047733; Tue, 14 Jan 2025 10:37:45 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:45 GMT Message-Id: <202501141037.50EAbj9o047733@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: 441d489493e8 - main - pf: convert DIOCRCLRTABLES to netlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 441d489493e8a1e2658306f1a4c709a0b18cc78b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=441d489493e8a1e2658306f1a4c709a0b18cc78b commit 441d489493e8a1e2658306f1a4c709a0b18cc78b Author: Kristof Provost AuthorDate: 2024-12-03 15:53:08 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:17 +0000 pf: convert DIOCRCLRTABLES to netlink Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 44 ++++++++++++++++++++++++++++++++++++++ lib/libpfctl/libpfctl.h | 3 +++ sbin/pfctl/pfctl.c | 4 ++-- sbin/pfctl/pfctl.h | 5 +++-- sbin/pfctl/pfctl_radix.c | 16 -------------- sbin/pfctl/pfctl_table.c | 4 ++-- sys/netpfil/pf/pf_nl.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_nl.h | 10 +++++++++ 8 files changed, 119 insertions(+), 22 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 2e4cdb91bad9..b374ef05e4d7 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -3072,3 +3072,47 @@ pfctl_get_srcnodes(struct pfctl_handle *h, pfctl_get_srcnode_fn fn, void *arg) return (e.error); } + +static struct snl_attr_parser ap_ndel[] = { + { .type = PF_T_NBR_DELETED, .off = 0, .cb = snl_attr_get_uint32 }, +}; +static struct snl_field_parser fp_ndel[] = {}; +SNL_DECLARE_PARSER(ndel_parser, struct genlmsghdr, fp_ndel, ap_ndel); + +int +pfctl_clear_tables(struct pfctl_handle *h, struct pfr_table *filter, + int *ndel, int flags) +{ + struct snl_writer nw; + struct snl_errmsg_data e = {}; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + family_id = snl_get_genl_family(&h->ss, PFNL_FAMILY_NAME); + if (family_id == 0) + return (ENOTSUP); + + snl_init_writer(&h->ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_CLEAR_TABLES); + + snl_add_msg_attr_string(&nw, PF_T_ANCHOR, filter->pfrt_anchor); + snl_add_msg_attr_string(&nw, PF_T_NAME, filter->pfrt_name); + snl_add_msg_attr_u32(&nw, PF_T_TABLE_FLAGS, filter->pfrt_flags); + snl_add_msg_attr_u32(&nw, PF_T_FLAGS, flags); + + if ((hdr = snl_finalize_msg(&nw)) == NULL) + return (ENXIO); + + seq_id = hdr->nlmsg_seq; + + if (!snl_send_message(&h->ss, hdr)) + return (ENXIO); + + while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { + if (!snl_parse_nlmsg(&h->ss, hdr, &ndel_parser, ndel)) + continue; + } + + return (e.error); +} diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 79756286563b..14ea06fd151a 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -539,4 +539,7 @@ int pfctl_get_ruleset(struct pfctl_handle *h, const char *path, uint32_t nr, str typedef int (*pfctl_get_srcnode_fn)(struct pfctl_src_node*, void *); int pfctl_get_srcnodes(struct pfctl_handle *h, pfctl_get_srcnode_fn fn, void *arg); +int pfctl_clear_tables(struct pfctl_handle *h, struct pfr_table *filter, + int *ndel, int flags); + #endif diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 09d6774b324f..190d1a382c03 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3219,7 +3219,7 @@ 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_clear_tables(anchorname, opts); + pfctl_do_clear_tables(anchorname, opts); if (!*anchorname) { pfctl_clear_altq(dev, opts); pfctl_clear_iface_states(dev, ifaceopt, opts); @@ -3233,7 +3233,7 @@ main(int argc, char *argv[]) pfctl_clear_fingerprints(dev, opts); break; case 'T': - pfctl_clear_tables(anchorname, opts); + pfctl_do_clear_tables(anchorname, opts); break; } } diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index b4aba3beb4a6..788232d89006 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -36,6 +36,8 @@ #include +extern struct pfctl_handle *pfh; + struct pfctl; enum pfctl_show { PFCTL_SHOW_RULES, PFCTL_SHOW_LABELS, PFCTL_SHOW_NOTHING }; @@ -54,7 +56,6 @@ struct pfr_buffer { (var) = pfr_buf_next((buf), (var))) int pfr_get_fd(void); -int pfr_clr_tables(struct pfr_table *, int *, int); int pfr_add_tables(struct pfr_table *, int, int *, int); int pfr_del_tables(struct pfr_table *, int, int *, int); int pfr_get_tables(struct pfr_table *, struct pfr_table *, int *, int); @@ -82,7 +83,7 @@ int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); void pfctl_print_title(char *); -int pfctl_clear_tables(const char *, int); +int pfctl_do_clear_tables(const char *, int); int pfctl_show_tables(const char *, int); int pfctl_command_tables(int, char *[], char *, const char *, char *, const char *, int); diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 9bea219a7d81..22552bcf1737 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -73,22 +73,6 @@ pfr_report_error(struct pfr_table *tbl, struct pfioc_table *io, err, tbl->pfrt_name); } -int -pfr_clr_tables(struct pfr_table *filter, int *ndel, int flags) -{ - struct pfioc_table io; - - bzero(&io, sizeof io); - io.pfrio_flags = flags; - if (filter != NULL) - io.pfrio_table = *filter; - if (ioctl(dev, DIOCRCLRTABLES, &io)) - return (-1); - if (ndel != NULL) - *ndel = io.pfrio_ndel; - return (0); -} - int pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags) { diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index aac031ce26b2..5e701be3c654 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -104,7 +104,7 @@ static const char *istats_text[2][2][2] = { } while(0) int -pfctl_clear_tables(const char *anchor, int opts) +pfctl_do_clear_tables(const char *anchor, int opts) { return pfctl_table(0, NULL, NULL, "-F", NULL, anchor, opts); } @@ -157,7 +157,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, if (!strcmp(command, "-F")) { if (argc || file != NULL) usage(); - RVTEST(pfr_clr_tables(&table, &ndel, flags)); + RVTEST(pfctl_clear_tables(pfh, &table, &ndel, flags)); xprintf(opts, "%d tables deleted", ndel); } else if (!strcmp(command, "-s")) { b.pfrb_type = (opts & PF_OPT_VERBOSE2) ? diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index e586ad082e4b..3e7a6965d387 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1793,6 +1793,53 @@ pf_handle_get_srcnodes(struct nlmsghdr *hdr, struct nl_pstate *npt) return (0); } +#define _OUT(_field) offsetof(struct pfioc_table, _field) +static const struct nlattr_parser nla_p_table[] = { + { .type = PF_T_ANCHOR, .off = _OUT(pfrio_table.pfrt_anchor), .arg = (void *)MAXPATHLEN, .cb = nlattr_get_chara }, + { .type = PF_T_NAME, .off = _OUT(pfrio_table.pfrt_name), .arg = (void *)PF_TABLE_NAME_SIZE, .cb = nlattr_get_chara }, + { .type = PF_T_TABLE_FLAGS, .off = _OUT(pfrio_table.pfrt_flags), .cb = nlattr_get_uint32 }, + { .type = PF_T_FLAGS, .off = _OUT(pfrio_flags), .cb = nlattr_get_uint32 }, +}; +static const struct nlfield_parser nlf_p_table[] = {}; +NL_DECLARE_PARSER(table_parser, struct genlmsghdr, nlf_p_table, nla_p_table); +#undef _OUT +static int +pf_handle_clear_tables(struct nlmsghdr *hdr, struct nl_pstate *npt) +{ + struct pfioc_table attrs = { 0 }; + struct nl_writer *nw = npt->nw; + struct genlmsghdr *ghdr_new; + int ndel = 0; + int error; + + error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs); + if (error != 0) + return (error); + + PF_RULES_WLOCK(); + error = pfr_clr_tables(&attrs.pfrio_table, &ndel, attrs.pfrio_flags | PFR_FLAG_USERIOCTL); + PF_RULES_WUNLOCK(); + if (error != 0) + return (error); + + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) + return (ENOMEM); + + ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); + ghdr_new->cmd = PFNL_CMD_CLEAR_TABLES; + ghdr_new->version = 0; + ghdr_new->reserved = 0; + + nlattr_add_u32(nw, PF_T_NBR_DELETED, ndel); + + if (!nlmsg_end(nw)) { + nlmsg_abort(nw); + return (ENOMEM); + } + + return (0); +} + static const struct nlhdr_parser *all_parsers[] = { &state_parser, &addrule_parser, @@ -1806,6 +1853,7 @@ static const struct nlhdr_parser *all_parsers[] = { &pool_addr_parser, &add_addr_parser, &ruleset_parser, + &table_parser, }; static int family_id; @@ -1986,6 +2034,13 @@ static const struct genl_cmd pf_cmds[] = { .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, .cmd_priv = PRIV_NETINET_PF, }, + { + .cmd_num = PFNL_CMD_CLEAR_TABLES, + .cmd_name = "CLEAR_TABLES", + .cmd_cb = pf_handle_clear_tables, + .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, + }, }; void diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 0f534bd623c4..8c0149891773 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -61,6 +61,7 @@ enum { PFNL_CMD_GET_RULESETS = 23, PFNL_CMD_GET_RULESET = 24, PFNL_CMD_GET_SRCNODES = 25, + PFNL_CMD_CLEAR_TABLES = 26, __PFNL_CMD_MAX, }; #define PFNL_CMD_MAX (__PFNL_CMD_MAX -1) @@ -422,6 +423,15 @@ enum pf_srcnodes_types_t { PF_SN_NAF = 15, /* u8 */ }; +enum pf_tables_t { + PF_T_UNSPEC, + PF_T_ANCHOR = 1, /* string */ + PF_T_NAME = 2, /* string */ + PF_T_TABLE_FLAGS = 3, /* u32 */ + PF_T_FLAGS = 4, /* u32 */ + PF_T_NBR_DELETED = 5, /* u32 */ +}; + #ifdef _KERNEL void pf_nl_register(void); From nobody Tue Jan 14 10:37:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ33M4wz5kVqK; Tue, 14 Jan 2025 10:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ30xq3z3Bq3; Tue, 14 Jan 2025 10:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcI+0kl9w5zO98toiuVyXCJA9Pin2oDuACuwm02VTHk=; b=WU+NidOrTJRPiuh2jZMO4aRcP3mwhJdi9BeHCtGXAHv6pgkRzLFC4nt60QHLW/huTAHHO+ IiNpdgLJFUZZYd8JSL03AzCgMH7SJLIx3FGNXqe5jTbiKDdfpfA4cwNTk7QVe7sZF10R5p mE/bcS0l1VnfdZEXCWSfWZOP6vZ1I3iAM0PXv56Nlsve7GuL7IIEjM04pX5TSIF/CFYQii mz2JCiH5DCosnM3Vj9GasHNeMicZv5Q+MB8XJgBHA7WLCqSxKpalSO6ojZ+lCLFfNC0bic qMvGG4WohDJKKUwoItVEpwTNy9S3JRtqgbmBVvzXXKQtcc4m5SN9DxqTRLwZsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcI+0kl9w5zO98toiuVyXCJA9Pin2oDuACuwm02VTHk=; b=FXjmh3iJ94xarRHCZXfR7KOtsm3CKIMCTPKN0LpoP5qP+eMrGa82dC9SS8n84z+2JSB8Ds iYS5IarI/xqGVHOlip1NfUcEl9KMtMxQdV+nCxyt4xfIQN9MjZjYSWjq9K7ODn2VYxLy5u mIYRsEGzivFh+ITPFb+vH3u2QCzMJQWyAfOsRAATMtAqD0Q3fQtVYi6Czlti5NW8HBczV9 305HQ5cMSQLYVp9Y0/nRUo3rshF7aWqQC9nuEWrDAm3E/D9csPrbCiiI4MScSs1b3AqYRy XN8lDRCg2Y/borBVueQV5zNkmeH12SQFgCZJIb6+6J9JD1pMiBawZoXa1TOQLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851067; a=rsa-sha256; cv=none; b=u7B95bI/l2GOVLU4tGD66fHva7w1q+NFKIMn0Ej1AlKQJ/QdTxkg2Sdc9YDz0wPWRbx92A ML3Rbnci3srAi+NEGiXCkNGFf68rgL3zOq1AwvVIKswlv1BQd9m0IVS7qD/RaCCvgWg0xH LQ4Wc7dJgO0FZuLRDKCpHK0EL2htTbqHyFvx93AkJYC2O3hHV3koFlS5Eqkv12n7l+1XIL /eQXcAs4PXaMuzUY3inSxTFQ/VtTnDqvvB4/tRomovAP4cnOZoxOGO6Hp4Fp05nVU8o3xF iBdnjb1Lx8Cpty/RUzpvWTzTdJQNbE/m05/OahAC7g8khi5PNwl0Or2UerpxtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ30Y24z1C6T; Tue, 14 Jan 2025 10:37: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 50EAblcR047778; Tue, 14 Jan 2025 10:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAblgj047775; Tue, 14 Jan 2025 10:37:47 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:47 GMT Message-Id: <202501141037.50EAblgj047775@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: 4aafc73d1255 - main - pfctl: pfctl_set_hostid always returns 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4aafc73d1255a92463d2ee73cea381462775e64a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4aafc73d1255a92463d2ee73cea381462775e64a commit 4aafc73d1255a92463d2ee73cea381462775e64a Author: Kristof Provost AuthorDate: 2025-01-07 10:55:05 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:17 +0000 pfctl: pfctl_set_hostid always returns 0 Don't pretend otherwise and make it a void function instead. ok dlg Obtained from: OpenBSD, mcbride , 9ac6101ff7 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 5 +---- sbin/pfctl/pfctl.c | 6 ++---- sbin/pfctl/pfctl_parser.h | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index fc9cf86081f6..63bee3ab6a1c 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -702,10 +702,7 @@ option : SET REASSEMBLE yesno optnodf { yyerror("hostid must be non-zero"); YYERROR; } - if (pfctl_set_hostid(pf, $3) != 0) { - yyerror("error setting hostid %08x", $3); - YYERROR; - } + pfctl_set_hostid(pf, $3); } | SET BLOCKPOLICY DROP { if (pf->opts & PF_OPT_VERBOSE) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 190d1a382c03..4b2a69f456a2 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2571,11 +2571,11 @@ pfctl_load_logif(struct pfctl *pf, char *ifname) return (pfctl_set_statusif(pfh, ifname ? ifname : "")); } -int +void pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid) { if ((loadopt & PFCTL_FLAG_OPTION) == 0) - return (0); + return; HTONL(hostid); @@ -2584,8 +2584,6 @@ pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid) if (pf->opts & PF_OPT_VERBOSE) printf("set hostid 0x%08x\n", ntohl(hostid)); - - return (0); } int diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 551f2ff7537c..2b0766dfd99f 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -290,7 +290,7 @@ int pfctl_set_reassembly(struct pfctl *, int, int); int pfctl_set_optimization(struct pfctl *, const char *); int pfctl_apply_limit(struct pfctl *, const char *, unsigned int); int pfctl_set_logif(struct pfctl *, char *); -int pfctl_set_hostid(struct pfctl *, u_int32_t); +void pfctl_set_hostid(struct pfctl *, u_int32_t); int pfctl_do_set_debug(struct pfctl *, char *); int pfctl_set_interface_flags(struct pfctl *, char *, int, int); int pfctl_cfg_syncookies(struct pfctl *, uint8_t, struct pfctl_watermarks *); From nobody Tue Jan 14 10:37:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ46X7Kz5kVN0; Tue, 14 Jan 2025 10:37:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ42g65z3BsK; Tue, 14 Jan 2025 10:37:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=moJRPrH08WgyPN0UrMFaZcjrkj+duJWbVx2rhPxh64A=; b=LqYIGPHxYBLd0RdGrJiiPel1gEohGamcXdV1Yw5oCq25O6MRSJSq95cpGJaiexpTQR40lp fxZUGxichsdAErLDSjyv1vD4tz4X7TbDnPU3qy1kw0VfekXiV9Y2yZCpYMp288oVPpbPz9 t8qGuHuokxRHn7rg9CvjqSIKaF6GuXSCk2Q6QGwRzatkwOAvuUyR19FM8I3gbxzTGfHRYI RV48ZENVktGbRncgFYnbWoOznWoTuQazyWpweZ9Jzqinp6ebX1HiULSGTnsqApLLs1hFt/ FHaE1ltb8aXn6nqHyrmHtvyICpvYKLkJZ8b/eA9Qm3XkukZgC7KF2QyeFnfxBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=moJRPrH08WgyPN0UrMFaZcjrkj+duJWbVx2rhPxh64A=; b=Z9I9YCXn/NODKdE07saRinCrEAyUyoR0DiiXQ4vqsyr4Ylqj+mmUiBZWfZhL+K9j7SVFg7 ip6gPuMvH5wnM9OhivmSsFjcf0Ec6o2n+CXpZe7ASPHIt+Mlf7Xz5lLmgmAiFMXtnPCcUc 8n8j574SE9YcFADTOjRTWY3tkVVjI1uB5z1DiKJUngDb+8PrllJOCSuewoook8jzGedy6U OTOme4wXqJdNCZ/KMYxzMb4cjos6zYDE3Cd3B0yhuMIZKBkFF3ETlF47NSjdkWxZvUSj2w Dvlov14PCFvYRno1yWcnjOUU+fg9Wb1TBzPcr7KNawe0Cdv0TWNyjepAQj2A/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851068; a=rsa-sha256; cv=none; b=JhbA/B+q7x80N75aN8rK4zLYFOqYthVV308Nd9XFaAlfjnnuVEovbhtTSANgsn99EzkZfv SgXOkdD7TFvS/N/y+6wtTfJeTf9KuYnw1KZVA/v4NpqY4nOhCsP7F3i0TtJSSGzKwtsXVo V72Mv/aTD7lrv4dD8BBq6oYrbN9D89vEJqPILxAnHyrK0mQWsencUDDDFwuY19LC23T1uD FmiiWjnoRGRlgguFXEJq/cjqgnNuGqasMSFUYUNKV+0Tuqic7dOmZeKEYwyY2TTRhnBqBU qcF4GVLmC8eKxkdKBeb/gip74hcfWA1QUCdDibrZfHkbPpBCfqJhTFIuPZatXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ41xgtz1Brg; Tue, 14 Jan 2025 10:37: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 50EAbmlR047834; Tue, 14 Jan 2025 10:37:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbm4k047831; Tue, 14 Jan 2025 10:37:48 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:48 GMT Message-Id: <202501141037.50EAbm4k047831@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: f88019e8a35c - main - pf: fixup af-to regression with match rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f88019e8a35c05b61b5722e4b98cd7b5cca167f7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f88019e8a35c05b61b5722e4b98cd7b5cca167f7 commit f88019e8a35c05b61b5722e4b98cd7b5cca167f7 Author: Kristof Provost AuthorDate: 2025-01-07 11:12:12 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:17 +0000 pf: fixup af-to regression with match rules pfctl should not infer the af-to behavior from the af/naf difference. instead, we should be clear that this is an af-to rule. essentially this change converts FOM_AFTO marker into a rule flag PFRULE_AFTO so that we don't rely on ambiguous checks (like r->af != r->naf) when setting things up. positive review and comments from claudio, ok henning, sperreault Obtained from: OpenBSD, mikeb , fc302162c0 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 36 +++++++++++++++++++++--------------- sbin/pfctl/pfctl_parser.c | 2 +- sys/netpfil/pf/pf.c | 4 ++-- sys/netpfil/pf/pf.h | 1 + 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 63bee3ab6a1c..3c34b0237895 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -382,7 +382,7 @@ void expand_eth_rule(struct pfctl_eth_rule *, struct node_host *, struct node_host *, const char *, const char *); void expand_rule(struct pfctl_rule *, struct node_if *, - struct node_host *, + struct redirspec *, struct redirspec *, struct node_host *, struct node_host *, struct node_proto *, struct node_os *, struct node_host *, struct node_port *, struct node_host *, struct node_port *, struct node_uid *, struct node_gid *, @@ -1079,9 +1079,8 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto decide_address_family($8.src.host, &r.af); decide_address_family($8.dst.host, &r.af); - r.naf = r.af; - expand_rule(&r, $5, NULL, NULL, $7, $8.src_os, + expand_rule(&r, $5, NULL, NULL, NULL, NULL, $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, $9.uid, $9.gid, $9.rcv, $9.icmpspec, pf->astack[pf->asd + 1] ? pf->alast->name : $2); @@ -1104,7 +1103,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto decide_address_family($6.src.host, &r.af); decide_address_family($6.dst.host, &r.af); - expand_rule(&r, $3, NULL, NULL, $5, $6.src_os, + expand_rule(&r, $3, NULL, NULL, NULL, NULL, $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, 0, 0, 0, 0, $2); free($2); @@ -1146,7 +1145,7 @@ anchorrule : ANCHOR anchorname dir quick interface af proto fromto r.dst.port_op = $6.dst.port->op; } - expand_rule(&r, $3, NULL, NULL, $5, $6.src_os, + expand_rule(&r, $3, NULL, NULL, NULL, NULL, $5, $6.src_os, $6.src.host, $6.src.port, $6.dst.host, $6.dst.port, 0, 0, 0, 0, $2); free($2); @@ -1469,7 +1468,7 @@ scrubrule : scrubaction dir logquick interface af proto fromto scrub_opts r.match_tag_not = $8.match_tag_not; r.rtableid = $8.rtableid; - expand_rule(&r, $4, NULL, NULL, $6, $7.src_os, + expand_rule(&r, $4, NULL, NULL, NULL, NULL, $6, $7.src_os, $7.src.host, $7.src.port, $7.dst.host, $7.dst.port, NULL, NULL, NULL, NULL, ""); } @@ -1634,7 +1633,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { } if (h != NULL) - expand_rule(&r, j, NULL, NULL, NULL, NULL, h, + expand_rule(&r, j, NULL, NULL, NULL, NULL, NULL, NULL, h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ""); @@ -1656,7 +1655,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { else h = ifa_lookup(i->ifname, 0); if (h != NULL) - expand_rule(&r, NULL, NULL, NULL, + expand_rule(&r, NULL, NULL, NULL, NULL, NULL, NULL, NULL, h, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ""); } else @@ -2434,6 +2433,7 @@ pfrule : action dir logquick interface route af proto fromto "translation"); YYERROR; } + r.rule_flag |= PFRULE_AFTO; } r.af = $6; @@ -2721,7 +2721,6 @@ pfrule : action dir logquick interface route af proto fromto decide_address_family($8.src.host, &r.af); decide_address_family($8.dst.host, &r.af); - r.naf = r.af; if ($5.rt) { if (!r.direction) { @@ -2837,7 +2836,7 @@ pfrule : action dir logquick interface route af proto fromto YYERROR; } - expand_rule(&r, $4, $5.host, $9.nat.rdr ? $9.nat.rdr->host : NULL, + expand_rule(&r, $4, &$9.nat, &$9.rdr, $5.host, $9.nat.rdr ? $9.nat.rdr->host : NULL, $7, $8.src_os, $8.src.host, $8.src.port, $8.dst.host, $8.dst.port, $9.uid, $9.gid, $9.rcv, $9.icmpspec, ""); } @@ -4985,8 +4984,8 @@ natrule : nataction interface af proto fromto tag tagged rtable o = o->next; } - expand_rule(&r, $2, $9 == NULL ? NULL : $9->host, NULL, $4, - $5.src_os, $5.src.host, $5.src.port, $5.dst.host, + expand_rule(&r, $2, NULL, NULL, $9 == NULL ? NULL : $9->host, + NULL, $4, $5.src_os, $5.src.host, $5.src.port, $5.dst.host, $5.dst.port, 0, 0, 0, 0, ""); free($9); } @@ -5501,7 +5500,7 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) "must not be used on match rules"); problems++; } - if (r->naf != r->af) { + if (r->rule_flag & PFRULE_AFTO) { yyerror("af-to is not supported on match rules"); problems++; } @@ -6139,7 +6138,8 @@ expand_eth_rule(struct pfctl_eth_rule *r, void expand_rule(struct pfctl_rule *r, - struct node_if *interfaces, struct node_host *rdr_hosts, + struct node_if *interfaces, struct redirspec *nat, + struct redirspec *rdr, struct node_host *rdr_hosts, struct node_host *nat_hosts, struct node_proto *protos, struct node_os *src_oses, struct node_host *src_hosts, struct node_port *src_ports, @@ -6179,7 +6179,13 @@ expand_rule(struct pfctl_rule *r, LOOP_THROUGH(struct node_uid, uid, uids, LOOP_THROUGH(struct node_gid, gid, gids, - r->af = af; + r->naf = r->af = af; + + if (r->rule_flag & PFRULE_AFTO) { + assert(nat != NULL); + r->naf = nat->af; + } + /* for link-local IPv6 address, interface must match up */ if ((r->af && src_host->af && r->af != src_host->af) || (r->af && dst_host->af && r->af != dst_host->af) || diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 741915d41b0d..af10bdcf7e4b 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1238,7 +1238,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer #endif } if (!anchor_call[0] && ! TAILQ_EMPTY(&r->nat.list) && - r->naf != r->af) { + r->rule_flag & PFRULE_AFTO) { printf(" af-to %s from ", r->naf == AF_INET ? "inet" : "inet6"); print_pool(&r->nat, r->nat.proxy_port[0], r->nat.proxy_port[1], r->naf ? r->naf : r->af, PF_NAT); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 335b192d454d..dd337c0aef93 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5802,7 +5802,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, pf_counter_u64_add_protected(&r->bytes[pd->dir == PF_OUT], pd->tot_len); pf_counter_u64_critical_exit(); pf_rule_to_actions(r, &pd->act); - if (r->naf) + if (r->rule_flag & PFRULE_AFTO) pd->naf = r->naf; if (pd->af != pd->naf) { if (pf_get_transaddr_af(r, pd) == -1) { @@ -5842,7 +5842,7 @@ nextrule: /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - if (r->naf) + if (r->rule_flag & PFRULE_AFTO) pd->naf = r->naf; if (pd->af != pd->naf) { if (pf_get_transaddr_af(r, pd) == -1) { diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 0d4d0a6a6f32..10431d9b77d9 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -617,6 +617,7 @@ struct pf_rule { #define PFRULE_IFBOUND 0x00010000 /* if-bound */ #define PFRULE_STATESLOPPY 0x00020000 /* sloppy state tracking */ #define PFRULE_PFLOW 0x00040000 +#define PFRULE_AFTO 0x00200000 /* af-to rule */ #ifdef _KERNEL #define PFRULE_REFS 0x0080 /* rule has references */ From nobody Tue Jan 14 10:37:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ71j98z5kVtc; Tue, 14 Jan 2025 10:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ64Sjyz3Bw1; Tue, 14 Jan 2025 10:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tm5CbgHTqZK4WaA6OiD4p/M1UH8djHIvkTZz9OlLgM0=; b=sQpHQwjD4fOU0gL+Y/FwLrSHPwAvFDutVBfNW4QFZw9nb5x1WdQ/7tPF+kqVm3cEVFDllp way68YP0/rXVWlq6wZKD+A7K9l1GMFFBeXLl0rT/7ydtP9oe66AQbB6faTAjnNfpyms3Nd 53/CndJNvRRTuBt46GsuNWQEIY50BFz3QYIMhh+vzVHXhUxkhY/dzNTXZtBco+AC2HLVbv P03KDv4Svia87Ap+2AHnD4m9NFFpwrXeWl5ba3HBhPD6iThv9IfnWp7+7IOOLRHqS3UfCa OFfnYx0TP6LfWzrRYrxBmg3klu0MBHaicggB4h1eKKMTvPuOmXwTqcUXCr5a+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tm5CbgHTqZK4WaA6OiD4p/M1UH8djHIvkTZz9OlLgM0=; b=vbT7G6/xq5D/6YMaQVLFM3aXSFMl7DUMz4wdgJMTmrDu22//ZIWNH6d6vdqWuxDB74PVfJ pvDpMqjO+VqK8zTAEmIn1C56wHNJfmpJnwqb8rAgoYI8VH4sW7GudeS4aMaZPCRG5nybP1 ZCzqtdep8+aGg7WMVlRdi5b7bzfzRYhQpQ3mQdv5AKSrLQofptrXoOV1XQbd9hS9LPRA90 Si52DtsGm6BouCvSQPNzRKGZ6RglyQH56GC7fst5nZt801v8LtYM0PpU2STsaVglFxLbFy z1xLcAGiY5L3ogrWeU5n9RMZMzU89wK2Y7suhUX9OMTL9i7Pw0hI92MfuxfAKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851070; a=rsa-sha256; cv=none; b=iqe1NAlIcJdu/OaDY3z1oumCdgHH+D9wkveT/Z58LEZ+9pNwr2M6wy5yh5wFskn9tWie2L 0Sj73jHxKclfFqMtgKpOFe09kgG9MpEKU6857YcMqBkQxkvFjGoLJ0D+cNpERLKIV+8U+u XpsdcZyKZkSzhm3oJ/dEZDsrjtDwHQlj317+xpeJoe0kiQxPVu7P0GQp6kkb2UtKuT8dXI idBd/D+EQQZX3eu2nl8UnMByfvubALmwJ71AP96a+bqsre/fZa3d/IESMtiKxkjgKVh1Ow IKtdciONVmR8Kto4SHv3CMI2GAThFMiWcBpJZ9lOVGw5b4GDUjeP0VxSG3kvnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ63wNFz1C3T; Tue, 14 Jan 2025 10:37: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 50EAbox1047946; Tue, 14 Jan 2025 10:37:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAboQl047943; Tue, 14 Jan 2025 10:37:50 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:50 GMT Message-Id: <202501141037.50EAboQl047943@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: 37101926c920 - main - pf improve the icmp direction check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37101926c920e9fd9b7d89b1ed480103305be4c4 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=37101926c920e9fd9b7d89b1ed480103305be4c4 commit 37101926c920e9fd9b7d89b1ed480103305be4c4 Author: Kristof Provost AuthorDate: 2025-01-07 14:17:51 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:18 +0000 pf improve the icmp direction check Deal correctly with af-to states (there only one state and it's direction is always PF_IN). ok mcbride, claudio on previous version, ok henning, "looks good" deraadt We deviate from the OpenBSD change in that we don't include the "don't exclude icmp echo replies from the test." part of the commit. This is a user-visible behaviour change, and is likely to break existing configurations. For example, it breaks the netpfil/common/dummynet:pf_queue tests. Obtained from: OpenBSD, mikeb , b96cc44e9e Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index dd337c0aef93..bee5690e02c4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7679,9 +7679,14 @@ pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, return (-1); /* Is this ICMP message flowing in right direction? */ + if ((*state)->key[PF_SK_WIRE]->af != (*state)->key[PF_SK_STACK]->af) + direction = (pd->af == (*state)->key[PF_SK_WIRE]->af) ? + PF_IN : PF_OUT; + else + direction = (*state)->direction; if ((*state)->rule->type && - (((!inner && (*state)->direction == direction) || - (inner && (*state)->direction != direction)) ? + (((!inner && direction == pd->dir) || + (inner && direction != pd->dir)) ? PF_IN : PF_OUT) != icmp_dir) { if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: icmp type %d in wrong direction (%d): ", From nobody Tue Jan 14 10:37:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ55MY9z5kVlN; Tue, 14 Jan 2025 10:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ53LPmz3By0; Tue, 14 Jan 2025 10:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GEUCQER6kSy7HnzTp/83ZpYvemiYg38QbOvTeQYNZM=; b=vGtG3LAurLsC29o1n5YG1pLtY1XCZGks2Tbnywtm9lhNdzJXbcDEN+CwxsOTFhh1MZUe3y lUGU90bvhdoc8c9S8p1MejYvxcNiyCTC31ICS0jhKoYUatffGqHxw9IFjw9tpPj3CvQzBI qRFR932umuKGC0VfY5Fwxfa+EvrTYkGTju/i52aofHM0pnKWrDoVSJVEJOPigBJ65pkyB+ QhxJyPdVeStsNnJ12Pez7Ni6cpOCDOrYoStzuz8iZtXUUbzisbH4TwSRsHb58EM3vnZm1T JZRseowJ2DTo9Fda8oVEawisrHPcGEei9yV8//i96Qdtr4Jb4ThCkc9jF6zTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0GEUCQER6kSy7HnzTp/83ZpYvemiYg38QbOvTeQYNZM=; b=SLAQmFyw7u+PoALgJRX9E9gVN1tRz+iAtNNRmXYCTDoSkcSVFSCfKf1+VEhz0GiGnftY46 iIk2OSOqc8rrzcyXXFbxlp4eidbGmr4KR7DP5Yro7onPnhZLvi/t0NZ0lLt2rhudGjKFjG HklkccTs9LWXvo+KL+gbMBDjGELtxE3zPN1h80K1d5IdYMPgwpKzCst1qCinoCQ0yOvckF gSkzWxZbBYfuHicjRh+zZ4kI7pkMfuqNPhax2B+w97nG36dTm+o+R6vi7UEGdcctE1gbFo OtEFOfV+qGQzLXrUXg0K1IBfIj15eEvrrpkIi37lkT13ERBMjWdcMOR7d8PmWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851069; a=rsa-sha256; cv=none; b=Vx+pCLwqk/CPloIgxjsizVer5zllMYbdJadptAdKHFTp2AvMIYFObGpM14fEDh9tZn0SX6 3pousJ/jbdOFkqepazwRVdJFjDz8TpfUQqpIztUSZU4kBKU299bffq/zv+WDuSHcaSZ+p0 jiHwT1BxliJ66AAJcOKv+6cpIFRLCm+3BUO0isQe0zyDCeyB75jYifKQWvH7ZZY6lVQ50o Kp9Vk5oqJ3OcaUv7hTvXPRXJnoh7nRpRAUlwJxHnswMBBOmlzKbf97vD1rMv8Jim8IY0td uRlDdWtVZNcx9L2k9kG+XOVgsZPdj5lrku+VnByFYiaaMBad2rIK65b8MgAhHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ52t8Cz1CHk; Tue, 14 Jan 2025 10:37: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 50EAbnUx047893; Tue, 14 Jan 2025 10:37:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbnI4047890; Tue, 14 Jan 2025 10:37:49 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:49 GMT Message-Id: <202501141037.50EAbnI4047890@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: 0d68985b0170 - main - pfctl: unbreak rule optimizer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d68985b0170f704ee45dfb6c209cc852870d2c2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0d68985b0170f704ee45dfb6c209cc852870d2c2 commit 0d68985b0170f704ee45dfb6c209cc852870d2c2 Author: Kristof Provost AuthorDate: 2025-01-07 14:15:15 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:18 +0000 pfctl: unbreak rule optimizer ok henning, looks Obtained from: OpenBSD, mikeb , 4a16887b1b Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 +- sbin/pfctl/pfctl_optimize.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 3c34b0237895..ff2e2d2c93b7 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -6179,7 +6179,7 @@ expand_rule(struct pfctl_rule *r, LOOP_THROUGH(struct node_uid, uid, uids, LOOP_THROUGH(struct node_gid, gid, gids, - r->naf = r->af = af; + r->af = af; if (r->rule_flag & PFRULE_AFTO) { assert(nat != NULL); diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c index 9858f38b8671..a688fe484128 100644 --- a/sbin/pfctl/pfctl_optimize.c +++ b/sbin/pfctl/pfctl_optimize.c @@ -172,6 +172,7 @@ static struct pf_rule_field { PF_RULE_FIELD(dst.port_op, NOMERGE), PF_RULE_FIELD(src.neg, NOMERGE), PF_RULE_FIELD(dst.neg, NOMERGE), + PF_RULE_FIELD(af, NOMERGE), /* These fields can be merged */ PF_RULE_FIELD(src.addr, COMBINED), From nobody Tue Jan 14 10:37:51 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ82RpPz5kVqd; Tue, 14 Jan 2025 10:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ74zBnz4B8P; Tue, 14 Jan 2025 10:37:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h5K2ueOyYp9saZ/wP0XM71RVNHOnWet3s86aDVIm3ZE=; b=DG7KUI5UnmQHYxuAS6odokBSIA3M7pM2MIutCR4J44Z6D7UEWDl2yridLyfQIVv9Egvs2r r/b4+eBBHS/Frr2g3J5R73kZyJQWltnPYf4RXSKMUKKBqa8B2KZ3b5/RTPcXfl9EWtwvF/ hx8DIsaTn0106K7JHvFPkLVqfG3Qf9jyRNJ8WoyOa/OSNASaWoZ0aJFYJl41vtQisTZcmn s2lO7BH3oiyBJAWwoaRhqL6ex26ZXBK4yCHPr1ai5Bh/m/4ouIJUSfTjWLHezsTVcDRpe+ X0ZyKLc2d5ft1tISQYo0MqEhJrxrJs1GGJhqbIy+5YKTePDkewXaIHspd7tCog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h5K2ueOyYp9saZ/wP0XM71RVNHOnWet3s86aDVIm3ZE=; b=C7xYTHkQhTiGUL0Fo68UA4UlMBNXYYh3kDPfxexj/1wKNqf88wh8mGInnwBIDF2joPNN9c jFinMKHycRX3wAW4y0QdLZ7W8amze1hNFBU2L4OXrUDD68GqJyYF3gc1yShplWb1w6msh5 +eA401X8diBy60HKzxCZ9huYLNqQjZopEFWkdnqQkG2A0t4080eF7w9mAVOeK667rXj+UJ kPz+SL96ekVrFK3dUQB4A958q3LOcdc7QjBWp0Le/ZRZKf9nRtoeMzxxB0FKCC+bu6b8Lu V+DhLAI9XetSliflquxPn80/Kv4hWWHXzBesHFmgASKXX9i1HqY0f8u1gIeWMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851071; a=rsa-sha256; cv=none; b=NEWKijkWgvfFn4+Zo2NYZPEF3PgvonHsW27CepHu2o1MrgGnaA/iOSgETl1b8fgFfX9Nz0 r0oyqZxDwN37a5xy3Qr48XaWVafp7gQbJey4DDUuve4mhDZm5JPb9xsTpSg2BBNqCBt118 oQzrTRpKEACzyRZoE2x75jBllHuOmG0uIySC5rb24pwO6i2Yeyqd/ZNbLeXo1vJvAcxpBm bjvSqjkTWdwEQBDAwscTh8ZNZXi/Kq63ULEbzw0O2mcNELPNORwFCyXFw+7cC9EL9SzlcX NoYD5sUQqUq7nTKp+PmEKWcJGLr/irIeekpPDE8lJOKoFaxb5eWHobjplU3Stg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ74ZMlz1CNs; Tue, 14 Jan 2025 10:37: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 50EAbpmB048004; Tue, 14 Jan 2025 10:37:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbpQT048001; Tue, 14 Jan 2025 10:37:51 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:51 GMT Message-Id: <202501141037.50EAbpQT048001@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: f2a1e40bb19b - main - pf: simplify state key setup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2a1e40bb19b780467beb4ff98dca3f8b30a953d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f2a1e40bb19b780467beb4ff98dca3f8b30a953d commit f2a1e40bb19b780467beb4ff98dca3f8b30a953d Author: Kristof Provost AuthorDate: 2025-01-07 14:21:48 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:18 +0000 pf: simplify state key setup Just use pd->sidx and pd->didx to reverse the state key arguments in pf_test_state_*(). This needs less code and is more consistent. OK mikeb, markus, henning. Obtained from: OpenBSD, mpf , 2c0d332046 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 57 ++++++++++++++--------------------------------------- 1 file changed, 15 insertions(+), 42 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index bee5690e02c4..3d1ba8e8deb4 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6900,17 +6900,10 @@ pf_test_state_tcp(struct pf_kstate **state, struct pf_pdesc *pd, bzero(&key, sizeof(key)); key.af = pd->af; key.proto = IPPROTO_TCP; - if (pd->dir == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - key.port[0] = th->th_sport; - key.port[1] = th->th_dport; - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); - key.port[1] = th->th_sport; - key.port[0] = th->th_dport; - } + PF_ACPY(&key.addr[pd->sidx], pd->src, key.af); + PF_ACPY(&key.addr[pd->didx], pd->dst, key.af); + key.port[pd->sidx] = th->th_sport; + key.port[pd->didx] = th->th_dport; STATE_LOOKUP(&key, *state, pd); @@ -7010,17 +7003,10 @@ pf_test_state_udp(struct pf_kstate **state, struct pf_pdesc *pd) bzero(&key, sizeof(key)); key.af = pd->af; key.proto = IPPROTO_UDP; - if (pd->dir == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - key.port[0] = uh->uh_sport; - key.port[1] = uh->uh_dport; - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); - key.port[1] = uh->uh_sport; - key.port[0] = uh->uh_dport; - } + PF_ACPY(&key.addr[pd->sidx], pd->src, key.af); + PF_ACPY(&key.addr[pd->didx], pd->dst, key.af); + key.port[pd->sidx] = uh->uh_sport; + key.port[pd->didx] = uh->uh_dport; STATE_LOOKUP(&key, *state, pd); @@ -7127,17 +7113,10 @@ pf_test_state_sctp(struct pf_kstate **state, struct pf_pdesc *pd, bzero(&key, sizeof(key)); key.af = pd->af; key.proto = IPPROTO_SCTP; - if (pd->dir == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - key.port[0] = sh->src_port; - key.port[1] = sh->dest_port; - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); - key.port[1] = sh->src_port; - key.port[0] = sh->dest_port; - } + PF_ACPY(&key.addr[pd->sidx], pd->src, key.af); + PF_ACPY(&key.addr[pd->didx], pd->dst, key.af); + key.port[pd->sidx] = sh->src_port; + key.port[pd->didx] = sh->dest_port; STATE_LOOKUP(&key, *state, pd); @@ -8670,15 +8649,9 @@ pf_test_state_other(struct pf_kstate **state, struct pf_pdesc *pd) bzero(&key, sizeof(key)); key.af = pd->af; key.proto = pd->proto; - if (pd->dir == PF_IN) { - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - key.port[0] = key.port[1] = 0; - } else { - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); - key.port[1] = key.port[0] = 0; - } + PF_ACPY(&key.addr[pd->sidx], pd->src, key.af); + PF_ACPY(&key.addr[pd->didx], pd->dst, key.af); + key.port[0] = key.port[1] = 0; STATE_LOOKUP(&key, *state, pd); From nobody Tue Jan 14 10:37:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZ973Vjz5kVql; Tue, 14 Jan 2025 10:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZ86gYSz3C4J; Tue, 14 Jan 2025 10:37:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQ/2O87bHSHQD/PbaquKUQHX3ThLkW7/d4zOkHdKSgY=; b=eiascFNMAMGyKpJxDgSHz6TEOUNB+hjsXRNrbq9BMFkbEDXCff+YmpwzS1zlJeepsMozqG VLV1j0hR2A52Um5mNK12J+aUYMv6drZdrx0deyeCSbmCEU4xVu6LyVxZATo1z7de8f4NxI C0qJxpROheFZavfmVt2KA7hCguGHTjb5HcPEC8qzK0LC6nVeNi0hCMtmArwZF4CntICE6L Q/frbPSpOlqKj986f8ZhwCxo09EisBYBjsKnpxh1QsThVEIvagOOyOYlLBdX0vGfcX6cOb mbVuTzw5rPkfW5DhZxYkHS1KMDZ1jnkachPC/Ckxm9AvqKKDPrniAdbq6DAQGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aQ/2O87bHSHQD/PbaquKUQHX3ThLkW7/d4zOkHdKSgY=; b=sF8gF/70ymJqzUcItqF4C7im4jF9+RBkk8K/xto9iYIEWCwrXYqrXIs5DIf8nczNdQBn+5 YVnHgKmNDoBliXKwaGyU0xcM+vKw2O/c6ekM2CJ0ES1FLTHEqTclxLhnOHUFaTp17cY0CH GQGbZDk58Lxv2bKVVgH6/HsF/7Z9aPJsNrC9F1D1DALJj/eWU3+BKqZx/IIs6Izz3Sxyes ZVqlYb+TB5INpsLNyV5P9B/eGlELa5bIqe3ZShWp24W/iqp1p+Mp/60bnsvK3aFFZWFJ/f Lq+vPRZ2nv3iU9COWJnexeM8JlkFevvMdPMvrfUAGTMkf731YuuGPOKlmGswzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851073; a=rsa-sha256; cv=none; b=MPBbfUYQ33iyUgLWzB9OyUjFYcDAUG7uKSDLXcBk69K9KWRkvnnhHYi8XWsvawkvAdEbKC MYSMI/Nzm2dcfsZlsJFrTAYul3gFl3yVY49tB/nT+7j1pjb9rpPXktWm9ihKqPmNAqsn7v 5GEpwZfKeVCjGGqk4PxEARvw0oCaMAPw5U6aXMBVuTfxPBTLgs4inuZgbw/cvD8V3S6Cin ZL5rETMNOw91LIF9ngaXbB4T7Ox/3ezda8Mj9Y3echGF0/iQivF+1/uLGkZHQHsNQaJ4QQ rPTm9D/zwa3OkVlxysGZ3hFbdN0/z5vYp8qYBU5PNrtzZyMKWSD9CbGsrUpZXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ85qTqz1CLS; Tue, 14 Jan 2025 10:37: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 50EAbqio048040; Tue, 14 Jan 2025 10:37:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbqc3048037; Tue, 14 Jan 2025 10:37:52 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:52 GMT Message-Id: <202501141037.50EAbqc3048037@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: 481374d5f7b0 - main - pf: remove pf_remove_fragment() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 481374d5f7b056cd6fbf344238beb70fdae1eabe Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=481374d5f7b056cd6fbf344238beb70fdae1eabe commit 481374d5f7b056cd6fbf344238beb70fdae1eabe Author: Kristof Provost AuthorDate: 2025-01-07 14:46:05 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:18 +0000 pf: remove pf_remove_fragment() Instead of having two functions pf_free_fragment() and pf_remove_fragment() doing more or less the same, merge them into one. Just remove fragment entries from the queue in pf_join_fragment() before they are freed. Then pf_remove_fragment() is not needed anymore. ok henning@ Obtained from: OpenBSD, bluhm , dc8c96a470 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 4adace4c92cf..5b34e825203b 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -130,7 +130,6 @@ static RB_GENERATE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); static void pf_flush_fragments(void); static void pf_free_fragment(struct pf_fragment *); -static void pf_remove_fragment(struct pf_fragment *); static struct pf_frent *pf_create_fragment(u_short *); static int pf_frent_holes(struct pf_frent *frent); @@ -273,7 +272,10 @@ pf_flush_fragments(void) } } -/* Frees the fragments and all associated entries */ +/* + * Remove a fragment from the fragment queue, free its fragment entries, + * and free the fragment itself. + */ static void pf_free_fragment(struct pf_fragment *frag) { @@ -281,16 +283,18 @@ pf_free_fragment(struct pf_fragment *frag) PF_FRAG_ASSERT(); - /* Free all fragments */ - for (frent = TAILQ_FIRST(&frag->fr_queue); frent; - frent = TAILQ_FIRST(&frag->fr_queue)) { + RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); + TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); + + /* Free all fragment entries */ + while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) { TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); m_freem(frent->fe_m); uma_zfree(V_pf_frent_z, frent); } - pf_remove_fragment(frag); + uma_zfree(V_pf_frag_z, frag); } static struct pf_fragment * @@ -708,16 +712,16 @@ static struct mbuf * pf_join_fragment(struct pf_fragment *frag) { struct mbuf *m, *m2; - struct pf_frent *frent, *next; + struct pf_frent *frent; frent = TAILQ_FIRST(&frag->fr_queue); - next = TAILQ_NEXT(frent, fr_next); + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); m = frent->fe_m; m_adj(m, (frent->fe_hdrlen + frent->fe_len) - m->m_pkthdr.len); uma_zfree(V_pf_frent_z, frent); - for (frent = next; frent != NULL; frent = next) { - next = TAILQ_NEXT(frent, fr_next); + while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) { + TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); m2 = frent->fe_m; /* Strip off ip header. */ @@ -730,7 +734,7 @@ pf_join_fragment(struct pf_fragment *frag) } /* Remove from fragment queue. */ - pf_remove_fragment(frag); + pf_free_fragment(frag); return (m); } From nobody Tue Jan 14 10:37:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZC3Wd5z5kVfr; Tue, 14 Jan 2025 10:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZC0gb3z3C6K; Tue, 14 Jan 2025 10:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GjqkS0d5k9ld0eZS/a2Hbitae24LxgV1aeiIyzwRQnE=; b=EUM8ON/03wKWPYxXbB9ZdomOt7ObOHe5W+cUicypoDVo/nWXdCrTYmdflC8cd6UEoZgyd2 2xALHJrZNm1NUIGnoZcQYz/83I8JqrHr8DV5gY+UTRLNWjiyvcEpR22oVbu4V2pApd8jdu UbfDv99tXvPXypl5NwupMuOECattMHlPgw6Stegh4mKyHaWikXSvQr6uUG0hymZHF9HJct Nmg3wuGJi6FstStUjjigdqJgqB4JbwfBZIYS9CnVWYZHLm3rjw5aAik6XRWDle5QJHPho6 JTcbwHBIR9+b7w6iQIJR+p6pOjYFsEd60P5o2F6DMXd2UpatVJ5Up05pRF3IFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GjqkS0d5k9ld0eZS/a2Hbitae24LxgV1aeiIyzwRQnE=; b=r25sWsA0or5UnfoeP8ovxsaNERwDLUoKJjfQdoNOjYojmst7AWn1B4VSBg+o3/n2HQnva0 4PNtHf1t9eiQCFhP9VcuY3fIYsOGkvk1uz50Vczwzs6R3knHBR6x4rFRD5RJixRRjSPMZJ 62QUAsW5xPdZt3AKQrKgXwlJcL4XIyVed2T4yalkKZ41RE54e/obErHezItiB7gQJikfcD a4LV8cofBW6tsrirlvpiMffr15sPT/8HrxkZ9xpGocO900Q9ELFQHmFz7/PyAqygjhFPC8 UgoACiwqwQ7HKHBXx1FUe+qOXactMvgHREQYecZwyE2KBwkbBalOZ+x/nU+sSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851075; a=rsa-sha256; cv=none; b=fMVSyl6VNJuj3wzmgmUtbdaG/uPyy8Y3DyEbgXSSWgnJdLANDKRUViv7VPxZPabkpRaZD5 Xslz3W+XKKgLn8OBkCedpwSSG5sXhPCZLGJHnJRzS0YCmwkgPRVlrz+pVYG5MeR3VDF5Pu epXwr/fiTrlvSZSPpTUwKthYQAu3CT2xRwUjUIsTembS3I6rCF8rGEUUl4kGE8F1TNmVJd y2+ei5pEE4TOgV92FF5mG6YgEAeGxuuvZW2zd1Si1eGlzzKlHelvFlKvj7J7qg7ggpLz69 feNjxZfzsmp0EzHELGzGa9VrK2nLuBOPhIRewA9y8scZ6C+z+nk5Qr3XaDy/Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZC0GRMz1CLT; Tue, 14 Jan 2025 10:37: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 50EAbsQU048154; Tue, 14 Jan 2025 10:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbs1r048151; Tue, 14 Jan 2025 10:37:54 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:54 GMT Message-Id: <202501141037.50EAbs1r048151@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: 6a3266f72e43 - main - pf: drop IPv6 packets built from overlapping fragments in pf reassembly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a3266f72e437aecf3edcfb8aa919466b270d548 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3266f72e437aecf3edcfb8aa919466b270d548 commit 6a3266f72e437aecf3edcfb8aa919466b270d548 Author: Kristof Provost AuthorDate: 2025-01-08 13:34:22 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:19 +0000 pf: drop IPv6 packets built from overlapping fragments in pf reassembly The reassembly state will be dropped after timeout, all related fragments are dropped until that. This is conforming to RFC 5722. - Sort pf_fragment fields while there. - If the fr_queue is empty, we had overlapping fragments, don't add new ones. - If we detect overlapping IPv6 fragments, flush the fr_queue and drop all fragments immediately. - Rearrange debug output, to make clear what happens. - An IPv4 fragment that is totaly overlapped does not inclease the bad fragment counter. - Put an KASSERT into pf_isfull_fragment() to make sure that the fr_queue is never emtpy there. discussed with Fernando Gont; ok henning@ Obtained from: OpenBSD, bluhm , 8b45f36762 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 46 +++++++++++++++++++++++++++++++++++-------- tests/sys/netpfil/pf/frag6.py | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 5b34e825203b..45e56edc34fe 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -98,9 +98,9 @@ struct pf_fragment { RB_ENTRY(pf_fragment) fr_entry; TAILQ_ENTRY(pf_fragment) frag_next; uint32_t fr_timeout; + TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; uint16_t fr_maxlen; /* maximum length of single fragment */ u_int16_t fr_holes; /* number of holes in the queue */ - TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; }; VNET_DEFINE_STATIC(struct mtx, pf_frag_mtx); @@ -593,9 +593,9 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); memset(frag->fr_entries, 0, sizeof(frag->fr_entries)); frag->fr_timeout = time_uptime; + TAILQ_INIT(&frag->fr_queue); frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; - TAILQ_INIT(&frag->fr_queue); RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); @@ -606,7 +606,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); } - KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); + if (TAILQ_EMPTY(&frag->fr_queue)) { + /* + * Overlapping IPv6 fragments have been detected. Do not + * reassemble packet but also drop future fragments. + * This will be done for this ident/src/dst combination + * until fragment queue timeout. + */ + goto drop_fragment; + } /* Remember maximum fragment len for refragmentation. */ if (frent->fe_len > frag->fr_maxlen) @@ -642,10 +650,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) { uint16_t precut; + if (frag->fr_af == AF_INET6) + goto flush_fragentries; + precut = prev->fe_off + prev->fe_len - frent->fe_off; - if (precut >= frent->fe_len) - goto bad_fragment; - DPFPRINTF(("overlap -%d\n", precut)); + if (precut >= frent->fe_len) { + DPFPRINTF(("new frag overlapped\n")); + goto drop_fragment; + } + DPFPRINTF(("frag head overlap %d\n", precut)); m_adj(frent->fe_m, precut); frent->fe_off += precut; frent->fe_len -= precut; @@ -664,7 +677,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, after->fe_len -= aftercut; new_index = pf_frent_index(after); if (old_index != new_index) { - DPFPRINTF(("frag index %d, new %d", + DPFPRINTF(("frag index %d, new %d\n", old_index, new_index)); /* Fragment switched queue as fe_off changed */ after->fe_off -= aftercut; @@ -676,7 +689,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, /* Insert into correct queue */ if (pf_frent_insert(frag, after, prev)) { DPFPRINTF( - ("fragment requeue limit exceeded")); + ("fragment requeue limit exceeded\n")); m_freem(after->fe_m); uma_zfree(V_pf_frent_z, after); /* There is not way to recover */ @@ -687,6 +700,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, } /* This fragment is completely overlapped, lose it. */ + DPFPRINTF(("old frag overlapped\n")); next = TAILQ_NEXT(after, fr_next); pf_frent_remove(frag, after); m_freem(after->fe_m); @@ -701,6 +715,22 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); +flush_fragentries: + /* + * RFC5722: When reassembling an IPv6 datagram, if one or + * more its constituent fragments is determined to be an + * overlapping fragment, the entire datagram (and any constituent + * fragments, including those not yet received) MUST be + * silently discarded. + */ + DPFPRINTF(("flush overlapping fragments\n")); + while ((prev = TAILQ_FIRST(&frag->fr_queue)) != NULL) { + TAILQ_REMOVE(&frag->fr_queue, prev, fr_next); + + m_freem(prev->fe_m); + uma_zfree(V_pf_frent_z, prev); + } + bad_fragment: REASON_SET(reason, PFRES_FRAG); drop_fragment: diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py index 28b1829d418c..f54381fba8cb 100644 --- a/tests/sys/netpfil/pf/frag6.py +++ b/tests/sys/netpfil/pf/frag6.py @@ -58,3 +58,47 @@ class TestFrag6(VnetTestTemplate): timeout=3) for p in packets: assert not p.getlayer(sp.ICMPv6EchoReply) + +class TestFrag6_Overlap(VnetTestTemplate): + REQUIRED_MODULES = ["pf"] + TOPOLOGY = { + "vnet1": {"ifaces": ["if1"]}, + "vnet2": {"ifaces": ["if1"]}, + "if1": {"prefixes6": [("2001:db8::1/64", "2001:db8::2/64")]}, + } + + def vnet2_handler(self, vnet): + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.print_output("/sbin/pfctl -x loud") + ToolsHelper.pf_rules([ + "scrub fragment reassemble", + "pass", + ]) + + @pytest.mark.require_user("root") + def test_overlap(self): + "Ensure we discard packets with overlapping fragments" + + # Import in the correct vnet, so at to not confuse Scapy + import scapy.all as sp + + packet = sp.IPv6(src="2001:db8::1", dst="2001:db8::2") \ + / sp.ICMPv6EchoRequest(data=sp.raw(bytes.fromhex('f00f') * 90)) + frags = sp.fragment6(packet, 128) + assert len(frags) == 3 + + f = frags[0].getlayer(sp.IPv6ExtHdrFragment) + # Fragment with overlap + overlap = sp.IPv6(src="2001:db8::1", dst="2001:db8::2") \ + / sp.IPv6ExtHdrFragment(offset = 4, m = 1, id = f.id, nh = f.nh) \ + / sp.raw(bytes.fromhex('f00f') * 4) + frags = [ frags[0], frags[1], overlap, frags[2] ] + + # Delay the send so the sniffer is running when we transmit. + s = DelayedSend(frags) + + packets = sp.sniff(iface=self.vnet.iface_alias_map["if1"].name, + timeout=3) + for p in packets: + p.show() + assert not p.getlayer(sp.ICMPv6EchoReply) From nobody Tue Jan 14 10:37:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZB5ZdNz5kVqr; Tue, 14 Jan 2025 10:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZB02DCz3ByZ; Tue, 14 Jan 2025 10:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqAtbaEuRCaOFIKZ8BEb+1sKmWWe8bQbhOqoy9ZFkW0=; b=vvIEH9a9xhnhmtC0avHwjk3iTFiNgemJs2r1Sf4zSxLkYjEa7/d9K8QQvy8YrTOSpd0/rI AKHO/Jn74sWRIzCdb8IoLBKuzevPp1b95gB/AhLtysOmd54Xyh7YIEcHygLOTIplYjNv2b 0e1csn41Z7yLFw+ML8yvJmdvGjym3xv1gMqPpOPrAwZ5NLqerRjsVWFFkMNcbudB7ScJdn EwAL3ZsNBxZgEJPSREszL7tAnfRF7ZF/L26SOve8NTbQ3CaVul00yL7OXLFhCUQMWhyPyA gLCEYvCou2wZyJONcszqxtLcgg2qpvqoYCIm1G57ViDcUUCgzS0QFTk2OaJERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqAtbaEuRCaOFIKZ8BEb+1sKmWWe8bQbhOqoy9ZFkW0=; b=WJdEb62CF9J/fX5PxTBnKXU+3TxMr7z/ReG10GQsxK8GLpbkZAJ8xgavxUyeOa1ghlYRgB /iDheskLzBl11mXAfNAVOP7i0Bpkfgp4OI+4vSoADffshxN9n1JAvTmRYs1Ank8T8uaSBf mYZyZIneRXApRaUZ+9O9Ab6zDWOQG0FpraMoUVijnvty8gAwdQ0mIA0jG2Mu82eVk7RnS/ QNYK5N+80mbRI6V3CqAX2hxBm2Wp7c9HrSI316Y7nuCfLk8IN2CqpyB5/6UrCO0nnN20Yn 1s1GVW2eQb9wKLCT7xToatYztapXdbWKWxPwy5tCho10LBTtE6Pt1mqxLgZ7dQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851074; a=rsa-sha256; cv=none; b=Dt6fn1tGIBjAOKHAC1ydjn/jDlRHZVlnhQM4oAaiP1/QuAYlsN2zZ7Oh2HyJjBZkX/Rl0F CBfSTTTWLxvAGjirtCt/WxJVL/Kw2F/g8380C6ocDoGCJ3CIxWxvho2UuQKowIK+46UVVe +6SrSmP0deMyL/4Z3l4fdXlQ6Gdwl1USVDpTtVB4upf5sR7aksRMSvFNRNvX9+xLK3BDGy CTm4M6xcJpJ0HRnKWIS1i+Tz8rxbpkwIy6s1dwCOBy35YcxCC50Xl3sox0NUpFLjcwVrfO CRO19eWQoD/E09LAYauRYM8zlvBeNrC8YP+Vc2jo3ZpnT3SeJ6ZfRMKuxUJy6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZ96cwrz1Brh; Tue, 14 Jan 2025 10:37: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 50EAbrEx048094; Tue, 14 Jan 2025 10:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbram048092; Tue, 14 Jan 2025 10:37:53 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:53 GMT Message-Id: <202501141037.50EAbram048092@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: b6a5e2213938 - main - pf.conf.5: make "self" a bit more visible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6a5e221393826d7dc89060c6b52c78ed1f0d313 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b6a5e221393826d7dc89060c6b52c78ed1f0d313 commit b6a5e221393826d7dc89060c6b52c78ed1f0d313 Author: Kristof Provost AuthorDate: 2025-01-07 14:48:43 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:19 +0000 pf.conf.5: make "self" a bit more visible from Sebastian Benoit , ok/input jmc, reminder/input deraadt and too much of a trail to mention all of it, thx everybody involved Obtained from: OpenBSD, henning , 682c71ec7c Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 138fb5e7f82b..6229a49eccc1 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 December 6, 2024 +.Dd January 7, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -1809,6 +1809,8 @@ Any address which is not currently routable. Any source address that fails a unicast reverse path forwarding (URPF) check, i.e. packets coming in on an interface other than that which holds the route back to the packet's source address. +.It Ar self +Expands to all addresses assigned to all interfaces. .It Aq Ar table Any address that matches the given table. .El @@ -1821,7 +1823,9 @@ For instance: means all addresses from 10.1.1.10 to 10.1.1.12, hence addresses 10.1.1.10, 10.1.1.11, and 10.1.1.12. .Pp -Interface names and interface group names can have modifiers appended: +Interface names and interface group names, and +.Ar self +can have modifiers appended: .Pp .Bl -tag -width xxxxxxxxxxxx -compact .It Ar :network From nobody Tue Jan 14 10:37:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZF75Zwz5kVnc; Tue, 14 Jan 2025 10:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZF2G07z3C6k; Tue, 14 Jan 2025 10:37:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaHNjP1EO0ykkgcPKgKxqjLtYYx9brvputcoYcWvYKk=; b=cQUSelE+4ocDIPN5a45RMp+49Tb+bNMwyuGKxMdspL3cQ9Sdw1FpyufvL0TPpJYzcDCt0A GRkGesxagIKPpCjL6f8cuQS7e3MlnzQtqamn8kcK0ypDgfWCdybzxGDqNs5Tf+GYvVfvQX oiRuTPaHXQ7e/tkO7jBTt4OjBv2RYVYFK0qoPWxThslmJuMl2Hoh8D/lUUgh0JmI4NOAAc Gv1fisghGYvvhnl/ZwCYfQquZmafqe72D1KabBBfwuRUEpPw5613nBTxVOZ2bKhpJU7VpM Bs96KNQwD3HX169TuZHe54mhmGF9EGgkwNjGsXT6ZKxJSCEWuklQk4q2/A5UCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaHNjP1EO0ykkgcPKgKxqjLtYYx9brvputcoYcWvYKk=; b=j9CNCBMtYgXgT27AHM/eo6ZD282Bdp0t+reoZs3f3qQSAs/Sd6NLeeYrmREl0jlWQ7ATqU 2EHH8+qQkWBkysFIdQdfJYhnJPRrvGIL0oYpnFlIb/hOklSf98GsLWKf5F1o9TWtQdH0Q/ JMwrPnKtUMG9YLSJ3imfk9yvA/lRJbGXi1LJK3l921gJd90vDocD8C/K+yp+Buv1Btjz69 PhW2JuWzczJJaQzxg7241pxDCuRsFIBWR1Ex9P9sFPhpmcmaizL0HrWyP9RT86uO8r1sOd Hi1VSKO9yg+oKHKwko2WWg1gR1xqO46ygvbQCIeBvNeZQuKvo49lFDF7YRe+Yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851077; a=rsa-sha256; cv=none; b=pQixcDVN++xDs2YkCYqZj0nPYo2dap/kxi5BHNq0XIdzt3i+zb4LXLAxIons41MM56h5at 1Pnv+kfvR4eTHQeMTc9aLPM0QxfD5dygCVlHamQ8X6qByyg7+a61Wmzl87sX4+AEaK31BI k0sKkOhf7oA60IFm/3aRml3T0aNF0jbUAUHn69RF6avEUnKUpvsX+9MmTA62oaoHyUDNal kffjV1WVjWZLv3k3BSVbVUajAQ5Zi10BFeFXkIg2yWGE0stqxxJGna8V2ND1Dg84BxV0ij 01aLYTCRsAkNoxc2u0j3/FKTAmNkGPQ3GnhQT08waCK+cdDMItTAcWzMzlfO6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZF1rM1z1CHl; Tue, 14 Jan 2025 10:37: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 50EAbvIt048246; Tue, 14 Jan 2025 10:37:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbv0Z048243; Tue, 14 Jan 2025 10:37:57 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:57 GMT Message-Id: <202501141037.50EAbv0Z048243@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: 0300b49ac821 - main - pf.conf.5: fix description for tcp.opening timeout List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0300b49ac821f6b7e273fb936fa50aefbddb5129 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0300b49ac821f6b7e273fb936fa50aefbddb5129 commit 0300b49ac821f6b7e273fb936fa50aefbddb5129 Author: Kristof Provost AuthorDate: 2025-01-09 09:39:01 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:19 +0000 pf.conf.5: fix description for tcp.opening timeout Issue reported by Felix Rust; ok jmc@ Obtained from: OpenBSD, bluhm , 9278cfc6cf Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 6229a49eccc1..7e2c96c07473 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 January 7, 2025 +.Dd January 9, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -265,7 +265,8 @@ firewall at the risk of dropping valid idle connections. .It Ar tcp.first The state after the first packet. .It Ar tcp.opening -The state before the destination host ever sends a packet. +The state after the second packet but before both endpoints have +acknowledged the connection. .It Ar tcp.established The fully established state. .It Ar tcp.closing From nobody Tue Jan 14 10:37:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZD400Kz5kVnV; Tue, 14 Jan 2025 10:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZD1sfpz3Bx2; Tue, 14 Jan 2025 10:37:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KAYi/LY3R8BwPUX8ECpAdeFWmpzzFTRnrVSiUE6Ty4M=; b=WC2TdDBdP17JQvNSaJ+2msMZAcrbmvb3abE2ovZ31huL0qtfilQm6znI6848P+iNps0wSW gRl+mkIa1NFBaTHXrtfT+a9yUsQ6bxfmMgCJ5PaFmvrZpQrMzK/iLUNrfQyEbwkLBVMOp/ UkQ1pmbCjuTz7OA4QabL9aEsqrl2DaHPbVE4bbvXvjBbw+YMK8xzIpGk5guwkHovHUbSqy 0BNewmqJHes/mMHrnwMcCaGjEBk83YlUpaat0qYsqAb+iHFwG+Mn8jZcxN8VvNhBi1Jnp9 4FJKC0ejOwHlMQR5T2MkM8t94WqbrvwnCWjy0YqvuKhhnk2JJw5VJ9e8LlI9+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KAYi/LY3R8BwPUX8ECpAdeFWmpzzFTRnrVSiUE6Ty4M=; b=M9fQtgRoOJBdp4tBCRpK4zYEcfKh8MhkIkvkmJfA71sV3yLgNI2dk9K9LCmRm10BsIr6D4 5bVtN8MrX4ZQ8prSoT+FAR76ioMH5siXG73k1kDbnfIKzE425hVqE0GVyZ+HQuA0SLEzxk yNWy+z+C7gPfvv0NKE3PPskQwwPzuGR9YGfCLWP2CveKWjDcibk/PCLxvpPPaj7PhpFZp3 ZDbia4AB/cs/ECCCqsBJtXGajxomkQvaAETBZfg/JIfgZj1VhEmNgvUou3Mn1eWzGmfgEb lSbfFc9++R5mAywEZBlvw68TfPNX4M8pJRxXrf/ZS8/cqiovfK4AYCqn05urAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851076; a=rsa-sha256; cv=none; b=o15H4Wcgk9JrnVlJqOc/+C1gMa/q+0osw8bXtGLsJbP+4ZpEX5Pxw7qX3FpYfszzHqqBs+ v+YosavMyPsZ+/hq2btokwcUT6ljTPS4wHo0pMj5mrVkWhBQyTLqk3aw/H9m8cQ2kHfkDV HIKlX02atVMYUcPJPqdsPeZApLjuNeU0fBm8Ua1K9Cg/Q5RNSsYy697atcMTG2eII4ca1c bUt4Fu1i5iGSZAQ9DKHy3R/qBP27we7PV/tD+Ira831rBdeXdgcdNfMuLWRdl7bt8EIwU0 qw2tmwge091tLgoGZWlOCkdJVdB9zNT8U8X/hjHibtGmBv+W9f2+uyKVwQ3uhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZD1Dxqz1BqT; Tue, 14 Jan 2025 10:37: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 50EAbug7048199; Tue, 14 Jan 2025 10:37:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbuZj048196; Tue, 14 Jan 2025 10:37:56 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:56 GMT Message-Id: <202501141037.50EAbuZj048196@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: a8136ab47c97 - main - pfctl: convert an snprintf to strlcpy List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8136ab47c97d470b39246b53a64ebbe76f5413f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a8136ab47c97d470b39246b53a64ebbe76f5413f commit a8136ab47c97d470b39246b53a64ebbe76f5413f Author: Kristof Provost AuthorDate: 2025-01-09 09:23:23 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:19 +0000 pfctl: convert an snprintf to strlcpy ok mikeb henning Obtained from: OpenBSD, dhill , a592d7cf61 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 4b2a69f456a2..ca374ca3295d 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1234,7 +1234,7 @@ pfctl_show_rules(int dev, char *path, int opts, enum pfctl_show format, if (anchorname[0] == '/') { if ((npath = calloc(1, MAXPATHLEN)) == NULL) errx(1, "pfctl_rules: calloc"); - snprintf(npath, MAXPATHLEN, "%s", anchorname); + strlcpy(npath, anchorname, MAXPATHLEN); } else { if (path[0]) snprintf(&path[len], MAXPATHLEN - len, "/%s", anchorname); From nobody Tue Jan 14 10:37:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZJ2zKGz5kVNF; Tue, 14 Jan 2025 10:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZH4G2zz3BxZ; Tue, 14 Jan 2025 10:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2zeX2ajslPsJk2/IHwO9J/r8ELFeEtSY+ZDAPsW+EM=; b=bIr+YUQcDrP2+fxs1sHy7/LWCUvP1IhUrGW9+0a/5CRvrvN+ON8b5RDWEixHMXzdV35kTa 9rSejGrYaj/jj07pZOZTA48VbnqEb0Qk56nqZKsqwlrozh9PdN0wdb5Xfh0lDxrCC61QFJ HPPBy2mfpF02G2kZhx2JB2Jsh1BKfwjHDK/VaekQ16D3BeLSgCQRMBoiCCfFQWHzK1Htc2 bzf2vdmKC+6jVutzQ8E/HiU2jAfANPlcUsB/XZpNh0JiN7wIv2Mzk3N/OhC/wtCLnhOU80 NLL+tFmmqz1w51sVRU0QIkPMza8ZFkI0def2MVzy9COHyHqYuCsGHMjGop4Mpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l2zeX2ajslPsJk2/IHwO9J/r8ELFeEtSY+ZDAPsW+EM=; b=g2bL8nHrXwW+LFZwd3Jpu/prNe8vjeLdC7dAo7LG7LHyW01NAHt+CpBxf6bYrfSAMSnhw4 +ooYjTNxFMGvZS0bg+cLSodqhfDFhRcVQ0maDlJ6WxH7J3llO/aigIwlF3yV+MZ4Jd0gdH 38jLiRLfuwP1wRSCFo6tH/r3shQnFR8cOOGZbvvfWpxLFl9HPrGrf8hTmpCRrSfiiD+Nla Tr08SKBaqoNg92M2/ZNtuzW8FoUCQS4+VcLAtGx7WC7fbCDlpOchYdT4YHs0k2tlGyN1wB sfrLXrGaDweL9YWTlNBpCk5lcZhI9G4QAFkH4Ll/NaZKHtRVzjRGj63PtJZ5gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851079; a=rsa-sha256; cv=none; b=cnXzP95XIcWwGUFrOPBhiv+HvgFtttD7JKAoH3ajfMUlDZcWmOrFYwBPAAsKI41eB5FDfP Z0TJVJL8DvPD/k5tW2QkmYXETK8/cZlr3XIhJUjb5crXpl+IgiFyE9Qntmd+3mciPuAuOO bKqjQ7aBtzOqyi0w65eHS2O092/T9+Ncj1ajh6sOO1eme3wptXxI+c3Vap82joNPNAuCRh tXqBpkdzNpqpC12VgoZ3WZpKZsKFr5tYewsxPPanhMTF5d5j52BQ3nXmZvuBeJILw8yoji gj/Vnyv1Xrq7964C6L2R/pI2gwutWiapbmm6B26yJhXLkaIZJ3zah+PxvETBKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZH3sSXz1C6W; Tue, 14 Jan 2025 10:37: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 50EAbxjZ048360; Tue, 14 Jan 2025 10:37:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbxUL048357; Tue, 14 Jan 2025 10:37:59 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:59 GMT Message-Id: <202501141037.50EAbxUL048357@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: 3b79f6d2d394 - main - pf: do not keep state when dropping overlapping IPv6 fragments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b79f6d2d39405bcac395dc036ceb6f8fd09ce99 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3b79f6d2d39405bcac395dc036ceb6f8fd09ce99 commit 3b79f6d2d39405bcac395dc036ceb6f8fd09ce99 Author: Kristof Provost AuthorDate: 2025-01-09 13:11:11 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:20 +0000 pf: do not keep state when dropping overlapping IPv6 fragments ok sperreault@ Obtained from: OpenBSD, bluhm , cd45765685 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 45e56edc34fe..9f1eaf7c4d76 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -606,15 +606,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); } - if (TAILQ_EMPTY(&frag->fr_queue)) { - /* - * Overlapping IPv6 fragments have been detected. Do not - * reassemble packet but also drop future fragments. - * This will be done for this ident/src/dst combination - * until fragment queue timeout. - */ - goto drop_fragment; - } + KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); /* Remember maximum fragment len for refragmentation. */ if (frent->fe_len > frag->fr_maxlen) @@ -651,7 +643,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, uint16_t precut; if (frag->fr_af == AF_INET6) - goto flush_fragentries; + goto free_fragment; precut = prev->fe_off + prev->fe_len - frent->fe_off; if (precut >= frent->fe_len) { @@ -715,21 +707,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); -flush_fragentries: +free_fragment: /* - * RFC5722: When reassembling an IPv6 datagram, if one or - * more its constituent fragments is determined to be an - * overlapping fragment, the entire datagram (and any constituent - * fragments, including those not yet received) MUST be - * silently discarded. + * RFC 5722, Errata 3089: When reassembling an IPv6 datagram, if one + * or more its constituent fragments is determined to be an overlapping + * fragment, the entire datagram (and any constituent fragments) MUST + * be silently discarded. */ DPFPRINTF(("flush overlapping fragments\n")); - while ((prev = TAILQ_FIRST(&frag->fr_queue)) != NULL) { - TAILQ_REMOVE(&frag->fr_queue, prev, fr_next); - - m_freem(prev->fe_m); - uma_zfree(V_pf_frent_z, prev); - } + pf_free_fragment(frag); bad_fragment: REASON_SET(reason, PFRES_FRAG); From nobody Tue Jan 14 10:38:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZL44ccz5kVck; Tue, 14 Jan 2025 10:38:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZK6hSnz3Brc; Tue, 14 Jan 2025 10:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1dzz0sw2k5+YrCMEkrz6QPKgKVoup/g0ySasA71BpNI=; b=s3tHRszGUyzbashVbxwjzIHKQEK8MEEdTxKyKT6xx9gfShxJjAExkDWRV5RQ6Vrlb85AyM bOpn2BuhaTzQFKi9BkgMk+ev02F35iNXhkOkr6egcrikyw8ixcW6Hga5QCPaUjWUlfCcao KZjMBPqF4Z9t2pP++QumdTVrshbv7ownlz+HB8ImzLtNqh8Fu+naOCexjBkaKOEUvXIQXR YeuIUAHn4ypxBNY1DSqOpXKabZciaMz3lXp7D9w7q4LdXoNXVWe29/t1YmQdor9f1wgG8k ap0MY2CPBoEZmxKLLr9VSJSjXl2jOA6nrHAauE44oTsTMg+yeXUzSihdpbjS1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1dzz0sw2k5+YrCMEkrz6QPKgKVoup/g0ySasA71BpNI=; b=leeiYsJkKr1K+F2Tt7OWPceNn+7t5b2wiZQjcUv+auV6HHpE9jy5s7rUijnEGl32pNBxRy YwFITuh/Sq4m9id6/YfHbCr3gdyoNut6FXBsiYVDI5n6aYPrvUhhHsl8THlyGFghbU+q0+ otUE3h2UILbQ4bh8a8vYO7PfzDINWru9UnStXpnIhXDFc84FMuZOqnLSJOA1M/i7uPzKhE yS26XFegAZ8i5NokVLtMzWXi5ZJZ2O+1UpExmfqL5NNru+DlVjoAExv831HND1Gy9MjVDD gEyX9y14SDJ5zyOdfmMIJ01RZd1SISG1Hd5NgxM86fQEEzswd68TrGRIuXNjYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851082; a=rsa-sha256; cv=none; b=hBnY4H3guGZY7gAEkxlA1AU8KBOBJzcbpViZDBxDOhJQM14EFbi+YhCI3xmDggn2UytqeG iPzjZCaYiw5ZTUviTxzKWY8FElphKaNbWtZE5NUShMSqBv6ic3llqpwh0YB/jxUykqNnB3 RabYYnDG3uTbocr6M09KtB87tzm7llp6ZaBLZyQxZmBqgcAhu3Y4kisyZRZU9NUHQqBwHM uHih4bemR+WtOznx0zyZBSJyux/1eoxqroncn0B9rAyEGSkwe5NUHzDSLKZg/qKX9is8Xj ELZ1lbodoGk4t9egBM/4C75kbJi95lzmnbgZ9l0U9Ds3RaAqlyLG+qUO4Jkkvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZK65y2z1C6X; Tue, 14 Jan 2025 10:38: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 50EAc1cA048462; Tue, 14 Jan 2025 10:38:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAc1ui048459; Tue, 14 Jan 2025 10:38:01 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:38:01 GMT Message-Id: <202501141038.50EAc1ui048459@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: 5466aca1536e - main - pf: minor fixes for pf_walk_header6() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5466aca1536e45b2d327ff9ae232700ea01f30e8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5466aca1536e45b2d327ff9ae232700ea01f30e8 commit 5466aca1536e45b2d327ff9ae232700ea01f30e8 Author: Kristof Provost AuthorDate: 2025-01-09 13:39:20 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:20 +0000 pf: minor fixes for pf_walk_header6() - Fragment offset is in network byte order. - Check for legal short fragments before calling pf_pull_hdr() to avoid bogus reason accounting. - When checking wether the protocol header is within the fragment, count the IPv6 payload length relative to the end of the IPv6 header. ok henning@ Obtained from: OpenBSD, bluhm , 3230e62590 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 11b6be239ca7..053b0b2ccb31 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9720,9 +9720,11 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) struct ip6_frag frag; struct ip6_ext ext; struct ip6_rthdr rthdr; + uint32_t end; int rthdr_cnt = 0; pd->off += sizeof(struct ip6_hdr); + end = pd->off + ntohs(h->ip6_plen); pd->fragoff = pd->extoff = pd->jumbolen = 0; pd->proto = h->ip6_nxt; for (;;) { @@ -9746,7 +9748,7 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) } pd->fragoff = pd->off; /* stop walking over non initial fragments */ - if ((frag.ip6f_offlg & IP6F_OFF_MASK) != 0) + if (htons((frag.ip6f_offlg & IP6F_OFF_MASK)) != 0) return (PF_PASS); pd->off += sizeof(frag); pd->proto = frag.ip6f_nxt; @@ -9757,14 +9759,14 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); } + /* fragments may be short */ + if (pd->fragoff != 0 && end < pd->off + sizeof(rthdr)) { + pd->off = pd->fragoff; + pd->proto = IPPROTO_FRAGMENT; + return (PF_PASS); + } if (!pf_pull_hdr(pd->m, pd->off, &rthdr, sizeof(rthdr), NULL, reason, AF_INET6)) { - /* fragments may be short */ - if (pd->fragoff != 0) { - pd->off = pd->fragoff; - pd->proto = IPPROTO_FRAGMENT; - return (PF_PASS); - } DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short rthdr")); return (PF_DROP); } @@ -9779,15 +9781,15 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) case IPPROTO_DSTOPTS: if (!pf_pull_hdr(pd->m, pd->off, &ext, sizeof(ext), NULL, reason, AF_INET6)) { - /* fragments may be short */ - if (pd->fragoff != 0) { - pd->off = pd->fragoff; - pd->proto = IPPROTO_FRAGMENT; - return (PF_PASS); - } DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short exthdr")); return (PF_DROP); } + /* fragments may be short */ + if (pd->fragoff != 0 && end < pd->off + sizeof(ext)) { + pd->off = pd->fragoff; + pd->proto = IPPROTO_FRAGMENT; + return (PF_PASS); + } /* reassembly needs the ext header before the frag */ if (pd->fragoff == 0) pd->extoff = pd->off; @@ -9815,7 +9817,7 @@ pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) case IPPROTO_SCTP: case IPPROTO_ICMPV6: /* fragments may be short, ignore inner header then */ - if (pd->fragoff != 0 && ntohs(h->ip6_plen) < pd->off + + if (pd->fragoff != 0 && end < pd->off + (pd->proto == IPPROTO_TCP ? sizeof(struct tcphdr) : pd->proto == IPPROTO_UDP ? sizeof(struct udphdr) : pd->proto == IPPROTO_SCTP ? sizeof(struct sctphdr) : From nobody Tue Jan 14 10:37:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZG6MGTz5kVwQ; Tue, 14 Jan 2025 10:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZG3W3sz3BxT; Tue, 14 Jan 2025 10:37:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Bn2vp0JSlxc7a2s0LeB+YIckHkJo5q6KffkzwZ60r4=; b=YeiO6aXOGsCdZaumlsbxqcwzxFaQddrcnL6c0l/QJGF3O1tmN+U50UVEw3muq2SH3cE5X+ 4mp2+IvOuPmkl8Xo/xBg0/h2OpEO2ryYkkJ20xzKhUsoRMoMtUnU6rUePXcRZ9eUsnUrFB Y/X6IFUkCdmcj8pC4i76ysNfYW0wYFGDxwZv7GnJoYMQ4f87Be2qoNLVerkF8lg9+dSl9N +Ns9ieHeh7Cls64dvQJn7M5uuSYjv1+vjnTojWIOlHkNnTO/+2jrJkvk1opcjPjJ1FcUdT 54HT7OTBnNariJHV0rlXNkv8VMJ87bgcRqnJ6BV4K1Vg2t+97nB8PeDE3QDe3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Bn2vp0JSlxc7a2s0LeB+YIckHkJo5q6KffkzwZ60r4=; b=ZcqNvaV/VfY+wRxn9r8p8EyAEXXPQelbibGU7o7zAp28aYlwgD+Uu78RteIb9rHV97G2Pj k9UOPOuM59b+AflZER5ZXnz+n+kWKcs9fImDAJhXqk/gjUyZQIhFMgs9JxaApfgN1n9xwB lYXcLP7mRgtryMwhpB0mRIWnh10XvbDwAp89EZ1ZV2GmcMyHsMIkdt9gdaFz+Nk/y3zYK5 Y4Ux/0bRN0X0YMxWq2R8GcuR5UYOxDJrZpk6mWILpqHqzJRKC4wsTxqA0hmIAsbS7nOXHc 7FEXtcR31KYgxR6pf88TKMC1jl+YyLDaycYQ0r+m5tyDuJndPWnBca82n+zFfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851078; a=rsa-sha256; cv=none; b=ipXmLXFBKnwaP6WSsD4mLtqEBCXht1M041QjPEGdZ7oG7aWVi2cK+7V68mcR3xNYIbXrHg v7nwBkmpz9Jbh1cTefDQ77b48e9mo7KhVs/S1AOMHVYZOZiuNzOS6mlJb6pZJXg2Z+oaDI Lr9t6BK4f3KBd1gVhIXqXsqYTS4FTLe5kcUJM+jcUrpt8N9+XjFDD0jhsWRRSnSpGDKtYf PW7H5YZ7QRcIIX/NmPEugRKkKThI01pF7FbioK2QFlTzZ7quR3jqqI1jcX5EvOHOE7jR3C RpJIwET2tm0etsrhzMXW9elwqw+5hqu3RsAlC9INabZkEWaBvLGhrOUvZW3kjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZG36s1z1C6V; Tue, 14 Jan 2025 10:37: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 50EAbwst048297; Tue, 14 Jan 2025 10:37:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAbwBp048294; Tue, 14 Jan 2025 10:37:58 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:37:58 GMT Message-Id: <202501141037.50EAbwBp048294@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: 1941d370bf89 - main - pf: pass struct pf_pdesc to pf_walk_option6() and pf_walk_header6() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1941d370bf89ea9a1c3aab5ce33e04d6ba0f635d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1941d370bf89ea9a1c3aab5ce33e04d6ba0f635d commit 1941d370bf89ea9a1c3aab5ce33e04d6ba0f635d Author: Kristof Provost AuthorDate: 2025-01-09 11:02:39 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:19 +0000 pf: pass struct pf_pdesc to pf_walk_option6() and pf_walk_header6() This makes their argument list shorter. Also fix a bug where pf_walk_option6() used the outer header in the pd2 case. ok henning@ mikeb@ Obtained from: OpenBSD, bluhm , dfff4707a1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 6 +-- sys/netpfil/pf/pf.c | 143 +++++++++++++++++++++++++--------------------------- 2 files changed, 72 insertions(+), 77 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3432f8dc99e1..3f109d31ccde 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1626,6 +1626,9 @@ struct pf_pdesc { u_int32_t off; /* protocol header offset */ u_int32_t hdrlen; /* protocol header length */ u_int32_t p_len; /* total length of protocol payload */ + u_int32_t extoff; /* extentsion header offset */ + u_int32_t fragoff; /* fragment header offset */ + u_int32_t jumbolen; /* length from v6 jumbo header */ u_int32_t badopts; /* v4 options or v6 routing headers */ u_int16_t *ip_sum; @@ -1634,7 +1637,6 @@ struct pf_pdesc { #define PFDESC_TCP_NORM 0x0001 /* TCP shall be statefully scrubbed */ u_int16_t virtual_proto; #define PF_VPROTO_FRAGMENT 256 - int extoff; sa_family_t af; sa_family_t naf; u_int8_t proto; @@ -2391,8 +2393,6 @@ int pf_normalize_ip(struct mbuf **, u_short *, struct pf_pdesc *); #endif /* INET */ #ifdef INET6 -int pf_walk_header6(struct mbuf *, struct ip6_hdr *, int *, int *, int *, - uint8_t *, uint32_t *, u_short *); int pf_normalize_ip6(struct mbuf **, int, u_short *, struct pf_pdesc *); void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, sa_family_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 3d1ba8e8deb4..11b6be239ca7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -367,7 +367,9 @@ static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, int, u_int16_t); static int pf_check_proto_cksum(struct mbuf *, int, int, u_int8_t, sa_family_t); -static int pf_walk_option6(struct mbuf *, int, int, uint32_t *, +static int pf_walk_option6(struct pf_pdesc *, struct ip6_hdr *, + int, int, u_short *); +static int pf_walk_header6(struct pf_pdesc *, struct ip6_hdr *, u_short *); static void pf_print_state_parts(struct pf_kstate *, struct pf_state_key *, struct pf_state_key *); @@ -7850,8 +7852,6 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, #endif /* INET */ #ifdef INET6 struct ip6_hdr h2_6; - int fragoff2, extoff2; - u_int32_t jumbolen; #endif /* INET6 */ int ipoff2 = 0; @@ -7904,9 +7904,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, return (PF_DROP); } pd2.off = ipoff2; - if (pf_walk_header6(pd->m, &h2_6, &pd2.off, &extoff2, - &fragoff2, &pd2.proto, &jumbolen, - reason) != PF_PASS) + if (pf_walk_header6(&pd2, &h2_6, reason) != PF_PASS) return (PF_DROP); pd2.src = (struct pf_addr *)&h2_6.ip6_src; @@ -9655,16 +9653,15 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s, #ifdef INET6 static int -pf_walk_option6(struct mbuf *m, int off, int end, uint32_t *jumbolen, +pf_walk_option6(struct pf_pdesc *pd, struct ip6_hdr *h, int off, int end, u_short *reason) { struct ip6_opt opt; struct ip6_opt_jumbo jumbo; - struct ip6_hdr *h = mtod(m, struct ip6_hdr *); while (off < end) { - if (!pf_pull_hdr(m, off, &opt.ip6o_type, sizeof(opt.ip6o_type), - NULL, reason, AF_INET6)) { + if (!pf_pull_hdr(pd->m, off, &opt.ip6o_type, + sizeof(opt.ip6o_type), NULL, reason, AF_INET6)) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short opt type")); return (PF_DROP); } @@ -9672,8 +9669,8 @@ pf_walk_option6(struct mbuf *m, int off, int end, uint32_t *jumbolen, off++; continue; } - if (!pf_pull_hdr(m, off, &opt, sizeof(opt), NULL, reason, - AF_INET6)) { + if (!pf_pull_hdr(pd->m, off, &opt, sizeof(opt), NULL, + reason, AF_INET6)) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short opt")); return (PF_DROP); } @@ -9684,7 +9681,7 @@ pf_walk_option6(struct mbuf *m, int off, int end, uint32_t *jumbolen, } switch (opt.ip6o_type) { case IP6OPT_JUMBO: - if (*jumbolen != 0) { + if (pd->jumbolen != 0) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 multiple jumbo")); REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); @@ -9694,15 +9691,15 @@ pf_walk_option6(struct mbuf *m, int off, int end, uint32_t *jumbolen, REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); } - if (!pf_pull_hdr(m, off, &jumbo, sizeof(jumbo), NULL, + if (!pf_pull_hdr(pd->m, off, &jumbo, sizeof(jumbo), NULL, reason, AF_INET6)) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short jumbo")); return (PF_DROP); } - memcpy(jumbolen, jumbo.ip6oj_jumbo_len, - sizeof(*jumbolen)); - *jumbolen = ntohl(*jumbolen); - if (*jumbolen < IPV6_MAXPACKET) { + memcpy(&pd->jumbolen, jumbo.ip6oj_jumbo_len, + sizeof(pd->jumbolen)); + pd->jumbolen = ntohl(pd->jumbolen); + if (pd->jumbolen < IPV6_MAXPACKET) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short jumbolen")); REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); @@ -9718,43 +9715,41 @@ pf_walk_option6(struct mbuf *m, int off, int end, uint32_t *jumbolen, } int -pf_walk_header6(struct mbuf *m, struct ip6_hdr *h, int *off, int *extoff, - int *fragoff, uint8_t *nxt, uint32_t *jumbolen, u_short *reason) +pf_walk_header6(struct pf_pdesc *pd, struct ip6_hdr *h, u_short *reason) { struct ip6_frag frag; struct ip6_ext ext; struct ip6_rthdr rthdr; int rthdr_cnt = 0; - *off += sizeof(struct ip6_hdr); - *extoff = *fragoff = 0; - *nxt = h->ip6_nxt; - *jumbolen = 0; + pd->off += sizeof(struct ip6_hdr); + pd->fragoff = pd->extoff = pd->jumbolen = 0; + pd->proto = h->ip6_nxt; for (;;) { - switch (*nxt) { + switch (pd->proto) { case IPPROTO_FRAGMENT: - if (*fragoff != 0) { + if (pd->fragoff != 0) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 multiple fragment")); REASON_SET(reason, PFRES_FRAG); return (PF_DROP); } /* jumbo payload packets cannot be fragmented */ - if (*jumbolen != 0) { + if (pd->jumbolen != 0) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 fragmented jumbo")); REASON_SET(reason, PFRES_FRAG); return (PF_DROP); } - if (!pf_pull_hdr(m, *off, &frag, sizeof(frag), NULL, - reason, AF_INET6)) { + if (!pf_pull_hdr(pd->m, pd->off, &frag, sizeof(frag), + NULL, reason, AF_INET6)) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short fragment")); return (PF_DROP); } - *fragoff = *off; + pd->fragoff = pd->off; /* stop walking over non initial fragments */ if ((frag.ip6f_offlg & IP6F_OFF_MASK) != 0) return (PF_PASS); - *off += sizeof(frag); - *nxt = frag.ip6f_nxt; + pd->off += sizeof(frag); + pd->proto = frag.ip6f_nxt; break; case IPPROTO_ROUTING: if (rthdr_cnt++) { @@ -9762,12 +9757,12 @@ pf_walk_header6(struct mbuf *m, struct ip6_hdr *h, int *off, int *extoff, REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); } - if (!pf_pull_hdr(m, *off, &rthdr, sizeof(rthdr), NULL, - reason, AF_INET6)) { + if (!pf_pull_hdr(pd->m, pd->off, &rthdr, sizeof(rthdr), + NULL, reason, AF_INET6)) { /* fragments may be short */ - if (*fragoff != 0) { - *off = *fragoff; - *nxt = IPPROTO_FRAGMENT; + if (pd->fragoff != 0) { + pd->off = pd->fragoff; + pd->proto = IPPROTO_FRAGMENT; return (PF_PASS); } DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short rthdr")); @@ -9782,50 +9777,51 @@ pf_walk_header6(struct mbuf *m, struct ip6_hdr *h, int *off, int *extoff, case IPPROTO_AH: case IPPROTO_HOPOPTS: case IPPROTO_DSTOPTS: - if (!pf_pull_hdr(m, *off, &ext, sizeof(ext), NULL, - reason, AF_INET6)) { + if (!pf_pull_hdr(pd->m, pd->off, &ext, sizeof(ext), + NULL, reason, AF_INET6)) { /* fragments may be short */ - if (*fragoff != 0) { - *off = *fragoff; - *nxt = IPPROTO_FRAGMENT; + if (pd->fragoff != 0) { + pd->off = pd->fragoff; + pd->proto = IPPROTO_FRAGMENT; return (PF_PASS); } DPFPRINTF(PF_DEBUG_MISC, ("IPv6 short exthdr")); return (PF_DROP); } /* reassembly needs the ext header before the frag */ - if (*fragoff == 0) - *extoff = *off; - if (*nxt == IPPROTO_HOPOPTS && *fragoff == 0) { - if (pf_walk_option6(m, *off + sizeof(ext), - *off + (ext.ip6e_len + 1) * 8, jumbolen, - reason) != PF_PASS) + if (pd->fragoff == 0) + pd->extoff = pd->off; + if (pd->proto == IPPROTO_HOPOPTS && pd->fragoff == 0) { + if (pf_walk_option6(pd, h, + pd->off + sizeof(ext), + pd->off + (ext.ip6e_len + 1) * 8, reason) + != PF_PASS) return (PF_DROP); - if (ntohs(h->ip6_plen) == 0 && *jumbolen != 0) { + if (ntohs(h->ip6_plen) == 0 && pd->jumbolen != 0) { DPFPRINTF(PF_DEBUG_MISC, ("IPv6 missing jumbo")); REASON_SET(reason, PFRES_IPOPTIONS); return (PF_DROP); } } - if (*nxt == IPPROTO_AH) - *off += (ext.ip6e_len + 2) * 4; + if (pd->proto == IPPROTO_AH) + pd->off += (ext.ip6e_len + 2) * 4; else - *off += (ext.ip6e_len + 1) * 8; - *nxt = ext.ip6e_nxt; + pd->off += (ext.ip6e_len + 1) * 8; + pd->proto = ext.ip6e_nxt; break; case IPPROTO_TCP: case IPPROTO_UDP: case IPPROTO_SCTP: case IPPROTO_ICMPV6: /* fragments may be short, ignore inner header then */ - if (*fragoff != 0 && ntohs(h->ip6_plen) < *off + - (*nxt == IPPROTO_TCP ? sizeof(struct tcphdr) : - *nxt == IPPROTO_UDP ? sizeof(struct udphdr) : - *nxt == IPPROTO_SCTP ? sizeof(struct sctphdr) : + if (pd->fragoff != 0 && ntohs(h->ip6_plen) < pd->off + + (pd->proto == IPPROTO_TCP ? sizeof(struct tcphdr) : + pd->proto == IPPROTO_UDP ? sizeof(struct udphdr) : + pd->proto == IPPROTO_SCTP ? sizeof(struct sctphdr) : sizeof(struct icmp6_hdr))) { - *off = *fragoff; - *nxt = IPPROTO_FRAGMENT; + pd->off = pd->fragoff; + pd->proto = IPPROTO_FRAGMENT; } /* FALLTHROUGH */ default: @@ -9913,9 +9909,6 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, #ifdef INET6 case AF_INET6: { struct ip6_hdr *h; - int fragoff; - uint32_t jumbolen; - uint8_t nxt; if (__predict_false((*m0)->m_len < sizeof(struct ip6_hdr)) && (pd->m = *m0 = m_pullup(*m0, sizeof(struct ip6_hdr))) == NULL) { @@ -9929,8 +9922,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, h = mtod(pd->m, struct ip6_hdr *); pd->off = 0; - if (pf_walk_header6(pd->m, h, &pd->off, &pd->extoff, &fragoff, &nxt, - &jumbolen, reason) != PF_PASS) { + if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; return (-1); } @@ -9945,7 +9937,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->virtual_proto = pd->proto = h->ip6_nxt; pd->act.rtableid = -1; - if (fragoff != 0) + if (pd->fragoff != 0) pd->virtual_proto = PF_VPROTO_FRAGMENT; /* @@ -9958,7 +9950,7 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, } /* We do IP header normalization and packet reassembly here */ - if (pf_normalize_ip6(m0, fragoff, reason, pd) != + if (pf_normalize_ip6(m0, pd->fragoff, reason, pd) != PF_PASS) { *action = PF_DROP; return (-1); @@ -9975,20 +9967,23 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, pd->src = (struct pf_addr *)&h->ip6_src; pd->dst = (struct pf_addr *)&h->ip6_dst; - /* - * Reassembly may have changed the next protocol from fragment - * to something else, so update. - */ - pd->virtual_proto = pd->proto = h->ip6_nxt; pd->off = 0; - if (pf_walk_header6(pd->m, h, &pd->off, &pd->extoff, &fragoff, &nxt, - &jumbolen, reason) != PF_PASS) { + if (pf_walk_header6(pd, h, reason) != PF_PASS) { *action = PF_DROP; return (-1); } - if (fragoff != 0) + if (m_tag_find(pd->m, PACKET_TAG_PF_REASSEMBLED, NULL) != NULL) { + /* + * Reassembly may have changed the next protocol from + * fragment to something else, so update. + */ + pd->virtual_proto = pd->proto; + MPASS(pd->fragoff == 0); + } + + if (pd->fragoff != 0) pd->virtual_proto = PF_VPROTO_FRAGMENT; break; From nobody Tue Jan 14 10:38:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXQZK49V2z5kVwS; Tue, 14 Jan 2025 10:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXQZJ5fKkz3BrX; Tue, 14 Jan 2025 10:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8A1T5i2+oJayEIsJKK3NCP4x35vJnDsFZ+KFGmpL+Bg=; b=xdd/Npz+ZHCYdXkllVeOxqGhZZXolgihwmWKAkQB0f14+yT0FaCplWDm4DSp5a88GQ5Z22 BGWuL0y9FwKFpTRHvpI3PCjYrPos/A3cIT8oNigffjMsjhM2ALWCFev8tqNcU5uFi9YBiB zVadXtqSOhv8KUsdjFj+W2ZaZaaPtQi7LmT8/U2ehED7xoYUqWKSlPf3XmSfsIu1z3VvKR ztncHULFc4+jLrzgO7RxIgjbb390ktReGdyKpU4Ontiq6sfT6CzuzqbS+p2rJlac8kDz/p i9c1hSEahAr0l6AwJtJs6/aR7pt5AGghTA+IY9Y+BQBMmK6dI3yTfo92tzELEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736851080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8A1T5i2+oJayEIsJKK3NCP4x35vJnDsFZ+KFGmpL+Bg=; b=XlMFL8UR+MtIetJS36TmNqqxkogJ5F7i1fOnkkdTUO+wdU9KqjwuOcbPebjno48AhYJ7iB H6gMyp1fPYPuUrS/FEg5wfCZV5JgzjTcLOvJ60g3a6FPIUnv3urRQUp2Cnl1kGySVYpOSO I/8Ym50adn8b9FNc3DTbTDCvs9se+mclX6Gu5h3NeYGsaexOK1SWGIYPGq4VMzrsM5lS7P 0Z6oWzXBkjt4RXUWO/ffzpFGQ3tx6iPAHPCYD4htAzGAwsICKDT1y/h6dbETuRESNb6p93 KlAs8Lr9pOLdy9CWSPqCrMBvHk3MH7o8EwxJmF3OygzZkKg85uaX5jtDhjxyug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736851080; a=rsa-sha256; cv=none; b=B7MjuyvRL2E889rI/adzy8c4lkm2x1iqhpahfjlfhYYplakTLN1bdeNRoGEWi43U8eu5SW jBR1TvT1rYxR9whcLdHmYs6hvh+ovb2f5siqhCNMXS6oz916mLl65H9y1dBSP63xv2X+AX TFFIzfpBjwpwBt0ULpujSARK5FkTbLPx2VSteUcsaXhPtzGmUvx2HW5MGpjRIqyBwGuXFt YGMXK13hEWyz2usAGwwdDN4OYesFEKUmpYcrABuH2r+vdpuY21qaAt50lA93yV4QpuwzBD vVpJy4szIHl3GZ/QovjgACE4lL3PhMJwYZ0MkrazWQZKA/MXQejeVcSxy0DRgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXQZJ4xx0z1BC3; Tue, 14 Jan 2025 10:38: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 50EAc0Vw048418; Tue, 14 Jan 2025 10:38:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAc047048415; Tue, 14 Jan 2025 10:38:00 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:38:00 GMT Message-Id: <202501141038.50EAc047048415@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: d90854a60a91 - main - pf: reset index if it's outside the table List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d90854a60a919fc574d1786486f85394f53ce2dd Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d90854a60a919fc574d1786486f85394f53ce2dd commit d90854a60a919fc574d1786486f85394f53ce2dd Author: Kristof Provost AuthorDate: 2025-01-09 13:31:22 +0000 Commit: Kristof Provost CommitDate: 2025-01-14 08:54:20 +0000 pf: reset index if it's outside the table when table content changes we need to reset index to the initial value and do not use the counter; reported by Sebastian Benoit and Daniel Krambrock, tested by Sebastian Benoit, ok henning zinke Obtained from: OpenBSD, mikeb , dba347c9d1 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 35c9bd4ab655..03efa0b738da 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2269,10 +2269,10 @@ pfr_pool_get(struct pfr_ktable *kt, int *pidx, struct pf_addr *counter, return (-1); idx = *pidx; - if (idx >= 0) - use_counter = 1; - if (idx < 0) + if (idx < 0 || idx >= kt->pfrkt_cnt) idx = 0; + else if (counter != NULL) + use_counter = 1; startidx = idx; _next_block: From nobody Tue Jan 14 10:58:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXR1v5nkTz5kX3y; Tue, 14 Jan 2025 10:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXR1v0Mg4z3Kgk; Tue, 14 Jan 2025 10:58:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhCdHLHV6FLbqziIBB4vxDEI6AsmqF6YMf4GlTGRLug=; b=ZSWtmkb2jcfZ8OUpM7+z8g8VYVPN+LNsr8YTjqf4QabB7j3kPjnXTiNJhLVUU20j4mP9hr dn8vnZO8GIIHkZK8pMvW6TLwWcHJXjw07rUF14FtMkRIuYWx+DIQZsCmsMZlqA5MoZ/v8R oIv1iZIjv206OxIVtqJ4s4xhIIrNCpfNTDW76/o6ONYUbgFcRTEwmEAMTtwzugWTZuqEVR KeDS6TCzHEDMMZmXiel4VlArTPmckxzv8Hks9iLphFHN+cKYhgBSUiMFEiujHGU7UTTIBD i9sbWbYmyXhn4aUyyjRtj6oQNtTWCGZDpnEtlnOTVsplB2uu/kMf/ERJ3MwXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736852307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GhCdHLHV6FLbqziIBB4vxDEI6AsmqF6YMf4GlTGRLug=; b=Tdw8gAd901IMjEO1asej+kfPoAYZf3zIE4uTOpbu3D/kYMC6fsklj3sOT3o5nc4ka/ezz1 a8rBgRNt5fvqsa99imDlCNLLN+sIihSFnynnT6IdlDNJLHmE2/I7mP65uddWsE+98BFo7Z zDYLXWgOwi574EGZeJrD3ENbUjAbdis6tSkbpVj9+1JEtlt3BG+6NTxYYByMJdQuaPajL5 6LBSQj20Do5IpT2Kin/vlGguXrACrzuwQfyNA1hAYIqRBQrb+mQYNtA2Asp92e97whLp8n nZkODO0zBGrdEfDJpW2J22rIhavPjb+rrNgDUOQH1s2Iprj6Oo1P+OjmV1HfFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736852307; a=rsa-sha256; cv=none; b=NBGwEWuSjMU7oIDIq7XuTTPh1z2S0NquJiK1iCpdXYYSaSb/wz3Hd4FE92ustXLuiDX1o6 28koMIWjWlcjPbuod8kNk74CxvEngW7TNxDyFu69aLZRO19nBb9JhQVtd0vjYdTWTAIgOF CgpNlq4/92BG/p386mJSupUkLc6jz8Bt4504txANtNgv3F0BssdMd8HtVhpWDZn55B+11v WLYyUPZ32631rmWTyQDwk/K92LbXZCKPGIf36n1FxEpj4So+qzzFl5QLTDi2qi/RcQ3h4W eIzBbujuGoN5ZNkUuiIyiEBMXujnEu9WPVSFBcByRxZamRVhzaRAHU30+VAVMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXR1t6Ykdz1Cnp; Tue, 14 Jan 2025 10:58:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50EAwQco085583; Tue, 14 Jan 2025 10:58:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EAwQ3X085580; Tue, 14 Jan 2025 10:58:26 GMT (envelope-from git) Date: Tue, 14 Jan 2025 10:58:26 GMT Message-Id: <202501141058.50EAwQ3X085580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 08ec14fecf6a - stable/13 - sppp: Fix getting wrong spppreq cmd from ioctl List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08ec14fecf6a93c0321c31ba1f0b04db6b888f16 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=08ec14fecf6a93c0321c31ba1f0b04db6b888f16 commit 08ec14fecf6a93c0321c31ba1f0b04db6b888f16 Author: Zhenlei Huang AuthorDate: 2025-01-14 10:56:49 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-14 10:56:49 +0000 sppp: Fix getting wrong spppreq cmd from ioctl ifr->ifr_data is supposed to point to a struct spppreq. The first member cmd of struct spppreq is int type. It was pre-read via `fueword()` before a full fetching. Unfortunately an user space `struct spppreq spr` may not be zeroed explicitly, on 64bit architectures `fueword()` reads 64bit word thus the garbage (extra 4 bytes) may be read into kernel space (subcmd). Prior to f9d8181868ee, `subcmd` was declared as int and assigned from `fuword()` and was implicitly converted from long to int. On 64bit little endian architectures the implicitly conversion overflows (undefined bahavior) which happen to trash the garbage (the extra 4 bytes, high 32 bits) and worked, but no luck on 64bit big endian architectures. Since f9d8181868ee `subcmd` was changed to u_long then there is no conversion so we end up mismatching `subcmd` with user space's `cmd`. It is also a bit hackish to get the value of cmd via `fueword()`, instead we refer to it directly from spr->cmd. This is a direct commit to stable/13 as sppp(4) no longer exists in main and stable/14. PR: 173002 Reviewed by: glebius (previous version) Fixes: f9d8181868ee Fixed yet more ioctl breakage due to the type of ... Differential Revision: https://reviews.freebsd.org/D47335 --- sys/net/if_spppsubr.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index ed198c59bbfe..269a6ef1d0da 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -5044,10 +5044,10 @@ sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest) static int sppp_params(struct sppp *sp, u_long cmd, void *data) { - u_long subcmd; + int subcmd __diagused; struct ifreq *ifr = (struct ifreq *)data; struct spppreq *spr; - int rv = 0; + int rv; if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL) return (EAGAIN); @@ -5056,7 +5056,7 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) * Check the cmd word first before attempting to fetch all the * data. */ - rv = fueword(ifr_data_get_ptr(ifr), &subcmd); + rv = fueword32(ifr_data_get_ptr(ifr), &subcmd); if (rv == -1) { rv = EFAULT; goto quit; @@ -5067,8 +5067,9 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) goto quit; } - switch (subcmd) { - case (u_long)SPPPIOGDEFS: + MPASS(subcmd == spr->cmd); + switch (spr->cmd) { + case (intptr_t)SPPPIOGDEFS: if (cmd != SIOCGIFGENERIC) { rv = EINVAL; break; @@ -5103,7 +5104,7 @@ sppp_params(struct sppp *sp, u_long cmd, void *data) sizeof(struct spppreq)); break; - case (u_long)SPPPIOSDEFS: + case (intptr_t)SPPPIOSDEFS: if (cmd != SIOCSIFGENERIC) { rv = EINVAL; break; From nobody Tue Jan 14 11:21:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXRXl3ltNz5kY7S; Tue, 14 Jan 2025 11:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXRXl3T7jz3Nt5; Tue, 14 Jan 2025 11:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736853703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mq0+5DoWtd63g19ULlwI1MtSXdd2oe6DfYE5N6Go7yo=; b=XQ73massfRf0Zr9VuLaw0nV0hXKY6/KdyikR0qsg56F4P/3Z/c76uLDCZG92IWvvy8gF9o r5w29wU6Crs/elHYcFjpwQQT7zkL+O4TOulfmVEHcY9cSfpG/xbI7qH8b+E2U4SYaLQ48A Ml9EZpXbA3QP8u2jJ1qOUEcP/g+OcmeUsDLgAPTNLOAjk5yVKI3u9DG0Y8gSE8iluicvYP AGSaHEjOat3l2ENh0ECVFD2GfBJsPikwBWvSdygv2Ekb3XyromUsTCDac4qUQ7nhfbgExY UveZn7ipCoix9rUYIx4RFcTB18z7+G4mYa8lQ9HZhPrhk5uds3gwaSsgWfY60g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736853703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mq0+5DoWtd63g19ULlwI1MtSXdd2oe6DfYE5N6Go7yo=; b=P6oIsrStvFwB1EiFNVTEockCuVAaQ740FiBZPSco/BBPk71BSBLT5lgp6fNbYKO3J/bahM E7W7sxDGk7OvYqa8dbXp/9f2WSh+DA3w0GKfnkMYdQYqwfTrDsN4jUVA8WQy8iaeQB7b1S SUvkw1nTD/1nEsE6d5alC6d6NNBujuK3qOh4AnhuMihMDMt0F+fv8LYGcRQSFIaVz7yx1J Q49jOtRB9rDu90KSYveAxWTwL8CHTWKr5tNMdohdc8+tRoCUpMu+SlxqwA/2X+07IYslqo 73aKQkAoCRyM40bVt69m/t3Q8vZlH84p2duhDDAgU5/vy+zVBZHJb2KPXl12Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736853703; a=rsa-sha256; cv=none; b=CKabBUR3L7wHai3NDk/CVQ7r+Z2zHkzUV4ZNavfuFC19wukwsE8cLPlo4OVGrhsoj9HnCV 3iDP+UH1y1TOvcFaui0BEaxFcJg4tYnlwKdqfJB/iEQDiEDOK00e3FtybTDBsRwe3uY0Ir zfFhPI9S81Azf31pTO6aeyQqmbu/GaIpYJpA6pri2dmJ9wBLGdgOLuYqmKvCk6vxqu58pw 94kwwl3ojdxMt9TG+cVh6UMNJFpUooyAKTrziemUdCWRO5Vdm4+FyjPJ9HaWeo5IahmGVr ferLX54nbC/yVROnN4AbGbLvKBHCrmR6xJg4vwBxYOOJOo8pzBn0QqBQx7VNFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXRXl2rjjz1Dcc; Tue, 14 Jan 2025 11:21: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 50EBLhUm035091; Tue, 14 Jan 2025 11:21:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EBLh9t035087; Tue, 14 Jan 2025 11:21:43 GMT (envelope-from git) Date: Tue, 14 Jan 2025 11:21:43 GMT Message-Id: <202501141121.50EBLh9t035087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: dc4581589a32 - main - pkg: clean support for repositories List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc4581589a3256667fafd46a30c67abdfd86618f Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=dc4581589a3256667fafd46a30c67abdfd86618f commit dc4581589a3256667fafd46a30c67abdfd86618f Author: Baptiste Daroussin AuthorDate: 2025-01-14 11:12:00 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-14 11:21:40 +0000 pkg: clean support for repositories Rework the way the bootstrap fetches pkg, by implementing a full support for the repositories, the boostrap will now loop over all available repo and try to fetch the full package from there. It will at the first valid package found. Fallback to packagesite (which has been deprecated for a while) if needed, by transforming it into a repo, if no repo is found. MFC After: 3 weeks --- usr.sbin/pkg/config.c | 158 ++++++++++++++++++++++++++++++++++++++------------ usr.sbin/pkg/config.h | 24 ++++++++ usr.sbin/pkg/pkg.c | 149 +++++++++++++++++++++++------------------------ 3 files changed, 216 insertions(+), 115 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index d8e15d44da3d..23bccb7eb96e 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -59,6 +59,8 @@ struct config_entry { bool main_only; /* Only set in pkg.conf. */ }; +static struct repositories repositories = STAILQ_HEAD_INITIALIZER(repositories); + static struct config_entry c[] = { [PACKAGESITE] = { PKG_CONFIG_STRING, @@ -211,7 +213,7 @@ boolstr_to_bool(const char *str) } static void -config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) +config_parse(const ucl_object_t *obj) { FILE *buffp; char *buf = NULL; @@ -238,29 +240,9 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) memset(buf, 0, bufsz); rewind(buffp); - if (conftype == CONFFILE_PKG) { for (j = 0; j < strlen(key); ++j) fputc(toupper(key[j]), buffp); fflush(buffp); - } else if (conftype == CONFFILE_REPO) { - if (strcasecmp(key, "url") == 0) - fputs("PACKAGESITE", buffp); - else if (strcasecmp(key, "mirror_type") == 0) - fputs("MIRROR_TYPE", buffp); - else if (strcasecmp(key, "signature_type") == 0) - fputs("SIGNATURE_TYPE", buffp); - else if (strcasecmp(key, "fingerprints") == 0) - fputs("FINGERPRINTS", buffp); - else if (strcasecmp(key, "pubkey") == 0) - fputs("PUBKEY", buffp); - else if (strcasecmp(key, "enabled") == 0) { - if ((cur->type != UCL_BOOLEAN) || - !ucl_object_toboolean(cur)) - goto cleanup; - } else - continue; - fflush(buffp); - } for (i = 0; i < CONFIG_SIZE; i++) { if (strcmp(buf, c[i].key) == 0) @@ -324,7 +306,7 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) if (c[i].envset) continue; /* Prevent overriding ABI, ASSUME_ALWAYS_YES, etc. */ - if (conftype != CONFFILE_PKG && c[i].main_only == true) + if (c[i].main_only == true) continue; switch (c[i].type) { case PKG_CONFIG_LIST: @@ -336,12 +318,91 @@ config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype) } } -cleanup: free(temp_config); fclose(buffp); free(buf); } + +static void +parse_mirror_type(struct repository *r, const char *mt) +{ + if (strcasecmp(mt, "srv") == 0) + r->mirror_type = MIRROR_SRV; + r->mirror_type = MIRROR_NONE; +} + +static bool +parse_signature_type(struct repository *repo, const char *st) +{ + if (strcasecmp(st, "FINGERPRINTS") == 0) + repo->signature_type = SIGNATURE_FINGERPRINT; + else if (strcasecmp(st, "PUBKEY") == 0) + repo->signature_type = SIGNATURE_PUBKEY; + else if (strcasecmp(st, "NONE") == 0) + repo->signature_type = SIGNATURE_NONE; + else { + warnx("Signature type %s is not supported for bootstraping," + " ignoring repository %s", st, repo->name); + free(repo->url); + free(repo->name); + free(repo->fingerprints); + free(repo->pubkey); + free(repo); + return false; + } + return (true); +} + +static void +parse_repo(const ucl_object_t *o) +{ + const ucl_object_t *cur; + const char *key; + ucl_object_iter_t it = NULL; + + struct repository *repo = calloc(1, sizeof(struct repository)); + if (repo == NULL) + err(EXIT_FAILURE, "calloc"); + + repo->name = strdup(ucl_object_key(o)); + if (repo->name == NULL) + err(EXIT_FAILURE, "strdup"); + while ((cur = ucl_iterate_object(o, &it, true))) { + key = ucl_object_key(cur); + if (key == NULL) + continue; + if (strcasecmp(key, "url") == 0) { + repo->url = strdup(ucl_object_tostring(cur)); + if (repo->url == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "mirror_type") == 0) { + parse_mirror_type(repo, ucl_object_tostring(cur)); + } else if (strcasecmp(key, "signature_type") == 0) { + if (!parse_signature_type(repo, ucl_object_tostring(cur))) + return; + } else if (strcasecmp(key, "fingerprints") == 0) { + repo->fingerprints = strdup(ucl_object_tostring(cur)); + if (repo->fingerprints == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "pubkey") == 0) { + repo->pubkey = strdup(ucl_object_tostring(cur)); + if (repo->pubkey == NULL) + err(EXIT_FAILURE, "strdup"); + } else if (strcasecmp(key, "enabled") == 0) { + if ((cur->type != UCL_BOOLEAN) || + !ucl_object_toboolean(cur)) { + free(repo->url); + free(repo->name); + free(repo); + return; + } + } + } + STAILQ_INSERT_TAIL(&repositories, repo, next); + return; +} + /*- * Parse new repo style configs in style: * Name: @@ -367,8 +428,7 @@ parse_repo_file(ucl_object_t *obj, const char *requested_repo) if (requested_repo != NULL && strcmp(requested_repo, key) != 0) continue; - - config_parse(cur, CONFFILE_REPO); + parse_repo(cur); } } @@ -379,8 +439,12 @@ read_conf_file(const char *confpath, const char *requested_repo, { struct ucl_parser *p; ucl_object_t *obj = NULL; + const char *abi = pkg_get_myabi(); + if (abi == NULL) + errx(EXIT_FAILURE, "Fail do determine ABI"); p = ucl_parser_new(0); + ucl_parser_register_variable(p, "ABI", abi); if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) @@ -397,7 +461,7 @@ read_conf_file(const char *confpath, const char *requested_repo, "configuration file %s", confpath); else { if (conftype == CONFFILE_PKG) - config_parse(obj, conftype); + config_parse(obj); else if (conftype == CONFFILE_REPO) parse_repo_file(obj, requested_repo); } @@ -408,7 +472,7 @@ read_conf_file(const char *confpath, const char *requested_repo, return (0); } -static int +static void load_repositories(const char *repodir, const char *requested_repo) { struct dirent *ent; @@ -416,12 +480,9 @@ load_repositories(const char *repodir, const char *requested_repo) char *p; size_t n; char path[MAXPATHLEN]; - int ret; - - ret = 0; if ((d = opendir(repodir)) == NULL) - return (1); + return; while ((ent = readdir(d))) { /* Trim out 'repos'. */ @@ -437,7 +498,6 @@ load_repositories(const char *repodir, const char *requested_repo) continue; if (read_conf_file(path, requested_repo, CONFFILE_REPO)) { - ret = 1; goto cleanup; } } @@ -445,8 +505,6 @@ load_repositories(const char *repodir, const char *requested_repo) cleanup: closedir(d); - - return (ret); } int @@ -508,8 +566,7 @@ config_init(const char *requested_repo) } STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) - if (load_repositories(cv->value, requested_repo)) - goto finalize; + load_repositories(cv->value, requested_repo); finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { @@ -520,8 +577,6 @@ finalize: c[ABI].val = abi; } - subst_packagesite(c[ABI].value != NULL ? c[ABI].value : c[ABI].val); - return (0); } @@ -560,6 +615,33 @@ config_bool(pkg_config_key k, bool *val) return (0); } +struct repositories * +config_get_repositories(void) +{ + if (STAILQ_EMPTY(&repositories)) { + /* Fall back to PACKAGESITE - deprecated - */ + struct repository *r = calloc(1, sizeof(r)); + if (r == NULL) + err(EXIT_FAILURE, "calloc"); + r->name = strdup("fallback"); + if (r->name == NULL) + err(EXIT_FAILURE, "strdup"); + subst_packagesite(c[ABI].value != NULL ? c[ABI].value : c[ABI].val); + r->url = c[PACKAGESITE].value; + if (c[SIGNATURE_TYPE].value != NULL) + if (!parse_signature_type(r, c[SIGNATURE_TYPE].value)) + exit(EXIT_FAILURE); + if (c[MIRROR_TYPE].value != NULL) + parse_mirror_type(r, c[MIRROR_TYPE].value); + if (c[PUBKEY].value != NULL) + r->pubkey = c[PUBKEY].value; + if (c[FINGERPRINTS].value != NULL) + r->fingerprints = c[FINGERPRINTS].value; + STAILQ_INSERT_TAIL(&repositories, r, next); + } + return (&repositories); +} + void config_finish(void) { int i; diff --git a/usr.sbin/pkg/config.h b/usr.sbin/pkg/config.h index 21d115e41db2..26f3ff79541b 100644 --- a/usr.sbin/pkg/config.h +++ b/usr.sbin/pkg/config.h @@ -30,6 +30,7 @@ #define _PKG_CONFIG_H #include +#include #define URL_SCHEME_PREFIX "pkg+" @@ -58,9 +59,32 @@ typedef enum { CONFFILE_REPO, } pkg_conf_file_t; +typedef enum { + SIGNATURE_NONE = 0, + SIGNATURE_FINGERPRINT, + SIGNATURE_PUBKEY, +} signature_t; + +typedef enum { + MIRROR_NONE = 0, + MIRROR_SRV, +} mirror_t; + +struct repository { + char *name; + char *url; + mirror_t mirror_type; + signature_t signature_type; + char *fingerprints; + char *pubkey; + STAILQ_ENTRY(repository) next; +}; +STAILQ_HEAD(repositories, repository); + int config_init(const char *); void config_finish(void); int config_string(pkg_config_key, const char **); int config_bool(pkg_config_key, bool *); +struct repositories *config_get_repositories(void); #endif diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 54884dbe0b23..0b46d2831e9e 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -255,7 +255,7 @@ install_pkg_static(const char *path, const char *pkgpath, bool force) } static int -fetch_to_fd(const char *url, char *path, const char *fetchOpts) +fetch_to_fd(struct repository *repo, const char *url, char *path, const char *fetchOpts) { struct url *u; struct dns_srvinfo *mirrors, *current; @@ -267,18 +267,11 @@ fetch_to_fd(const char *url, char *path, const char *fetchOpts) ssize_t r; char buf[10240]; char zone[MAXHOSTNAMELEN + 13]; - static const char *mirror_type = NULL; max_retry = 3; current = mirrors = NULL; remote = NULL; - if (mirror_type == NULL && config_string(MIRROR_TYPE, &mirror_type) - != 0) { - warnx("No MIRROR_TYPE defined"); - return (-1); - } - if ((fd = mkstemp(path)) == -1) { warn("mkstemp()"); return (-1); @@ -294,7 +287,7 @@ fetch_to_fd(const char *url, char *path, const char *fetchOpts) while (remote == NULL) { if (retry == max_retry) { if (strcmp(u->scheme, "file") != 0 && - strcasecmp(mirror_type, "srv") == 0) { + repo->mirror_type == MIRROR_SRV) { snprintf(zone, sizeof(zone), "_%s._tcp.%s", u->scheme, u->host); mirrors = dns_getsrvinfo(zone); @@ -653,23 +646,31 @@ parse_cert(int fd) { } static bool -verify_pubsignature(int fd_pkg, int fd_sig) +verify_pubsignature(int fd_pkg, int fd_sig, struct repository *r) { struct pubkey *pk; - const char *pubkey; char *data; struct pkgsign_ctx *sctx; size_t datasz; bool ret; + const char *pubkey; pk = NULL; - pubkey = NULL; sctx = NULL; data = NULL; ret = false; - if (config_string(PUBKEY, &pubkey) != 0) { - warnx("No CONFIG_PUBKEY defined"); - goto cleanup; + + if (r != NULL) { + if (r->pubkey == NULL) { + warnx("No CONFIG_PUBKEY defined for %s", r->name); + goto cleanup; + } + pubkey = r->pubkey; + } else { + if (config_string(PUBKEY, &pubkey) != 0) { + warnx("No CONFIG_PUBKEY defined for %s", r->name); + goto cleanup; + } } if ((pk = read_pubkey(fd_sig)) == NULL) { @@ -703,8 +704,8 @@ verify_pubsignature(int fd_pkg, int fd_sig) } /* Verify the signature. */ - printf("Verifying signature with public key %s... ", pubkey); - if (pkgsign_verify_data(sctx, data, datasz, pubkey, NULL, 0, pk->sig, + printf("Verifying signature with public key %s.a.. ", r->pubkey); + if (pkgsign_verify_data(sctx, data, datasz, r->pubkey, NULL, 0, pk->sig, pk->siglen) == false) { fprintf(stderr, "Signature is not valid\n"); goto cleanup; @@ -723,7 +724,7 @@ cleanup: } static bool -verify_signature(int fd_pkg, int fd_sig) +verify_signature(int fd_pkg, int fd_sig, struct repository *r) { struct fingerprint_list *trusted, *revoked; struct fingerprint *fingerprint; @@ -742,9 +743,17 @@ verify_signature(int fd_pkg, int fd_sig) ret = false; /* Read and parse fingerprints. */ - if (config_string(FINGERPRINTS, &fingerprints) != 0) { - warnx("No CONFIG_FINGERPRINTS defined"); - goto cleanup; + if (r != NULL) { + if (r->fingerprints == NULL) { + warnx("No FINGERPRINTS defined for %s", r->name); + goto cleanup; + } + fingerprints = r->fingerprints; + } else { + if (config_string(FINGERPRINTS, &fingerprints) != 0) { + warnx("No FINGERPRINTS defined"); + goto cleanup; + } } snprintf(path, MAXPATHLEN, "%s/trusted", fingerprints); @@ -833,7 +842,7 @@ cleanup: } static int -bootstrap_pkg(bool force, const char *fetchOpts) +bootstrap_pkg(bool force, const char *fetchOpts, struct repository *repo) { int fd_pkg, fd_sig; int ret; @@ -841,28 +850,18 @@ bootstrap_pkg(bool force, const char *fetchOpts) char tmppkg[MAXPATHLEN]; char tmpsig[MAXPATHLEN]; const char *packagesite; - const char *signature_type; char pkgstatic[MAXPATHLEN]; const char *bootstrap_name; fd_sig = -1; ret = -1; - if (config_string(PACKAGESITE, &packagesite) != 0) { - warnx("No PACKAGESITE defined"); - return (-1); - } - - if (config_string(SIGNATURE_TYPE, &signature_type) != 0) { - warnx("Error looking up SIGNATURE_TYPE"); - return (-1); - } - - printf("Bootstrapping pkg from %s, please wait...\n", packagesite); + printf("Bootstrapping pkg from %s, please wait...\n", repo->url); /* Support pkg+http:// for PACKAGESITE which is the new format in 1.2 to avoid confusion on why http://pkg.FreeBSD.org has no A record. */ + packagesite = repo->url; if (strncmp(URL_SCHEME_PREFIX, packagesite, strlen(URL_SCHEME_PREFIX)) == 0) packagesite += strlen(URL_SCHEME_PREFIX); @@ -873,53 +872,44 @@ bootstrap_pkg(bool force, const char *fetchOpts) snprintf(tmppkg, MAXPATHLEN, "%s/%s.XXXXXX", getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, bootstrap_name); - if ((fd_pkg = fetch_to_fd(url, tmppkg, fetchOpts)) != -1) + if ((fd_pkg = fetch_to_fd(repo, url, tmppkg, fetchOpts)) != -1) break; bootstrap_name = NULL; } if (bootstrap_name == NULL) goto fetchfail; - if (signature_type != NULL && - strcasecmp(signature_type, "NONE") != 0) { - if (strcasecmp(signature_type, "FINGERPRINTS") == 0) { - - snprintf(tmpsig, MAXPATHLEN, "%s/%s.sig.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, - bootstrap_name); - snprintf(url, MAXPATHLEN, "%s/Latest/%s.sig", - packagesite, bootstrap_name); - - if ((fd_sig = fetch_to_fd(url, tmpsig, fetchOpts)) == -1) { - fprintf(stderr, "Signature for pkg not " - "available.\n"); - goto fetchfail; - } + if (repo->signature_type == SIGNATURE_FINGERPRINT) { + snprintf(tmpsig, MAXPATHLEN, "%s/%s.sig.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, + bootstrap_name); + snprintf(url, MAXPATHLEN, "%s/Latest/%s.sig", + packagesite, bootstrap_name); - if (verify_signature(fd_pkg, fd_sig) == false) - goto cleanup; - } else if (strcasecmp(signature_type, "PUBKEY") == 0) { + if ((fd_sig = fetch_to_fd(repo, url, tmpsig, fetchOpts)) == -1) { + fprintf(stderr, "Signature for pkg not " + "available.\n"); + goto fetchfail; + } - snprintf(tmpsig, MAXPATHLEN, - "%s/%s.pubkeysig.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, - bootstrap_name); - snprintf(url, MAXPATHLEN, "%s/Latest/%s.pubkeysig", - packagesite, bootstrap_name); + if (verify_signature(fd_pkg, fd_sig, repo) == false) + goto cleanup; + } else if (repo->signature_type == SIGNATURE_PUBKEY) { + snprintf(tmpsig, MAXPATHLEN, + "%s/%s.pubkeysig.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, + bootstrap_name); + snprintf(url, MAXPATHLEN, "%s/Latest/%s.pubkeysig", + repo->url, bootstrap_name); - if ((fd_sig = fetch_to_fd(url, tmpsig, fetchOpts)) == -1) { - fprintf(stderr, "Signature for pkg not " - "available.\n"); - goto fetchfail; - } + if ((fd_sig = fetch_to_fd(repo, url, tmpsig, fetchOpts)) == -1) { + fprintf(stderr, "Signature for pkg not " + "available.\n"); + goto fetchfail; + } - if (verify_pubsignature(fd_pkg, fd_sig) == false) - goto cleanup; - } else { - warnx("Signature type %s is not supported for " - "bootstrapping.", signature_type); + if (verify_pubsignature(fd_pkg, fd_sig, repo) == false) goto cleanup; - } } if ((ret = extract_pkg_static(fd_pkg, pkgstatic, MAXPATHLEN)) == 0) @@ -929,18 +919,15 @@ bootstrap_pkg(bool force, const char *fetchOpts) fetchfail: for (int j = 0; bootstrap_names[j] != NULL; j++) { - warnx("Attempted to fetch %s/Latest/%s", packagesite, + warnx("Attempted to fetch %s/Latest/%s", repo->url, bootstrap_names[j]); } warnx("Error: %s", fetchLastErrString); if (fetchLastErrCode == FETCH_RESOLV) { fprintf(stderr, "Address resolution failed for %s.\n", packagesite); - fprintf(stderr, "Consider changing PACKAGESITE.\n"); } else { fprintf(stderr, "A pre-built version of pkg could not be found for " "your system.\n"); - fprintf(stderr, "Consider changing PACKAGESITE or installing it from " - "ports: 'ports-mgmt/pkg'.\n"); } cleanup: @@ -1024,7 +1011,7 @@ bootstrap_pkg_local(const char *pkgpath, bool force) goto cleanup; } - if (verify_signature(fd_pkg, fd_sig) == false) + if (verify_signature(fd_pkg, fd_sig, NULL) == false) goto cleanup; } else if (strcasecmp(signature_type, "PUBKEY") == 0) { @@ -1037,7 +1024,7 @@ bootstrap_pkg_local(const char *pkgpath, bool force) goto cleanup; } - if (verify_pubsignature(fd_pkg, fd_sig) == false) + if (verify_pubsignature(fd_pkg, fd_sig, NULL) == false) goto cleanup; } else { @@ -1105,6 +1092,7 @@ main(int argc, char *argv[]) signed char ch; const char *fetchOpts; char *command; + struct repositories *repositories; activation_test = false; add_pkg = false; @@ -1232,6 +1220,8 @@ main(int argc, char *argv[]) fetchDebug = 1; if ((bootstrap_only && force) || access(pkgpath, X_OK) == -1) { + struct repository *repo; + int ret = 0; /* * To allow 'pkg -N' to be used as a reliable test for whether * a system is configured to use pkg, don't bootstrap pkg @@ -1272,7 +1262,12 @@ main(int argc, char *argv[]) if (pkg_query_yes_no() == 0) exit(EXIT_FAILURE); } - if (bootstrap_pkg(force, fetchOpts) != 0) + repositories = config_get_repositories(); + STAILQ_FOREACH(repo, repositories, next) { + if ((ret = bootstrap_pkg(force, fetchOpts, repo)) == 0) + break; + } + if (ret != 0) exit(EXIT_FAILURE); config_finish(); From nobody Tue Jan 14 12:59:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXTjr3K2Fz5kfXn; Tue, 14 Jan 2025 12:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXTjr1v9jz3VsC; Tue, 14 Jan 2025 12:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736859584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnhBXkiONp4Ugar0hp+KDAwfMQLoJKg+zjpOuaDNYTY=; b=ANljhh/9Iu4aA8uRReh19/bKAbXLUwQgabXyk708MMee3wYoThoQR5qJ/jXcsqi44P8pdj CK/JLDWK6KhxYTbKi+IJ8AlEl97cwS9EPfsPw7jxTkwKZhknRysq8YSnDCTw+2DzsRcfzk JfRgfW1IILTmf1T8ErAY9e8SXG7oYYTJ+MuZsct+45B3vxairnUMYZKf6eK0wMdnvbDSus 9Fh5NQcNgYRbyO6HHgXW747tI8X5HBlJ0nI6nGdGIWgySMxGI0qbkd1PpvV52NmkcT7How xcWYIgjzqoIeuc4b5AdqOTrj1FF1bEEg7/WEMkIJgySGO9x7vj65CfXS5LtvDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736859584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BnhBXkiONp4Ugar0hp+KDAwfMQLoJKg+zjpOuaDNYTY=; b=QMcPxmp7p5NPLZ8Ff/Hvhn8ymCrmod+XSUVzlxcTi4imRp1Z4r0gsE7bnvI85DruExNn1H KlZeCeXupt93r2/yiBhQjlDmX1zMcxEDMRWIULkB1DM9YdJoh/3xonSDHbpJAZDoKLKzUS lxVZK5Y9tO4hDaF8x+FY3VJTTdDOivLRjaGHG5lXGFRHTKZEsJLAplxyXt7lMPnJLXBzDl KU2xo55VEbgd5HttPZSfZmyLQt2p86ezvnxElZAGyqb0q4CstG6FSSHEu9Q1ICwZM4ac7C y8oT9LVrcunQdi1K1lfjITcKHK/kNTbeD+8qK7C/KBLxYUZMh00A2NhqU9P6IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736859584; a=rsa-sha256; cv=none; b=nz0yML6Eih7EeqRaW+hoeAlCsOqw6kCoDcvOfy1T7f6EGf2p0CliyUbGL5espkHN+QXBaR tqops4H5eI/F/VoCQuSuxlXgNImombtKhrNtG+LWKYswdiAcQH6wG2WTZFSBHo/bdkQrUS fC8BKeZej4+0fpr74CyvNDqdBQTXFavJ4yVLyrh+ssoDPHews4kntLH8DONjfaJ+h8NEZ5 NZn3XdXklCA6Ad0z0EKEf7TS0W0z1vC5CDhvYdK2Exp9XkDIJK98kbEew8MbJ3CDJtlcuO r1BR57FBW1VgthFEfQmbpRnaaH5r8H3LDLVRAr+jURjDiO3mu5OHJGbWeSNA6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXTjr1Jrrz1Gdj; Tue, 14 Jan 2025 12:59:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50ECxiK3010596; Tue, 14 Jan 2025 12:59:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ECxiS0010593; Tue, 14 Jan 2025 12:59:44 GMT (envelope-from git) Date: Tue, 14 Jan 2025 12:59:44 GMT Message-Id: <202501141259.50ECxiS0010593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Benedict Reuschling Subject: git: 49f4e3d297d2 - main - pkg: Fix two typos in visible error messages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bcr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49f4e3d297d26ce6b8e2a2b790bc6357edd064c4 Auto-Submitted: auto-generated The branch main has been updated by bcr: URL: https://cgit.FreeBSD.org/src/commit/?id=49f4e3d297d26ce6b8e2a2b790bc6357edd064c4 commit 49f4e3d297d26ce6b8e2a2b790bc6357edd064c4 Author: Benedict Reuschling AuthorDate: 2025-01-14 12:58:53 +0000 Commit: Benedict Reuschling CommitDate: 2025-01-14 12:58:53 +0000 pkg: Fix two typos in visible error messages No functional changes. --- usr.sbin/pkg/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 23bccb7eb96e..fe1599f42c2c 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -342,7 +342,7 @@ parse_signature_type(struct repository *repo, const char *st) else if (strcasecmp(st, "NONE") == 0) repo->signature_type = SIGNATURE_NONE; else { - warnx("Signature type %s is not supported for bootstraping," + warnx("Signature type %s is not supported for bootstrapping," " ignoring repository %s", st, repo->name); free(repo->url); free(repo->name); @@ -441,7 +441,7 @@ read_conf_file(const char *confpath, const char *requested_repo, ucl_object_t *obj = NULL; const char *abi = pkg_get_myabi(); if (abi == NULL) - errx(EXIT_FAILURE, "Fail do determine ABI"); + errx(EXIT_FAILURE, "Failed to determine ABI"); p = ucl_parser_new(0); ucl_parser_register_variable(p, "ABI", abi); From nobody Tue Jan 14 13:42:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXVgC6rfLz5kj51; Tue, 14 Jan 2025 13:42:31 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXVgC6Q42z3bJn; Tue, 14 Jan 2025 13:42:31 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736862151; 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=BaFE6/unjX0hJR7nVDswOJTs70dEtUZ8K1uLS+wzo34=; b=FJkMzkI9sLKjWxkm9OVxX/Mj8SM3Ev1nLIvRnCqPL4FDgO2p+3vnbg+hABvHuY9WQ1A0Jt HzWb/X1uxFB1tvRXvPH/MonEQXfCoorE8W0Y2Vu8/aDrRDNxcGlxtZqCzTstofwqOhzYdr kboMGzLR/oTJ4b28VJlF+XvdAjQfDmtKE39rCeYO+8EN4Ju9P3KzLEhi4wvwTgRp8r7oZ3 QYYBF2Eg2gZnCOT1AK/gweg/rlHapLaJUHNTE6Rz+CFPBewCjclxsk53LnHpiwt6JmsVod paAzyXgbILyoViOhdOmuxLhgYOJalGmd9dT9jD+dIhJFr3JWh/Cgpu6osCa5pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736862151; 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=BaFE6/unjX0hJR7nVDswOJTs70dEtUZ8K1uLS+wzo34=; b=D7UQSiPr6iTZr/EvstrrHGQJ3aKRwXFtiJDL73kLqrvnndbDTQQVf0A6TK6TxbITHcnrLH Nsuu6R2kjCSPwWgcKfwI7VA+21joUoOy6EXdfa1vgc5R+SQlKxd0CY+khn+v5TQcUWnxbX 6Wn0lc9aX12MGJ4mHxpy4OteYYMYLnTOauJi7/WGgp8H/1pRFqTTMzjL/VrincQm85GTQB wv6+ArPQDJft/8aZIYq2OJpucyO6sLOoLpa4DNVl727nhjoKAiCI9ki6vdcCnLiXw+sksT YFW5KvPyRPDXHDDqkzBJ8HFIFZCHsvCV/w22KcgyjaTRMLRyDvUkbpoBJQTfPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736862151; a=rsa-sha256; cv=none; b=YgowlyfNEyXj902DIipBrvDuknjdR7h2EhiKeOi2NGF/N0mxvjSPdh6zi3oYVFFujy9eWK QzgnpvU7CHUA5fPrhBNWJubrGqKP1FDFZuKpF3ckw+oxn/zypInq0v7D8Q63Oj3yiO972r JkzvMQZ+/w7otzD/tyDPKJLJnx427vl5MI7YsBw8Bg9zoJJC1mW11Ii/SBl0bz4SNIVtRy 1GvtYRP5QH/eA69pM5+RomAZWxvZeN1uM3RnZnFL118od5WWbugf7C5lni1l/nBqDvuXrL JBYjeGN7IPqjN+6Yk6r3/m5wSf86ssw6iOvTQe4ozCuPF8pFomG0ulu06fN7+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_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: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YXVgC5LvPzkZB; Tue, 14 Jan 2025 13:42:31 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 6ABB615104D; Tue, 14 Jan 2025 14:42:29 +0100 (CET) Date: Tue, 14 Jan 2025 14:42:29 +0100 From: Baptiste Daroussin To: Benedict Reuschling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 49f4e3d297d2 - main - pkg: Fix two typos in visible error messages Message-ID: <3dh6qvpb6vfasylr2k6uxykxwsc63x6e3pcx6exwucgfuhol2n@scrct6pcmayu> References: <202501141259.50ECxiS0010593@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501141259.50ECxiS0010593@gitrepo.freebsd.org> On Tue 14 Jan 12:59, Benedict Reuschling wrote: > The branch main has been updated by bcr: > > URL: https://cgit.FreeBSD.org/src/commit/?id=49f4e3d297d26ce6b8e2a2b790bc6357edd064c4 > > commit 49f4e3d297d26ce6b8e2a2b790bc6357edd064c4 > Author: Benedict Reuschling > AuthorDate: 2025-01-14 12:58:53 +0000 > Commit: Benedict Reuschling > CommitDate: 2025-01-14 12:58:53 +0000 > > pkg: Fix two typos in visible error messages > > No functional changes. Thanks, Bapt From nobody Tue Jan 14 13:43:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXVgn0rM0z5kjJl; Tue, 14 Jan 2025 13:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXVgn01nKz3bnq; Tue, 14 Jan 2025 13:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736862181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZG5RydRD/QvY0rOWlfoUc/Z4rYUhYx9z/AkGyQqifsQ=; b=BOxx5fEsJ2lS+3CK/aWv6kewahGNb2/879wNwDGFUCDPDgtqRF9cvRLQWHJSxUbbDnGNfh m0pIv6hZSJp87CO9epO8htYuCkNYfr/+Duc6eSSTQnoWjlNNwBmfRtCUTvBUN/9NiNe6sN nCGtDrG/SQ6/ZsPjylFMLEJmGfy1PTTiDQwRhCIrnyJdCcp9r3R+Qvt/O3TSlV6GamZPB3 J+BS2imvP42mAvOWExKikSqgTSB61nbMa+StFNcLTBRFdo3o+F6jdBhJLO3laJTJlMf/4n 8Wv5gyHaeP9x6IbYKTae17TkFMgFap0Wwb0HqGxoRtDz7mH0NoR3PPoEKlzZqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736862181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZG5RydRD/QvY0rOWlfoUc/Z4rYUhYx9z/AkGyQqifsQ=; b=y41n2eda2lZGBsuAOgwxIEvgwDnKPw7xrJmvhg6lDbUdF8foiPAcyFW0FVIikmmAT1GNSk dCk7MEUba5uCt4rPLW36aFsaHDwnxdAhlDNC6z2kSkG/m89Yoh2dX9T0axU+LHHIveidlP VWG6R+IUht2KVTnDReXMRCQlLQci8jLZIrc/P1iX6zGaP/dRto/roPBLJ5NfdXlSslXJFX 4hJNh2N1rCXf2llWm+/KAkcqyU6HL9cHCkBfjKzfoC3CXKIeDT5KmfZDXqknRxjMyYaAnx id4BNdl8tNPT18YHxbLNum9opzbTK15rJDA3cRnCnbyhXd27baoOTcMAah5EhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736862181; a=rsa-sha256; cv=none; b=XihfFBoK+sgtkCD//aP8KIx2I3B2CQu9ydacAKQGUsRbgbSGaUw+emKamcyiDdc18HvsQw hg5ltps+bfdpzsM7708neVdmPsyzPgoj9HoYpqDm14WXhtnWePNRXWuJfrRcHpkxSiXYrI UB2WwMINzLXilov/hCTSi+OqP/FND1VJhCeaAX119k2oyyr4+Jl8JDt93CMV09mdZmci7n UdNpSSHK5Ts3Zns7InW5AfwloLDDYtOlrWfbMmH2nhkxeVyS49GroIOuURSskkgLnM1Dho gnY0t+cc1drGc+83eHnkrfcd7DdRRYyf3dee/SOWtI63GTzCNPwVzEdAsrC4PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXVgm65DNz1J95; Tue, 14 Jan 2025 13:43: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 50EDh0u1002137; Tue, 14 Jan 2025 13:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EDh0G9002134; Tue, 14 Jan 2025 13:43:00 GMT (envelope-from git) Date: Tue, 14 Jan 2025 13:43:00 GMT Message-Id: <202501141343.50EDh0G9002134@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0cd9513a5ba5 - main - pkg: retire backwards compatibility bootstrap support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cd9513a5ba5bcc5918d783f31279f91edbba2ee Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd9513a5ba5bcc5918d783f31279f91edbba2ee commit 0cd9513a5ba5bcc5918d783f31279f91edbba2ee Author: Ed Maste AuthorDate: 2024-10-07 17:10:58 +0000 Commit: Ed Maste CommitDate: 2025-01-14 13:42:36 +0000 pkg: retire backwards compatibility bootstrap support pkg.pkg has been available for years and is the default in all supported releases. Retire fallback support for pkg.txz. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46990 --- usr.sbin/pkg/pkg.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 0b46d2831e9e..21ee1cd4bd30 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -91,11 +91,7 @@ struct fingerprint { STAILQ_ENTRY(fingerprint) next; }; -static const char *bootstrap_names [] = { - "pkg.pkg", - "pkg.txz", - NULL -}; +static const char *bootstrap_name = "pkg.pkg"; STAILQ_HEAD(fingerprint_list, fingerprint); @@ -851,7 +847,6 @@ bootstrap_pkg(bool force, const char *fetchOpts, struct repository *repo) char tmpsig[MAXPATHLEN]; const char *packagesite; char pkgstatic[MAXPATHLEN]; - const char *bootstrap_name; fd_sig = -1; ret = -1; @@ -865,18 +860,12 @@ bootstrap_pkg(bool force, const char *fetchOpts, struct repository *repo) if (strncmp(URL_SCHEME_PREFIX, packagesite, strlen(URL_SCHEME_PREFIX)) == 0) packagesite += strlen(URL_SCHEME_PREFIX); - for (int j = 0; bootstrap_names[j] != NULL; j++) { - bootstrap_name = bootstrap_names[j]; - snprintf(url, MAXPATHLEN, "%s/Latest/%s", packagesite, bootstrap_name); - snprintf(tmppkg, MAXPATHLEN, "%s/%s.XXXXXX", - getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, - bootstrap_name); - if ((fd_pkg = fetch_to_fd(repo, url, tmppkg, fetchOpts)) != -1) - break; - bootstrap_name = NULL; - } - if (bootstrap_name == NULL) + snprintf(url, MAXPATHLEN, "%s/Latest/%s", packagesite, bootstrap_name); + snprintf(tmppkg, MAXPATHLEN, "%s/%s.XXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, + bootstrap_name); + if ((fd_pkg = fetch_to_fd(repo, url, tmppkg, fetchOpts)) == -1) goto fetchfail; if (repo->signature_type == SIGNATURE_FINGERPRINT) { @@ -918,11 +907,7 @@ bootstrap_pkg(bool force, const char *fetchOpts, struct repository *repo) goto cleanup; fetchfail: - for (int j = 0; bootstrap_names[j] != NULL; j++) { - warnx("Attempted to fetch %s/Latest/%s", repo->url, - bootstrap_names[j]); - } - warnx("Error: %s", fetchLastErrString); + warnx("Error fetching %s: %s", url, fetchLastErrString); if (fetchLastErrCode == FETCH_RESOLV) { fprintf(stderr, "Address resolution failed for %s.\n", packagesite); } else { From nobody Tue Jan 14 14:43:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1Z5DpSz5km0Q; Tue, 14 Jan 2025 14:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1Z4N5kz3gPg; Tue, 14 Jan 2025 14:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCRezlNRJ/QnvR6wuZOIfeWx1zydso6DSsRtBll48iE=; b=ttvkrPZQa0CmcaAuSFcKJAxxzkyK2aA38GRuzWAJLOSjwAAJB1nKQYjD9WnOCwPbH7tw59 XuXtA13byKMK/0v4yYZR6psT5zcnUhdlprQJAoyo6okrVJybKD4V632zyAnKSpgUKgV6ES u8BlMB392gGhA/+zmmSmmxQJtRH6wzWqoki3DREFqmmxKKIbwgxYnIxXEDgLNDt88QNZzj iW9ytQ196wWVnLsyhN7C35pr+ZULcPdD3eM86xJCjvCdRdtjnB9w3a5D8kINe0Fylx+2Vv JVBIhTpJWi7BWMA0e6hcP5DrqZiW9myzLrFeQRPfYXYkXVoqwqtV9DQMCEqJgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TCRezlNRJ/QnvR6wuZOIfeWx1zydso6DSsRtBll48iE=; b=eHv915zTcSwIo+XZt7Q52cKW2eAa677Z7wMnBtjbuySM3gT/5gpRYkluJlsb43+b03OjkZ nkl8Q/wp4mM5SAXhBI8hWQvqmVq+bQrrzzqlGvHNREWmdJozZgZNtKOTOzaULJ7Atk68dp JcHFlkVBf8Wsj9GJxhszs7cQ8VmuQPm/4s0FyIHJBhTz2L0Puujam6AKmi61vwrHEx50x9 3uaXmTaMRYxqrZncA04d7bdIrhVNvO7GXOeYrDi/fiUAQrJaJHTGvJBbK1xY/h6/DTCuUh s8FfUEyvDnaOL34eVfiaaAw7yTaIib/BzX3AC+8UXj8BpglGdhaZyMOQE6v86Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865810; a=rsa-sha256; cv=none; b=oKdf4Kk3MQDtbT0BI6mq5a6DimsnlWhZcxYOpAw9CgmpOkI69jpAfgXkhTMOHXp4Gj+GLN pbwUu/qkSHHAeooqtcXWTf2JS+qr9CZRLr/TigGk6xelKjzKp6Nk3xwVhktrX7kP0DlWAH y7FP4n+Rol+Nd9OLRtWmsVU4BVQB6WHfqkuPzNOrZzmwsId+h8GeqrRy/ZmoX3F2zo6XmH RHmnUChBSTF1jDLLMl2DenT99QIuE9pkyO8Rdlz9enVSch8mdr5KG8yN0mLJ8YHMu3VrAS Dgzy1r0CEkuU5Li1LkJN7Sp5DxsjgNq1cK0ZYJCekuSWlw0eLwAecB4FvoBi2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1Z3rPMz1Kgj; Tue, 14 Jan 2025 14:43: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 50EEhUtO013998; Tue, 14 Jan 2025 14:43:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhUeo013995; Tue, 14 Jan 2025 14:43:30 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:30 GMT Message-Id: <202501141443.50EEhUeo013995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2c1c6bd7d5db - stable/14 - sed: Fix handling of an empty pattern space List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c1c6bd7d5dbddd953587c1f003e6164749e087b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2c1c6bd7d5dbddd953587c1f003e6164749e087b commit 2c1c6bd7d5dbddd953587c1f003e6164749e087b Author: Mohamed Akram AuthorDate: 2024-12-23 19:06:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 sed: Fix handling of an empty pattern space Add a regression test. PR: 271791 Obtained from: OpenBSD (1.38 millert) MFC after: 2 weeks (cherry picked from commit 5982237f1e5a30b6b7d67b307b4d3685b00718bf) --- usr.bin/sed/process.c | 10 ++++------ usr.bin/sed/tests/sed2_test.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 3d88096ffb77..945db462a601 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -439,14 +439,12 @@ substitute(struct s_command *cp) * and at the end of the line, terminate. */ if (match[0].rm_so == match[0].rm_eo) { - if (*s == '\0' || *s == '\n') - slen = -1; - else - slen--; - if (*s != '\0') { + if (slen > 0) { cspace(&SS, s++, 1, APPEND); + slen--; le++; - } + } else + slen = -1; lastempty = 1; } else lastempty = 0; diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh index f50619612561..0b849b1ea132 100755 --- a/usr.bin/sed/tests/sed2_test.sh +++ b/usr.bin/sed/tests/sed2_test.sh @@ -159,6 +159,19 @@ minus_e_body() atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a } +atf_test_case command_D +command_D_head() +{ + atf_set "descr" "Test handling of an empty pattern space" +} +command_D_body() +{ + printf "hello\n\nworld\n" > a + + atf_check -o file:a sed -e 's/^//;P;D' a + atf_check -o file:a sed -e 's/^//;$!N;P;D' a +} + atf_init_test_cases() { atf_add_test_case inplace_command_q @@ -169,4 +182,5 @@ atf_init_test_cases() atf_add_test_case hex_subst atf_add_test_case bracket_y atf_add_test_case minus_e + atf_add_test_case command_D } From nobody Tue Jan 14 14:43:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1c097Zz5kmDK; Tue, 14 Jan 2025 14:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1b53GQz3gV1; Tue, 14 Jan 2025 14:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4t6Bxh4WKgJ2RdsUAvc7C5EJW26dW2HNKzMCh8/KHbI=; b=hOPk6IaAYwPVgkMCZ/L2oO3aG0rA4OmWRCAkjSMQ9xq/cXYK+O2RkTWOaD0tP6jGOs5/ie n9IuIBsLqSdCjpFbWEZ0vLgrBCWhDL7HGio90A/Ldxhza2+VB+Porj9jDyGRy0bG9991Sp j4AIBdH8/fDAZLHXcL+gnCt7gfmJCI4V+3XqSItGe/sbS/2eIrc6FKynKS6+93vnvuwWAF merrmIr+J6SKMaaN5hmTVg6Lb1VAb8L6tz1BKfQXk6dPmI//sXzUvxSzjauC6E1WSWRZiq SQwkMqjyjiSUEZVMxBO1F5ClKKFVf11tYgh/Mhzt82jC4XspOp6ZzT8POy/FaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4t6Bxh4WKgJ2RdsUAvc7C5EJW26dW2HNKzMCh8/KHbI=; b=UrMNSOLxcgLlfStUUrUXGkAZixJn+curNaVhx4nxZQ/PzTM+dk6O60rh7IAmtafNooQI/4 fK4j0VWJ6fIiIItuaq1DHaDymUpszMAHI9fQ4OTKDEsAMKCAfpIteksrjGmfjReOkbcCt8 Xmr/+Ue8ZouKh7lld3MbJySnlYt76uqOW56i4kc5QQ4MjLPpQoP5bJUNWcaMNontA5hPAJ PnaeD7KHFH7i/n5KpLdqgE+B9PsR3/GYrjGpKdrLjOg25Yx3+wtt7CJWdPkhkQCsQExuRc sozhfOJiIsuxCIR2pO7GG/ku1Airbs5QInG9dB0lGnFNxxnhGhaYzTL4tAZQVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865811; a=rsa-sha256; cv=none; b=VcEOCWYWKteicAZscxGW4doPeiHRAOZn1Ek/bprObncOmHAw36ExzDnkXDA7UaXbcFwlmq vjS20t+o8w9UIp8M/QKX3URmzWDQX+4a3xYawRGny+m5sJBTYhliP0LG9/w24ysyNQUscO VA821sZb3h9uS2xKvZUeOXjTMjMI7BzM82bQ/Zg3ZxLYhpRN7T3joPVn4NHi1VbpcGFk5X hSulaLfgb7pypL8Geymih1KQswfGBGBPsUH7p92VZmk3z0/Ns1CmAKaNSZtNB8n/y0yAhZ ZEfNa/Orr+x4Ceh5Bl/D2EeQFqH1LS5TuNmZpzR/5PrVyWbzds3XmN+uYvDRXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1b4cqDz1KQ1; Tue, 14 Jan 2025 14:43: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 50EEhVRg014046; Tue, 14 Jan 2025 14:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhVVd014043; Tue, 14 Jan 2025 14:43:31 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:31 GMT Message-Id: <202501141443.50EEhVVd014043@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cbf77cecec38 - stable/14 - inpcb: Remove bogus SO_REUSEPORT(_LB) checks in in_pcbbind() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cbf77cecec38dfcdd5fdc24fc1fba9eeae3b00f1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cbf77cecec38dfcdd5fdc24fc1fba9eeae3b00f1 commit cbf77cecec38dfcdd5fdc24fc1fba9eeae3b00f1 Author: Mark Johnston AuthorDate: 2024-12-12 14:06:06 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 inpcb: Remove bogus SO_REUSEPORT(_LB) checks in in_pcbbind() This check for SO_REUSEPORT was added way back in commit 52b65dbe85faf. Per the commit log, this commit restricted this port-stealing check to unicast addresses, and then only if the existing socket does not have SO_REUSEPORT set. In other words, if there exists a socket bound to INADDR_ANY, and we bind a socket to INADDR_ANY with the same port, then the two sockets need not be owned by the same user if the existing socket has SO_REUSEPORT set. This is a surprising semantic; bugzilla PR 7713 gives some additional context. That PR makes a case for the behaviour described above when binding to a multicast address. But, the SO_REUSEPORT check is only applied when binding to a non-multicast address, so it doesn't really make sense. In the PR the committer notes that "unicast applications don't set SO_REUSEPORT", which makes some sense, but also refers to "multicast applications that bind to INADDR_ANY", which sounds a bit suspicious. OpenBSD performs the multicast check, but not the SO_REUSEPORT check. DragonflyBSD removed the SO_REUSEPORT (and INADDR_ANY) checks back in 2014 (commit 0323d5fde12a4). NetBSD explicitly copied our logic and still has it. The plot thickens: 20 years later, SO_REUSEPORT_LB was ported from DragonflyBSD: this option provides similar semantics to SO_REUSEPORT, but for unicast addresses it causes incoming connections/datagrams to be distributed among all sockets in the group. This commit (1a43cff92a20d) inverted the check for SO_REUSEPORT while adding one for SO_REUSEPORT_LB; this appears to have been inadvertent. However: - apparently no one has noticed that the semantics were changed; - sockets belonging to different users can now be bound to the same port so long as they belong to a single lbgroup bound to INADDR_ANY, which is not correct. Simply remove the SO_REUSEPORT(_LB) checks, as their original justification was dubious and their current implementation is wrong; add some tests. Reviewed by: glebius MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D47832 (cherry picked from commit 4f02a7d739b354eef38e19b25866f64842d69414) --- sys/netinet/in_pcb.c | 4 +- sys/netinet6/in6_pcb.c | 4 +- tests/sys/netinet/socket_afinet.c | 240 +++++++++++++++++++++++++++++++++++++- 3 files changed, 241 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 0add5a7c340b..331804545bee 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -928,9 +928,7 @@ in_pcbbind_avail(struct inpcb *inp, const struct in_addr laddr, (inp->inp_socket->so_type != SOCK_STREAM || in_nullhost(t->inp_faddr)) && (!in_nullhost(laddr) || - !in_nullhost(t->inp_laddr) || - (t->inp_socket->so_options & SO_REUSEPORT) || - (t->inp_socket->so_options & SO_REUSEPORT_LB) == 0) && + !in_nullhost(t->inp_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); } diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index de864305b434..04b87819d629 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -247,9 +247,7 @@ in6_pcbbind_avail(struct inpcb *inp, const struct sockaddr_in6 *sin6, (inp->inp_socket->so_type != SOCK_STREAM || IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(laddr) || - !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_socket->so_options & SO_REUSEPORT) || - (t->inp_socket->so_options & SO_REUSEPORT_LB) == 0) && + !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr)) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index 7076f084719a..ba8c03af46a6 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Bjoern A. Zeeb + * Copyright (c) 2024 Stormshield * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,11 +26,17 @@ * SUCH DAMAGE. */ -#include +#include #include +#include + #include + #include #include +#include +#include +#include #include @@ -281,6 +288,235 @@ ATF_TC_BODY(socket_afinet_stream_reconnect, tc) ATF_CHECK_EQ(0, rc); } +/* + * Make sure that unprivileged users can't set the IP_BINDANY or IPV6_BINDANY + * socket options. + */ +ATF_TC(socket_afinet_bindany); +ATF_TC_HEAD(socket_afinet_bindany, tc) +{ + atf_tc_set_md_var(tc, "require.user", "unprivileged"); +} +ATF_TC_BODY(socket_afinet_bindany, tc) +{ + int s; + + s = socket(AF_INET, SOCK_STREAM, 0); + ATF_REQUIRE(s >= 0); + ATF_REQUIRE_ERRNO(EPERM, + setsockopt(s, IPPROTO_IP, IP_BINDANY, &(int){1}, sizeof(int)) == + -1); + ATF_REQUIRE(close(s) == 0); + + s = socket(AF_INET, SOCK_DGRAM, 0); + ATF_REQUIRE(s >= 0); + ATF_REQUIRE_ERRNO(EPERM, + setsockopt(s, IPPROTO_IP, IP_BINDANY, &(int){1}, sizeof(int)) == + -1); + ATF_REQUIRE(close(s) == 0); + + s = socket(AF_INET6, SOCK_STREAM, 0); + ATF_REQUIRE(s >= 0); + ATF_REQUIRE_ERRNO(EPERM, + setsockopt(s, IPPROTO_IPV6, IPV6_BINDANY, &(int){1}, sizeof(int)) == + -1); + ATF_REQUIRE(close(s) == 0); + + s = socket(AF_INET6, SOCK_DGRAM, 0); + ATF_REQUIRE(s >= 0); + ATF_REQUIRE_ERRNO(EPERM, + setsockopt(s, IPPROTO_IPV6, IPV6_BINDANY, &(int){1}, sizeof(int)) == + -1); + ATF_REQUIRE(close(s) == 0); +} + +/* + * Bind a socket to the specified address, optionally dropping privileges and + * setting one of the SO_REUSE* options first. + * + * Returns true if the bind succeeded, and false if it failed with EADDRINUSE. + */ +static bool +child_bind(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt, bool unpriv) +{ + const char *user; + pid_t child; + + if (unpriv) { + if (!atf_tc_has_config_var(tc, "unprivileged_user")) + atf_tc_skip("unprivileged_user not set"); + user = atf_tc_get_config_var(tc, "unprivileged_user"); + } else { + user = NULL; + } + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + int s; + + if (user != NULL) { + struct passwd *passwd; + + passwd = getpwnam(user); + if (seteuid(passwd->pw_uid) != 0) + _exit(1); + } + + s = socket(sa->sa_family, type, 0); + if (s < 0) + _exit(2); + if (bind(s, sa, sa->sa_len) == 0) + _exit(3); + if (errno != EADDRINUSE) + _exit(4); + if (opt != 0) { + if (setsockopt(s, SOL_SOCKET, opt, &(int){1}, + sizeof(int)) != 0) + _exit(5); + } + if (bind(s, sa, sa->sa_len) == 0) + _exit(6); + if (errno != EADDRINUSE) + _exit(7); + _exit(0); + } else { + int status; + + ATF_REQUIRE_EQ(waitpid(child, &status, 0), child); + ATF_REQUIRE(WIFEXITED(status)); + status = WEXITSTATUS(status); + ATF_REQUIRE_MSG(status == 0 || status == 6, + "child exited with %d", status); + return (status == 6); + } +} + +static bool +child_bind_priv(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt) +{ + return (child_bind(tc, type, sa, opt, false)); +} + +static bool +child_bind_unpriv(const atf_tc_t *tc, int type, struct sockaddr *sa, int opt) +{ + return (child_bind(tc, type, sa, opt, true)); +} + +static int +bind_socket(int domain, int type, int opt, bool unspec, struct sockaddr *sa) +{ + socklen_t slen; + int s; + + s = socket(domain, type, 0); + ATF_REQUIRE(s >= 0); + + if (domain == AF_INET) { + struct sockaddr_in sin; + + bzero(&sin, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(sin); + sin.sin_addr.s_addr = htonl(unspec ? + INADDR_ANY : INADDR_LOOPBACK); + sin.sin_port = htons(0); + ATF_REQUIRE(bind(s, (struct sockaddr *)&sin, sizeof(sin)) == 0); + + slen = sizeof(sin); + } else /* if (domain == AF_INET6) */ { + struct sockaddr_in6 sin6; + + bzero(&sin6, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_addr = unspec ? in6addr_any : in6addr_loopback; + sin6.sin6_port = htons(0); + ATF_REQUIRE(bind(s, (struct sockaddr *)&sin6, sizeof(sin6)) == 0); + + slen = sizeof(sin6); + } + + if (opt != 0) { + ATF_REQUIRE(setsockopt(s, SOL_SOCKET, opt, &(int){1}, + sizeof(int)) == 0); + } + + ATF_REQUIRE(getsockname(s, sa, &slen) == 0); + + return (s); +} + +static void +multibind_test(const atf_tc_t *tc, int domain, int type) +{ + struct sockaddr_storage ss; + int opts[4] = { 0, SO_REUSEADDR, SO_REUSEPORT, SO_REUSEPORT_LB }; + int s; + bool flags[2] = { false, true }; + bool res; + + for (size_t flagi = 0; flagi < nitems(flags); flagi++) { + for (size_t opti = 0; opti < nitems(opts); opti++) { + s = bind_socket(domain, type, opts[opti], flags[flagi], + (struct sockaddr *)&ss); + for (size_t optj = 0; optj < nitems(opts); optj++) { + int opt; + + opt = opts[optj]; + res = child_bind_priv(tc, type, + (struct sockaddr *)&ss, opt); + /* + * Multi-binding is only allowed when both + * sockets have SO_REUSEPORT or SO_REUSEPORT_LB + * set. + */ + if (opts[opti] != 0 && + opts[opti] != SO_REUSEADDR && opti == optj) + ATF_REQUIRE(res); + else + ATF_REQUIRE(!res); + + res = child_bind_unpriv(tc, type, + (struct sockaddr *)&ss, opt); + /* + * Multi-binding is only allowed when both + * sockets have the same owner. + * + * XXX-MJ we for some reason permit this when + * binding to the unspecified address, but I + * don't think that's right + */ + if (flags[flagi] && opts[opti] != 0 && + opts[opti] != SO_REUSEADDR && opti == optj) + ATF_REQUIRE(res); + else + ATF_REQUIRE(!res); + } + ATF_REQUIRE(close(s) == 0); + } + } +} + +/* + * Try to bind two sockets to the same address/port tuple. Under some + * conditions this is permitted. + */ +ATF_TC(socket_afinet_multibind); +ATF_TC_HEAD(socket_afinet_multibind, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); + atf_tc_set_md_var(tc, "require.config", "unprivileged_user"); +} +ATF_TC_BODY(socket_afinet_multibind, tc) +{ + multibind_test(tc, AF_INET, SOCK_STREAM); + multibind_test(tc, AF_INET, SOCK_DGRAM); + multibind_test(tc, AF_INET6, SOCK_STREAM); + multibind_test(tc, AF_INET6, SOCK_DGRAM); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_afinet); @@ -289,6 +525,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, socket_afinet_poll_no_rdhup); ATF_TP_ADD_TC(tp, socket_afinet_poll_rdhup); ATF_TP_ADD_TC(tp, socket_afinet_stream_reconnect); + ATF_TP_ADD_TC(tp, socket_afinet_bindany); + ATF_TP_ADD_TC(tp, socket_afinet_multibind); return atf_no_error(); } From nobody Tue Jan 14 14:43:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1f279Lz5kltd; Tue, 14 Jan 2025 14:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1d6dgWz3gpC; Tue, 14 Jan 2025 14:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fxvrOSERdQwOv7+krqNoJbbdR+IDVQ/lZfJACUZtm50=; b=QNIivccVTUyGXVy1qqgMN2eqKwVb0cvDhABWz1IAT2lIB6YZdyqJaYS02XEzs35Q1eKTjy gal4DYsU+T3Rosr+rdSqLLzF+SLwUb6zB3Um4+rrQDCDGf48LnGEoNegDXx0L1G99+CAUw Da7rhQueFgN5fXesExR0bKu3fAChZmzMtGYlS2rR5goRkJi6MV/eZcde26I8n4jixvN4/m uJtAFvPrp83f4yH3XxdZxYCofZlmW05LL4kffAPErAiw3uUw1Bc0qSDnISAbBz437WT3nh LuCSGyY+O8cYLFwupzaGTAzcLf5p21cdjKyngYfjcBFpJK99Yc/iJ6CgoFsxVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fxvrOSERdQwOv7+krqNoJbbdR+IDVQ/lZfJACUZtm50=; b=ac9ZU8/s0n9cpE/Hxf/vHXt0CQeoLrncqEUIkhsgywC60LYxq1CABAsdoyWUTENIfDMPJX veM+sa0RA9W63H9rvc2RgQ4EhTSxMpOUKMFFjshpDv5//Z9inrsubl0lQQorFSxNlAIw7R j8p6BCNNvVV9vJ2YzXQMpLysjzVjkLTrDhe1icydiE/TYyd2h5PB+w+vqZiGkdmJJmWBgN C90DlqBr8m55UQBJFb9WeXVDUlUCdGyLL5onUpke9f0vUnBzcv9EBq+4876Wx/t32hZsy4 mqAQWe7CXvw3GIL+ydboyR/MOIJiAKGseCkF75sOjLcg+B5RLYCbaZM1jHky7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865813; a=rsa-sha256; cv=none; b=azSO7qwJKBRZfpT7cHa3oFXNxTx0Ax3iKJ7qqjr/nMZeNE5/oUkBO/U+9g5y3fUJTuP7KM fcEmrbuUAVkYmZEK4RQ4YshmqeXhA4GozXAsuGLHBPDKL4B5/LGj07lSHYDLN6Qef9Ma12 3GQhtFKFDbhD3LejJhEjwhjCGbjGK6QWO0FllOB6U4JyolUXPJ0wBz2XXxrEp4t93DuAh+ GBUKFZbqld+xByM/hiUL7NKMt1U/+J7OvGEXFEqejp401Uj8BKQYsX5VU/jTLBTkfW0Zze S4pdsbER+g1F5ashkVhq+J88olnPSzUyKL0RhdcWrlqkD8/eM+dW2NozUcyF4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1d6FGNz1Kb5; Tue, 14 Jan 2025 14:43: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 50EEhX4O014139; Tue, 14 Jan 2025 14:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhXfu014136; Tue, 14 Jan 2025 14:43:33 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:33 GMT Message-Id: <202501141443.50EEhXfu014136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1c7f325e76e0 - stable/14 - rc: Document rtadvd_flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1c7f325e76e02f5dd8592574d2b4b2a3adb5065b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7f325e76e02f5dd8592574d2b4b2a3adb5065b commit 1c7f325e76e02f5dd8592574d2b4b2a3adb5065b Author: Mark Johnston AuthorDate: 2025-01-06 23:20:00 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 rc: Document rtadvd_flags PR: 283696 MFC after: 1 week (cherry picked from commit 872686b17e70636f031436b458262eb7dacc5832) --- libexec/rc/rc.conf | 1 + share/man/man5/rc.conf.5 | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 1be8924ba893..3f8b0ae7b42f 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -555,6 +555,7 @@ rtadvd_enable="NO" # Set to YES to enable an IPv6 router # advertisement daemon. If set to YES, # this router becomes a possible candidate # IPv6 default router for local subnets. +rtadvd_flags="" # Flags to the IPv6 router advertisement daemon. rtadvd_interfaces="" # Interfaces rtadvd sends RA packets. stf_interface_ipv4addr="" # Local IPv4 addr for 6to4 IPv6 over IPv4 # tunneling interface. Specify this entry diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index fb010c20af26..2bab31e9d9fe 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 14, 2024 +.Dd January 6, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -3122,6 +3122,14 @@ the interfaces specified in This should only be enabled with great care. You may want to fine-tune .Xr rtadvd.conf 5 . +.It Va rtadvd_flags +.Pq Vt str +If +.Va rtadvd_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr rtadvd 8 . .It Va rtadvd_interfaces .Pq Vt str If From nobody Tue Jan 14 14:43:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1d3LTNz5kmDM; Tue, 14 Jan 2025 14:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1c5mw7z3gPm; Tue, 14 Jan 2025 14:43:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlNdvHQxDkWU15IAN9mjo8QrJsudpGfx2yAE74qGgg4=; b=e83VNDavZ93OjsmxpDOieNJF6mqxnHr9SzrUkitfGM+A/bIbrqk6i1avC2OaIqlMOVTeD8 tIQH+LAHl5fKVTJyOb07qGNMHu8VZwriX3Jr413GL+Cp2j3599G3RbB5BRH8peuc1Ycqin B5HYjCWtoQ/ffVxKfFrl8Vz0bWGKyHywKWNX3Q8wsumlpBJW80Y2l2Jp4qFMm1sL0O778J LaYpQG5Mbt2ewTMOHOR5BlWwX3yXK3zgRDmGXF4FqmKMr/qH+qpceIqbrSdtwqMzzyyEYy sUo6K6UvQwLhMU+zTj+uNvkD1m2r3GQffghOHGON/EZAuied6PJG0Q+bb819Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlNdvHQxDkWU15IAN9mjo8QrJsudpGfx2yAE74qGgg4=; b=AIQ/NcrgQT4CSVzBHShskslwatwLt8Byh3YwJ6nEfBngoctpKVpPAb4JdX0SgYAn0VKrPS vxZduQJUFlByeFWazcktfKO6c5U5c4wngIEb/5PZYfWvKw2ZqV+XqN6klf27GCCdO0cmYV XxNkrXhmA/CqCb2Ube+0xuUfY5ODVwHDC+KAbfZ+hUXk0Kss2n4HntyfqaigIlXExt4mwm hJV0uZ9nYnNMpTx2NAxWSFGxs/Berr5dXfLpqlKG+/q5YNcxKL0RvBRWNO1stBP5+QtJ73 YeLokDlifUQzqMZj5ifJJUu6CHkzS9HnAY3vUAOvksAMLJCs2Kgrc9RUb87Ikw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865812; a=rsa-sha256; cv=none; b=PXrBbvER4Bqk1dOkDX0V9ruBXLGMcnGKYwgxCkTcRFt2XuqU67C6Zjf59d2vnhiIwwhARr Eyb6HMCv1v3J+uy4rhUhImmeS9VcZDWpAi+64YfdUNbb4yC7nqy5OFkboHpite7XH4TcvC iyNXh986FFHfa2VgD87fU1yoFMjA6YV5B8dyAMG2QsNyv9N4BuwiRf+Yl2F/y33dFnR3Zs 6+4LhAp7wTG19uzpy+7WabVvwIWLGylmv7qzypCvhQeZ/PewQTCfBypd7ZMGb2BVjk9u+1 buQW8tshzHDqFvRvB3MtTIMjySv04qkBtgHix39PNSf8XVGblXBUR0RvnBJnjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1c5MVhz1Jgk; Tue, 14 Jan 2025 14:43: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 50EEhW61014097; Tue, 14 Jan 2025 14:43:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhW06014094; Tue, 14 Jan 2025 14:43:32 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:32 GMT Message-Id: <202501141443.50EEhW06014094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5f610cf1ec62 - stable/14 - inpcb: Close some SO_REUSEPORT_LB races List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5f610cf1ec62ee7c9843a2eee5010901f3ebdbe6 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5f610cf1ec62ee7c9843a2eee5010901f3ebdbe6 commit 5f610cf1ec62ee7c9843a2eee5010901f3ebdbe6 Author: Mark Johnston AuthorDate: 2024-12-12 14:02:12 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 inpcb: Close some SO_REUSEPORT_LB races For a long time, the inpcb lookup path has been lockless in the common case: we use net_epoch to synchronize lookups. However, the routines which update lbgroups were not careful to synchronize with unlocked lookups. I believe that in the worst case this can result in spurious connection aborts (I have a regression test case to exercise this), but it's hard to be certain. Modify in_pcblbgroup* routines to synchronize with unlocked lookup: - When removing inpcbs from an lbgroup, do not shrink the array. The maximum number of lbgroup entries is INPCBLBGROUP_SIZMAX (256), and it doesn't seem worth the complexity to shrink the array when a socket is removed. - When resizing an lbgroup, do not insert it into the hash table until it is fully initialized; otherwise lookups may observe a partially constructed lbgroup. - When adding an inpcb to the group, increment the counter after adding the array entry, using a release store. Otherwise it's possible for lookups to observe a null array slot. - When looking up an entry, use a corresponding acquire load. Reviewed by: ae, glebius MFC after: 1 month Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48020 (cherry picked from commit a600aabe9b04f0906069a8fb1f8d696ad186080f) --- sys/netinet/in_pcb.c | 94 ++++++++++++++++++++++++++++---------------------- sys/netinet6/in6_pcb.c | 13 +++++-- 2 files changed, 63 insertions(+), 44 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 331804545bee..15729bcd1ce3 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -255,9 +255,8 @@ static void in_pcbremhash(struct inpcb *); */ static struct inpcblbgroup * -in_pcblbgroup_alloc(struct inpcblbgrouphead *hdr, struct ucred *cred, - u_char vflag, uint16_t port, const union in_dependaddr *addr, int size, - uint8_t numa_domain) +in_pcblbgroup_alloc(struct ucred *cred, u_char vflag, uint16_t port, + const union in_dependaddr *addr, int size, uint8_t numa_domain) { struct inpcblbgroup *grp; size_t bytes; @@ -272,7 +271,6 @@ in_pcblbgroup_alloc(struct inpcblbgrouphead *hdr, struct ucred *cred, grp->il_numa_domain = numa_domain; grp->il_dependladdr = *addr; grp->il_inpsiz = size; - CK_LIST_INSERT_HEAD(hdr, grp, il_list); return (grp); } @@ -294,6 +292,24 @@ in_pcblbgroup_free(struct inpcblbgroup *grp) NET_EPOCH_CALL(in_pcblbgroup_free_deferred, &grp->il_epoch_ctx); } +static void +in_pcblbgroup_insert(struct inpcblbgroup *grp, struct inpcb *inp) +{ + KASSERT(grp->il_inpcnt < grp->il_inpsiz, + ("invalid local group size %d and count %d", grp->il_inpsiz, + grp->il_inpcnt)); + INP_WLOCK_ASSERT(inp); + + inp->inp_flags |= INP_INLBGROUP; + grp->il_inp[grp->il_inpcnt] = inp; + + /* + * Synchronize with in_pcblookup_lbgroup(): make sure that we don't + * expose a null slot to the lookup path. + */ + atomic_store_rel_int(&grp->il_inpcnt, grp->il_inpcnt + 1); +} + static struct inpcblbgroup * in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, struct inpcblbgroup *old_grp, int size) @@ -301,7 +317,7 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, struct inpcblbgroup *grp; int i; - grp = in_pcblbgroup_alloc(hdr, old_grp->il_cred, old_grp->il_vflag, + grp = in_pcblbgroup_alloc(old_grp->il_cred, old_grp->il_vflag, old_grp->il_lport, &old_grp->il_dependladdr, size, old_grp->il_numa_domain); if (grp == NULL) @@ -314,34 +330,11 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, for (i = 0; i < old_grp->il_inpcnt; ++i) grp->il_inp[i] = old_grp->il_inp[i]; grp->il_inpcnt = old_grp->il_inpcnt; + CK_LIST_INSERT_HEAD(hdr, grp, il_list); in_pcblbgroup_free(old_grp); return (grp); } -/* - * PCB at index 'i' is removed from the group. Pull up the ones below il_inp[i] - * and shrink group if possible. - */ -static void -in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp, - int i) -{ - struct inpcblbgroup *grp, *new_grp; - - grp = *grpp; - for (; i + 1 < grp->il_inpcnt; ++i) - grp->il_inp[i] = grp->il_inp[i + 1]; - grp->il_inpcnt--; - - if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && - grp->il_inpcnt <= grp->il_inpsiz / 4) { - /* Shrink this group. */ - new_grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); - if (new_grp != NULL) - *grpp = new_grp; - } -} - /* * Add PCB to load balance group for SO_REUSEPORT_LB option. */ @@ -386,11 +379,13 @@ in_pcbinslbgrouphash(struct inpcb *inp, uint8_t numa_domain) } if (grp == NULL) { /* Create new load balance group. */ - grp = in_pcblbgroup_alloc(hdr, inp->inp_cred, inp->inp_vflag, + grp = in_pcblbgroup_alloc(inp->inp_cred, inp->inp_vflag, inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, INPCBLBGROUP_SIZMIN, numa_domain); if (grp == NULL) return (ENOBUFS); + in_pcblbgroup_insert(grp, inp); + CK_LIST_INSERT_HEAD(hdr, grp, il_list); } else if (grp->il_inpcnt == grp->il_inpsiz) { if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { if (ratecheck(&lastprint, &interval)) @@ -403,15 +398,10 @@ in_pcbinslbgrouphash(struct inpcb *inp, uint8_t numa_domain) grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); if (grp == NULL) return (ENOBUFS); + in_pcblbgroup_insert(grp, inp); + } else { + in_pcblbgroup_insert(grp, inp); } - - KASSERT(grp->il_inpcnt < grp->il_inpsiz, - ("invalid local group size %d and count %d", grp->il_inpsiz, - grp->il_inpcnt)); - - grp->il_inp[grp->il_inpcnt] = inp; - grp->il_inpcnt++; - inp->inp_flags |= INP_INLBGROUP; return (0); } @@ -443,8 +433,17 @@ in_pcbremlbgrouphash(struct inpcb *inp) /* We are the last, free this local group. */ in_pcblbgroup_free(grp); } else { - /* Pull up inpcbs, shrink group if possible. */ - in_pcblbgroup_reorder(hdr, &grp, i); + KASSERT(grp->il_inpcnt >= 2, + ("invalid local group count %d", + grp->il_inpcnt)); + grp->il_inp[i] = + grp->il_inp[grp->il_inpcnt - 1]; + + /* + * Synchronize with in_pcblookup_lbgroup(). + */ + atomic_store_rel_int(&grp->il_inpcnt, + grp->il_inpcnt - 1); } inp->inp_flags &= ~INP_INLBGROUP; return; @@ -2112,8 +2111,11 @@ in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; struct inpcblbgroup *jail_exact, *jail_wild, *local_exact, *local_wild; + struct inpcb *inp; + u_int count; INP_HASH_LOCK_ASSERT(pcbinfo); + NET_EPOCH_ASSERT(); hdr = &pcbinfo->ipi_lbgrouphashbase[ INP_PCBPORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; @@ -2172,9 +2174,17 @@ in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, grp = local_wild; if (grp == NULL) return (NULL); + out: - return (grp->il_inp[INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) % - grp->il_inpcnt]); + /* + * Synchronize with in_pcblbgroup_insert(). + */ + count = atomic_load_acq_int(&grp->il_inpcnt); + if (count == 0) + return (NULL); + inp = grp->il_inp[INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) % count]; + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + return (inp); } static bool diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 04b87819d629..b3b2f03451aa 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -922,6 +922,8 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, const struct inpcblbgrouphead *hdr; struct inpcblbgroup *grp; struct inpcblbgroup *jail_exact, *jail_wild, *local_exact, *local_wild; + struct inpcb *inp; + u_int count; INP_HASH_LOCK_ASSERT(pcbinfo); @@ -983,8 +985,15 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, if (grp == NULL) return (NULL); out: - return (grp->il_inp[INP6_PCBLBGROUP_PKTHASH(faddr, lport, fport) % - grp->il_inpcnt]); + /* + * Synchronize with in_pcblbgroup_insert(). + */ + count = atomic_load_acq_int(&grp->il_inpcnt); + if (count == 0) + return (NULL); + inp = grp->il_inp[INP6_PCBLBGROUP_PKTHASH(faddr, lport, fport) % count]; + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + return (inp); } static bool From nobody Tue Jan 14 14:43:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1j59Ljz5km4q; Tue, 14 Jan 2025 14:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1j2FyHz3gVS; Tue, 14 Jan 2025 14:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcRx5xHL0LWGjmdOY02B8mLP4REITCUc5mnNEkIjwy0=; b=KAzK+p7yGww/tsEhQxgMesZ1qr+hNSVmMP0ucJqF5hZvusiI3cFV1DEE6t+6vpWDh8wyin MgnrI8w4sAQHIyk4665poCz/rAHpUfuAok9IFsDxbIG+mqgjUUc/LPvULy7eiDW0IkDeyn fPEbYUZe18Zd3v4Wry4GC022u4j68HbHTyk1TwTA0RViMLdW/wn1WpT4ovwqc+ghKHRdic 6CfDQ6zm5AR3AS77mtRVnpUJr0p92C1zHPU5cD++QSZI9NH0miu6kNoJ5LKoGXJl/0bdDI 3v6/tdZo5tRsHzLujGKQm46TbGgi0JOPqjfUHNCuvevEB08m4cKXZ0GadM7IHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OcRx5xHL0LWGjmdOY02B8mLP4REITCUc5mnNEkIjwy0=; b=TKhsaMPeMx5ld7hTUq1SA93eQI1o2lRLtmHD+i+iChWplio54QrAn3XVyRkW87j5PrehH+ U2E6RUAGX0cBo88hUni406vxCyhx7D250viVvw/hEeu7RkfpR0HlIiXhiupTXwtz1pOnXg nVqIPlF4SzdgdW+VcTlaz4pHEj5su+eA8arTomObODCCGdxW2K8g5DAT1GWed7ZK4Mg9s5 QsxUWlCm0ZPeoE3dNhoFJIdkE5VY1CVws4WbTDaJNW1rQGFcBa9vIyZrB6JJAAhlhlvADy v7jybXMkI1SJKP+2wmLn8k5Y7u6fizFvHYw0H4AzWYaw19OQawfovPWL45jdvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865817; a=rsa-sha256; cv=none; b=q05wX48hez5bDLcJcnEJC1/PbMIZPp2/nfJSBZ1B4iDEjEGJE+5JWF7DZOjIXUxG+hMXH9 JKh1VPL/E/eMxZm/zaumM9RVbuV64TF9A/B5YifqcZz/HreH+QkjPK0HYh7/ap9OjnY5VW KpzZ4UXY7J1ELIzdUpK5u4pkBiKVWFdUNrY/7RcKRG92tYYwxL3d/pCbWdEvHtPTvFkXIB iQvpS6eFLdeBMpzu3KrZzcz1EcIGfX1USJJGnerXzupnMVqpcBb3khjGe872Ko8siwya6K ITGSazA+5FzjZ6KzYxE5iZ4b/ga01jg9VA+VuLCXnfOst+FuywD1J3Scz7p6yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1j1sSgz1Kgk; Tue, 14 Jan 2025 14:43: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 50EEhbiN014291; Tue, 14 Jan 2025 14:43:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhbdH014288; Tue, 14 Jan 2025 14:43:37 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:37 GMT Message-Id: <202501141443.50EEhbdH014288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e59fdfbf2524 - stable/14 - makefs: Remove dead code in inode_type() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e59fdfbf2524a320dbe4bcfc8fce30ef1e22f860 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e59fdfbf2524a320dbe4bcfc8fce30ef1e22f860 commit e59fdfbf2524a320dbe4bcfc8fce30ef1e22f860 Author: Mark Johnston AuthorDate: 2025-01-07 14:30:53 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:27 +0000 makefs: Remove dead code in inode_type() No functional change intended. MFC after: 1 week (cherry picked from commit 2be86b6cc168615e19350710347b77616c4b7f19) --- usr.sbin/makefs/walk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c index 56e2d19c6f00..98ddb53f7917 100644 --- a/usr.sbin/makefs/walk.c +++ b/usr.sbin/makefs/walk.c @@ -605,8 +605,6 @@ inode_type(mode_t mode) return ("symlink"); if (S_ISDIR(mode)) return ("dir"); - if (S_ISLNK(mode)) - return ("link"); if (S_ISFIFO(mode)) return ("fifo"); if (S_ISSOCK(mode)) From nobody Tue Jan 14 14:43:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1j17Mhz5km32; Tue, 14 Jan 2025 14:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1h1jbCz3gky; Tue, 14 Jan 2025 14:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHKUpqXiNufqT9/JtAy0N+mxcWnwNVnNB5IUgH1WoiQ=; b=T81gBDZeYf/TpiA5ouUP+KgfBR4HKrRdjfGSqA1MuF/1wysKB0A3PSbpUPpZTloW+WEjAz 6YHtRxTIs4yDXbtd5fb8cnHsWaoTNiFy2Z7SeO3hZ+RwA+xU7vuHphx118IDragOGd1Pe+ uqVVaBuYYZR6aKlyOORuO3Lb6rREeW/jvLF3/fLtQJgoq4Sd4ELCHJPVb2kn7Pl1HWitCU Ofkv0iOe/2UmORoZAPyK0Qhi9GHQM+EsW1zY7N+1X9CJTpNoHLUjJ8xVyFLY0KlsSXuQGq 0QB3iR4eYwxRuH2YcRbCfN8eZQ0U0SmO6AixDxZSQsI73RvwGGisZRQRlpXCNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHKUpqXiNufqT9/JtAy0N+mxcWnwNVnNB5IUgH1WoiQ=; b=eydiUvUW6yrix9YYVMZOMHK1BVgCykWrPCpILQao/Q71hM/BaYY5teBDjo7wzPi/jfrD/D d2DOMsN7j4c2bBqZ92Q+S3xFb4kvRiNLNHqvXAwuRpqzG5+mm6PDe/lsfdbcIlV3DjQF50 M+B96UxhC+vEI/Kza4d/UTbqncQu0xMyKzy4zavyE9zTvN9iTzI21GSlDleEu08uMZJ0XQ /RFYQQJhf8VgwYSrJVM9czacew53zQim9aKS9G/Ke5LTUz+nDnLDKRjp1ruj2w4i0leQpY eWm1E2dMppxRXAyX3ngxirCJiqKjb1KwKVjSCd3+zg8x+dq/VymV6nON/VZ8SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865816; a=rsa-sha256; cv=none; b=kX3mU5ZzMeAQYTpqUAodJnidwdntqjFyEam3nnM1B1XzQFINvG/X5PrPOO4fs2eEmJR2si 2skZbAF233n7TGqp2+uXcG7viyAZ1FkQwf/9K8OgpEMrwyt8uMCKgVsRxv43IVMirXgKgg bzFGTyb5VPyZbMdvGg6zSSFK9opnUQdPSvnwli1mLBwYpHh1q0Pmc6aA/m/h4euY3p2A9I NRyYNmpt3S47Qi6Y/E82ann9mdlTzJ63EW3Td9JJ8OL7U4xxlmhySKOOR+Mz9FnQb4DvV5 UcZQhYKlRceQV7hfMNdCb6BaB6ClDi/YGvjWmnWNgf1e4N1gNJtb4HM5FfO8mQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1h17jvz1Kb6; Tue, 14 Jan 2025 14:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50EEhau1014246; Tue, 14 Jan 2025 14:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhaAf014243; Tue, 14 Jan 2025 14:43:36 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:36 GMT Message-Id: <202501141443.50EEhaAf014243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ad3a4bbf4ee8 - stable/14 - bsdinstall: Fix a typo in a comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ad3a4bbf4ee80c4f93413c65c90dcbd35254664e Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ad3a4bbf4ee80c4f93413c65c90dcbd35254664e commit ad3a4bbf4ee80c4f93413c65c90dcbd35254664e Author: Mark Johnston AuthorDate: 2025-01-06 22:56:07 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 bsdinstall: Fix a typo in a comment PR: 283507 MFC after: 1 week (cherry picked from commit 5bf3ac7ae219f126cf3965be97a2d718007c1be4) --- usr.sbin/bsdinstall/scripts/zfsboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 93d9490f972a..4f3c9719dde0 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -139,7 +139,7 @@ f_include $BSDCFG_SHARE/variable.subr # # Default ZFS datasets for root zpool # -# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BOOTFS_NAME/$ZFSBOOT_BOOTFS_NAME +# NOTE: Requires /tmp, /var/tmp, /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME # NOTE: Anything after pound/hash character [#] is ignored as a comment. # f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS=" From nobody Tue Jan 14 14:43:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1g45cXz5klZG; Tue, 14 Jan 2025 14:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1g0ZpVz3glx; Tue, 14 Jan 2025 14:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YqCYaCSNfJGhcSRtHgnipbU+lW6f6V6Ocgrt0LzSFY=; b=gOaTcjE9NwvobCoZI0Fe2LUS1Uk0QVw2H+P3mJoc+XL5vBaUjsUHhv4LhBsiGlxRS21B1q 88Rd8bmJKgP5IHHMq2RKfkU04WtvVJQ0xJweY/+XSmOfgmk9Jn/p7lGz/eekMH4uu5Dkzj Mf5cZmHnIHM5+3+LLwns6inOujcmpOFXkn21VP/nj6d0AG1f7sCx4Q+k5LzfZcK11fTSWM Mpplasq9JWnTl2GqnFxuiHMlkWeo2NKKplffavWmYg3QechkcbvMtKfIHw3A8IIfOTqars nLYkRRmxidq/8F2OM8VC2vTfPLn1Us6RIboyp9GU8NLSZ/jQXC7OIq7Nge4Rkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YqCYaCSNfJGhcSRtHgnipbU+lW6f6V6Ocgrt0LzSFY=; b=wlmKNwnFbqhLBGsAqmqKtDcVbHi+N6YWfAjJJ35FxqbRFNaioZl9oytPk2T+OdJu5fOydp qTmiit0NoiDxXj6fv6k1LXytaDDbXEQSqOD6Avoit7nym18KuHQC8tuRTmObygEOr8YxlI bPQpy3UylTqvcZwb+ctHBrriySlhzTxT08YZJK8IuEUT9zHYU9rKvQoHqnJIrj9+SPprAG V0/DY9RrksrQUd7kvRTAlBPbqAFHMcELYBfeNOj/RIHTNQXv6rWYnakjFrJwSWLGsmoSX0 Q5nd1+ImBaP/jtKuKKA86w3qCiZeAqAbmhCna0jH1x9wD0DCtVScJPOKkQkTTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865815; a=rsa-sha256; cv=none; b=WZyudxhlZMFgkXIBJ1OKpgTi1DMsJH5yV+hnNNmVr+6zUSTNf1si1w1nBWA4tJdufQXD+b aevtoFgYZxoWFDaliDw4r8bve/YBJG9A7XkAW+jX9Q9VfSWjcQcZmYbe2ubytZGZeBS+Hp vMZxSlNNCD1Qw1eJknEPwpWoYEF/2AmClhXCRqi9CxgIUvBUX+W6rQ865yBHH9zQE1plTc A4nGw4a7f5tA8d7ellTBOmT5Ena2JNc+proy4NZuD4vXtPtZgDSRn8lEgi0lOLQydDJMos Hkf72hQtE4psDxVX0h/P/WuV9bMJ3eHbCNghRHbm88Q2g7tawvggnGVBLRgbnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1g074wz1K9L; Tue, 14 Jan 2025 14:43: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 50EEhYlq014195; Tue, 14 Jan 2025 14:43:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhYRD014192; Tue, 14 Jan 2025 14:43:34 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:34 GMT Message-Id: <202501141443.50EEhYRD014192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 872da05f8c61 - stable/14 - SO_SPLICE tests: Fix a comment typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 872da05f8c616fb94ae0754a93424e90f041e68d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=872da05f8c616fb94ae0754a93424e90f041e68d commit 872da05f8c616fb94ae0754a93424e90f041e68d Author: Mark Johnston AuthorDate: 2025-01-06 20:53:52 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:24 +0000 SO_SPLICE tests: Fix a comment typo MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit 9743e9efdf5f0d2338d7cfeed8f09d89d889bac4) --- tests/sys/kern/socket_splice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/kern/socket_splice.c b/tests/sys/kern/socket_splice.c index 3970f16b34dc..3a85ae91ecc7 100644 --- a/tests/sys/kern/socket_splice.c +++ b/tests/sys/kern/socket_splice.c @@ -330,7 +330,7 @@ ATF_TC_BODY(splice_capsicum, tc) tcp4_socketpair(right); /* - * Make sure that we splice a socket that's missing recv rights. + * Make sure that we can't splice a socket that's missing recv rights. */ remove_rights(left[1], cap_rights_init(&rights, CAP_RECV)); splice_init(&sp, right[0], 0, NULL); From nobody Tue Jan 14 14:43:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1l3Fdbz5kmKH; Tue, 14 Jan 2025 14:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1k3P40z3gxj; Tue, 14 Jan 2025 14:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFjokFCsOeP2NmLCiL3OOxc0osbp6c5KyIX6i4wI4xg=; b=l+vQncYML16ApLoY1hDqzlWVqdPgtJ48Z9V4yZIgJjEPiYCKZJDfWd888UIzZrEZRvLOZ0 lEWfQRMTfAT3jXRfVudR1bS6nOTp3QryB6+ibSQSQKePDuOdf8piKn1fvEK1st3ofWuJh+ XI3/zUXTPPNMi9NKgcH7FithJF/LrlDzAag0ASnak3AePCvwikMRict72TdsL/t4JriO3/ OIeHwJ4Hph7tmvLXWpxG8oUBqW7+6JpDf2FFSShFW4kOSnATd4sUIHMW4L7yNDqjKEPriU lA1kwrowUyL/4dmrhbVYGESzPVk7hn+PMlEbcQBp+2Yrr3oESQJVDIHRQTeInA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFjokFCsOeP2NmLCiL3OOxc0osbp6c5KyIX6i4wI4xg=; b=Pb6Mislvid+p63KSAVnckw1l28mu6nArmenbvQYLoZFAoE/03XYpJbVmqosZXbQ3R1MWag kN8DOHpRKfZ1FZc9EYmj4KfKphTWfcWTfYSsS+bP4P9ht/1TYQOGsaET/a4t9XUn5NG6x+ X+23VMxnFeWYhdjfp7AA/DND2CnJBORH/UVbf5T50BO6pPJrA2+67IHMD4ikgjzzA0EfMW 49gSnTbYleZ9J0pkj7OXGHLQ9a4WQ+MfjzaAQJKMrGJHPGsuKNzMWltIewovM/oCiQTwEb niRoSANXlmLp68X8jYBf6NR+fIp7OelkI19c9BASnuw10s0CNJn3uzUlIQ445A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865818; a=rsa-sha256; cv=none; b=QnauCvJwZ4bmqpBvblD5ZSTSnI0UIqzwke8bGdcHjTlMbv4f5vyVDCikF8n2d48RaE/pM9 r5vHD0dmbWk7xBbeouDHeP8C7sPJ/oE9PtRPj9FLi2QD1wZsKgVbYb/U763WzcUlX3OBtK Xf6pzVwn/h95YIEnbutPGzlobWiI+G39a1Bqj2cX8D+ZZVObmNcM+vnfLykvVFAiSrBOKt ccmWRc06orJsHyNEN+exBB+DSRWF+LguWTs0wufvDb28fHDJb904eJ34x0bkVfcVrfc5MY 3w0cYD3I4yY+YMpHeeSij6mnc7NRe6Nan9t4iyWyuC4P9MxToPv453EtLA1qzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1k2rMPz1Kgl; Tue, 14 Jan 2025 14:43: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 50EEhcqt014345; Tue, 14 Jan 2025 14:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhcEU014342; Tue, 14 Jan 2025 14:43:38 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:38 GMT Message-Id: <202501141443.50EEhcEU014342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e39435733339 - stable/14 - rawip: Take the inpcb lock when appropriate in rip_ctloutput() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e3943573333937b881d4b7839c0b7d8595753d21 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e3943573333937b881d4b7839c0b7d8595753d21 commit e3943573333937b881d4b7839c0b7d8595753d21 Author: Mark Johnston AuthorDate: 2025-01-07 02:20:05 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:35 +0000 rawip: Take the inpcb lock when appropriate in rip_ctloutput() Reviewed by: glebius MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48344 (cherry picked from commit fd94571ccf0c9c6521063c08a72a760873e87897) --- sys/netinet/raw_ip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 04b12b6587dd..c30878d48c74 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -627,8 +627,6 @@ rip_send(struct socket *so, int pruflags, struct mbuf *m, struct sockaddr *nam, * * When adding new socket options here, make sure to add access control * checks here as necessary. - * - * XXX-BZ inp locking? */ int rip_ctloutput(struct socket *so, struct sockopt *sopt) @@ -639,7 +637,9 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt) if (sopt->sopt_level != IPPROTO_IP) { if ((sopt->sopt_level == SOL_SOCKET) && (sopt->sopt_name == SO_SETFIB)) { + INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; + INP_WUNLOCK(inp); return (0); } return (EINVAL); @@ -709,10 +709,12 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt) sizeof optval); if (error) break; + INP_WLOCK(inp); if (optval) inp->inp_flags |= INP_HDRINCL; else inp->inp_flags &= ~INP_HDRINCL; + INP_WUNLOCK(inp); break; case IP_FW3: /* generic ipfw v.3 functions */ From nobody Tue Jan 14 14:43:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1n4FKfz5kmKN; Tue, 14 Jan 2025 14:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1l4Km0z3glX; Tue, 14 Jan 2025 14:43:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSp33bLh7CF9MyjOIJmPZ0e4vztMZuqhX9UxGLNiLMk=; b=JTRQsp6p/TpqzRGgGOJWH5+0X9wLzLXSebuCSlcOwnpNwKaBf/wMt3b5kthQScpPE3lhP0 pzM+5PkoEWC2iikfk1Uwo32YnfmT/7EmLAeoKeyEnEmfWhFQgIBFRmDzL3Vko+6TsXF9rQ ai3/oleUl3VEoJUziFWCTPWA3ci777FgIxhGdKpvscWwlO5bOJc7kkCrYqIkTIMD0ElVp4 nd5bXHV0oiV/gvhALnz8i47kGgYKHZco8Lv5nV9lieCvz1reZFn8SRR8jzh3RIiyzG1vBZ KCotL10PNKZaI2sW6DSthoN0TVp8SceZ5RAaZvWhB7O4uF18JIjePOos9fk5KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSp33bLh7CF9MyjOIJmPZ0e4vztMZuqhX9UxGLNiLMk=; b=Pgv9bKKAYGCokMTPffeh4wHtcQ6X9817TAknXYTITwQ+tpdHIzchPYh7nYO2LGPugRgEqH A16j9jmul7ZCSYkbl3I0UsqYntAGxgEwnvYEBhRLs5Gd3zeWQtzyOUtZmiSGmAFYF5dAe2 I8UKEy643hZkPC0zHVZ71a5XKo6dJeINXfRshmyLhF8P1Yg60D60r4ee1XRhjGV7Svpik6 8BYNcTJsRs7GIh5G30Sjg5uRhxUum8S8uhEAmDthm7+jfhTgwSgAlWb3KIgPfgZpP0nnXa 93jZSEHl2uwDHQoGb1N7NOIByMVjs/aGKYXDTu5RCLqlTheO1DfW5bvjU7w+SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865819; a=rsa-sha256; cv=none; b=scRW+jLonRe6roYN6jDMJS4nnSIaSg6xcNRtpgjGbuZRfKejyA9EL9V0cjWzdwmYt186aZ 677YtIsL/cdghBxEqCifhF0Ye2oM8St4b3Ub1ogNxJ118oOdix4Vvfxb4RIjvE+wLwirfI ifUpeKChQQ3O+WWHhDBY4/5RzrTZR5aOOi8a+VJtc3K597CyQlktUMSVkxQdXPKk6tCnCH TO3Kp6oU75EMwKZkfwq9OqSzdN2VkDBYnHaMhIuJlo+c88UNo6n5XeteazBtATP0ORc+tM hQszFyz7LoNeKTqVtQNofg6uM6MwK1Feldj7B12WsvWk9gff6V62Q4MsvmNPaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1l3xLkz1KYK; Tue, 14 Jan 2025 14:43: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 50EEhd5u014394; Tue, 14 Jan 2025 14:43:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhdmw014391; Tue, 14 Jan 2025 14:43:39 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:39 GMT Message-Id: <202501141443.50EEhdmw014391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f849557c06e5 - stable/14 - x86: Short-circuit ipi_all_but_self() on UP systems List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f849557c06e55e7ebedc1b5c873fdf5111587918 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f849557c06e55e7ebedc1b5c873fdf5111587918 commit f849557c06e55e7ebedc1b5c873fdf5111587918 Author: Mark Johnston AuthorDate: 2025-01-07 17:58:58 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:42 +0000 x86: Short-circuit ipi_all_but_self() on UP systems Apparently this is required on old intel hw, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275086#c3 PR: 275086 Reviewed by: mav, kib Fixes: 279cd05b7e4d ("Use APIC_IPI_DEST_OTHERS for bitmapped IPIs too.") MFC after: 1 week Diagnosed by: Ben Wilber Differential Revision: https://reviews.freebsd.org/D48361 (cherry picked from commit 254a2b767f9a39f1541e0a07a70bbe269e86ad70) --- sys/x86/x86/mp_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 11b11471d736..c52102e2de1e 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1427,6 +1427,9 @@ ipi_all_but_self(u_int ipi) cpuset_t other_cpus; int cpu, c; + if (mp_ncpus == 1) + return; + /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit * of help in order to understand what is the source. From nobody Tue Jan 14 14:43:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1n4m2Yz5km0V; Tue, 14 Jan 2025 14:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1m5XBDz3gXY; Tue, 14 Jan 2025 14:43:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kks3cjLkLiXrh7VSQlEz7eFGD04K7doulpuCbGc2i+E=; b=nNCIpUA24W7sk+EF3DQE+Mi9gEaaWnBawTOUAaCX721qMb5X7jB2gmH6iRj6G7tnwyfs7N xtwFTnsprWXQJNxqabrzDmUMxVeyxN/DwAGtyasgQJNrVjyY8HJ5mEQ14fPFwkd+Ilsfq9 /4OyP6C1iEV2tmrl15kTVv1VeNYCYSZPC09yqAk5iJGUGayMqRv0LfS8Wkgv68JVwgW9J1 GPjnUlDHG2tv/rvKUS1ajgldm0qCiRzLehNLu68fbLfQ6yvLykE3XPm+Ojc46bBfG2D2rc TNz90K8IdpNc7IksSOpQik7q9R9YFox/ZRG1XvnKIMJ0sUg47iXynvemonGm0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kks3cjLkLiXrh7VSQlEz7eFGD04K7doulpuCbGc2i+E=; b=EnZTodd4BExvW0lbygFVyMivMgeS508bJ4cnskSFqg7wukPOkn4Lrartzye+j3GfPgRhpp qjDMGuvl9E4iQS6LPJ1aaNhtkMEhJce++vlmuPBk5ijasU6nlJYyQoUrLhoBdjtp7lcOHI i1fQLjZxlkPXnqxYVKuWdvemxGoJPMB9YzCFzZkTDhncku5LJ8XUc+LlmOOE/MIHnIvOs1 /naqeaibAv9zu9nnI5HMLTIjPzDznzcyUijfcDffcs4aMEwocYCbGasJmQaZm2HOB67HKJ +qdrXr3giN2JXyUSQ6Y3412YkBoOT0Wm+C4g3oZPT09OY5rGAz3mS3OyoSZ1Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865820; a=rsa-sha256; cv=none; b=lQozMmvuPqfzwe2/glJ4EvrEqNpdfMOvPMKZUmlTdhmoHy+IhaajK8Tmw9gNbYSfLbhO/N Qwx3EnX2LRNlnjL23Sw+sW49n6/ffS7b8+vmTA7858q/JZiGc6qMU9qPpMlkXqrGURAm2p jSZ/ZDbm/BjmardbiQO2+byvxbQqTqV+WQx4/Bg7PVXKn5kJk0ZHoFbqiVC+9RDmRjGLzY Pi9ZB3M1HGoxLYNDz1Bd2iqFCC3kmY9f3K+Lor6nqfkCBYdhpBd0uMRYGr2JR4s/su7K8B 1jPAliX8TP8h75Fp3Ge0gODcHuqC1kRQOpWneXoc3ieM6WhXtqMq+zz74OUNNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1m4ybnz1KYL; Tue, 14 Jan 2025 14:43: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 50EEhet5014468; Tue, 14 Jan 2025 14:43:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEheL2014465; Tue, 14 Jan 2025 14:43:40 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:40 GMT Message-Id: <202501141443.50EEheL2014465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 0325afa63942 - stable/14 - ktrace: Make -t t trace struct arrays as well as structs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0325afa639424ba3960b5487867d07b19c3995b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0325afa639424ba3960b5487867d07b19c3995b1 commit 0325afa639424ba3960b5487867d07b19c3995b1 Author: Mark Johnston AuthorDate: 2025-01-07 14:31:15 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:15:00 +0000 ktrace: Make -t t trace struct arrays as well as structs Otherwise there is no specific -t option which captures struct arrays. MFC after: 1 week (cherry picked from commit 596ee234ef4537e71f030e13598ecbe73ee697bb) --- usr.bin/ktrace/ktrace.1 | 2 +- usr.bin/ktrace/subr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 5cc6df52d69a..bab58c99c71f 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -132,7 +132,7 @@ trace capability check failures .It Cm s trace signal processing .It Cm t -trace various structures +trace various structures and arrays of structures .It Cm u userland traces generated by .Xr utrace 2 diff --git a/usr.bin/ktrace/subr.c b/usr.bin/ktrace/subr.c index b52ae1b981ec..fb96a3461db6 100644 --- a/usr.bin/ktrace/subr.c +++ b/usr.bin/ktrace/subr.c @@ -77,7 +77,7 @@ getpoints(char *s) facs |= KTRFAC_PSIG; break; case 't': - facs |= KTRFAC_STRUCT; + facs |= KTRFAC_STRUCT | KTRFAC_STRUCT_ARRAY; break; case 'u': facs |= KTRFAC_USER; From nobody Tue Jan 14 14:43:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1x3Plzz5km50; Tue, 14 Jan 2025 14:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1x0lYbz3grM; Tue, 14 Jan 2025 14:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gqTW6Un84ctWBIOefR6eIGOiDXci4CdJHH51xkteYho=; b=xDwsM5RlvjyZPu/hktEES9NWDLnXMD1+616u8zpFwMQ5SHyNiX9MYRxptfJo/YeFKYXKCS OgS/trobcjvaXkn+SOLn1eyNeVM6ihENFI37KPqt+2wcanUz4h4F6yyqe8xUSvtXY3jzC3 h1WOq3p/sbZtNvHXIz+1A11Wj3dxW6RkJqw0a1BCHvJRccT1hw5PxKMSylexHOdo+02aCZ tTB9AwiuFZrPTYxL25Vbkk43xopmto5X6ZGDctv/phShmC9Ii1ukv3W4pQQgLBSdS6Yzb+ R/YL8UpieAePTYb/bxyAxdOrFJUu169Tewj8ZXrAoOZbhEJftn+hWXOzIVgT7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gqTW6Un84ctWBIOefR6eIGOiDXci4CdJHH51xkteYho=; b=TfvzBNuX4UaLMPOjmrahnDT4D6WEk9TWsHxxWrJLbU9473iLYfI6h7LToD6kxVcYDq6ppD GIMNF5Gq6j0PTtLZOUNhJxcgO8H7ahtuZIDHMZ0TXkMlR4qKhd6MQS5CLT1JVAEAx32ogH PSbqSc1JM2PXIM7+3z84ZOrPNMcDQRFC0Lw0AF7YHr4VKiygHvld2YOmlY2c+nEmtqTThz G+Udx1/IPUS/qUjMXL0vO7c5jAcomDULjKlyDH5jCQpyix0kRKDVhA9swVqe+0xvZK7OIk f0G/vsKecUQ5G0YZRb6KobmAHqyL15ystvU8C3HGDajQ6ufMHogM31lSRcJh9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865829; a=rsa-sha256; cv=none; b=qFIOnsZ5LsjAzKGM/pnNymnv+AKi0XtbHqtt848BswxwgWh95phzS8doIGF6Zb8AhXDzpQ xnXut9S5uqb26WQy+Rd8NTuBAt29Z1oeEqwKPoSrtzNT+tWDMg5cprmI9KPq5Qa1gmXC4I 6ib3uSY2U82R9uCnv+JRW8S6/9v54Q7slRJOs3jyiLed91S0sZPpSDTJyzpwrxJyjopCvz thXbGrBetoLDf0BlKmVfuUa085h3L1NFNlDrdlHGgEK7vfZIjQNeUvk5vxmo5qFdrxnem7 Ha4JaDqJfjJkVgEyrWUIR1Y2N6cUAMUsZOM3HbtkPTtanjMGxCP7ZsKE2QtOiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1x0LfJz1Jgl; Tue, 14 Jan 2025 14:43: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 50EEhmCA014784; Tue, 14 Jan 2025 14:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhmoO014781; Tue, 14 Jan 2025 14:43:48 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:48 GMT Message-Id: <202501141443.50EEhmoO014781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 91af1b8001d3 - stable/13 - sed: Fix handling of an empty pattern space List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91af1b8001d34a1563d861f1da81deaa121adca8 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=91af1b8001d34a1563d861f1da81deaa121adca8 commit 91af1b8001d34a1563d861f1da81deaa121adca8 Author: Mohamed Akram AuthorDate: 2024-12-23 19:06:09 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:43:05 +0000 sed: Fix handling of an empty pattern space Add a regression test. PR: 271791 Obtained from: OpenBSD (1.38 millert) MFC after: 2 weeks (cherry picked from commit 5982237f1e5a30b6b7d67b307b4d3685b00718bf) --- usr.bin/sed/process.c | 10 ++++------ usr.bin/sed/tests/sed2_test.sh | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 3d88096ffb77..945db462a601 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -439,14 +439,12 @@ substitute(struct s_command *cp) * and at the end of the line, terminate. */ if (match[0].rm_so == match[0].rm_eo) { - if (*s == '\0' || *s == '\n') - slen = -1; - else - slen--; - if (*s != '\0') { + if (slen > 0) { cspace(&SS, s++, 1, APPEND); + slen--; le++; - } + } else + slen = -1; lastempty = 1; } else lastempty = 0; diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh index f50619612561..0b849b1ea132 100755 --- a/usr.bin/sed/tests/sed2_test.sh +++ b/usr.bin/sed/tests/sed2_test.sh @@ -159,6 +159,19 @@ minus_e_body() atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a } +atf_test_case command_D +command_D_head() +{ + atf_set "descr" "Test handling of an empty pattern space" +} +command_D_body() +{ + printf "hello\n\nworld\n" > a + + atf_check -o file:a sed -e 's/^//;P;D' a + atf_check -o file:a sed -e 's/^//;$!N;P;D' a +} + atf_init_test_cases() { atf_add_test_case inplace_command_q @@ -169,4 +182,5 @@ atf_init_test_cases() atf_add_test_case hex_subst atf_add_test_case bracket_y atf_add_test_case minus_e + atf_add_test_case command_D } From nobody Tue Jan 14 14:43:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXX1w5DRGz5km4y; Tue, 14 Jan 2025 14:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXX1w03q1z3gtM; Tue, 14 Jan 2025 14:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0hP3TsQ2S9q3guyrU4ztBs0m2MWb2SaaMAp2kv9DguA=; b=J8EhLW8eqpNCqoUevfTgzZouHBcO9Bh/76gJSY/ORWhHh26lILmMJ0gGdgLXKMkjz5NvFl gGVTtppOPjSbxwVZJ3BJCPOcMkJGcct5FCQJON+2YI+qAhS0eaHNWgoD28PWz8ye2jH1WG oLU/9EYRNnqREeexDTCMWt2SoLR9qxvsWbwBbMFXiGB8KNs3zmVZyymzm/QE9iT8uPu8Of ZmvdNzTNsTEoExiXB4tF2vsgOjrtzlfbnfIpNxLa0y/0hPVL/s/kvJo1YwjJMTJyxbSeC9 cpqZZc+2AzOAXL/JmANnMyNkR9ehWgpVqG9DEbs9Y+Ggftomu7ajtQQMoaSwlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736865828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0hP3TsQ2S9q3guyrU4ztBs0m2MWb2SaaMAp2kv9DguA=; b=eC5BUlfcedRXmCJgjqWGQWgUUNhdeOiS6ftMVbRUqf19hxtMtb6gtGPPMvCYa0+iB8EBkd z/j+/bs27sTGv7jNak988H1zOHV2Kb+UBdwdjbo9YSXSnF+9OwQw7QX4f0gmqIhQR6Iww1 Cem2wtxG/3acOT/Ok6lIzwZdSp1PHELnOuiDwEkirjGSJhVl9D45MElYFxiyBpuyhmRAcT lxdolwFtdl/PGWQSAnMEpeIFVqSHwnnDHTZk4+ZBQ+1FQEZHlTI5pA1H49UkRBh/3llrVl 4Fwv9w6Hx7OBWcCRxPrOzwToxf+dGTU8FCcN5Oeh4L/zQYP2oHeJJL55GgnGzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736865828; a=rsa-sha256; cv=none; b=AidPMJRuZ24gO0aKBt5OBlRCgnxY6TzSkcip2qUetahPgLo7RF16RMB8U6avlurZEQIAx6 tWLLfGHjpxayAAsEL0Ge3bgKbd5nhdavhzqOQoT9qbnnvvGcub3Mfu4lp4GIDxsAZ/VoqI bv4gtYKN1i3C4vGqgKkur1+bYViQTslodNox+b6dnNrnxLBFItcrSoosnnPShjP6zvjZ6R g/Xj7Qe+z081agObLJjamNxy7kDsNs4q6TC2JqfFzKMrdGUTL38Ggcl17lgGIDpB/jh5Jc 9eRvi/tY969LyosWCOuXLo3O9PIyOs9bwzvyvsDcSLabWqUn5KoPutinEK50Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXX1v6nLTz1Kb8; Tue, 14 Jan 2025 14:43: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 50EEhlxY014733; Tue, 14 Jan 2025 14:43:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EEhlgw014730; Tue, 14 Jan 2025 14:43:47 GMT (envelope-from git) Date: Tue, 14 Jan 2025 14:43:47 GMT Message-Id: <202501141443.50EEhlgw014730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 40c01de13562 - stable/13 - x86: Short-circuit ipi_all_but_self() on UP systems List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40c01de1356224a82fec217bd3cd59dd058ef095 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40c01de1356224a82fec217bd3cd59dd058ef095 commit 40c01de1356224a82fec217bd3cd59dd058ef095 Author: Mark Johnston AuthorDate: 2025-01-07 17:58:58 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:14:45 +0000 x86: Short-circuit ipi_all_but_self() on UP systems Apparently this is required on old intel hw, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275086#c3 PR: 275086 Reviewed by: mav, kib Fixes: 279cd05b7e4d ("Use APIC_IPI_DEST_OTHERS for bitmapped IPIs too.") MFC after: 1 week Diagnosed by: Ben Wilber Differential Revision: https://reviews.freebsd.org/D48361 (cherry picked from commit 254a2b767f9a39f1541e0a07a70bbe269e86ad70) --- sys/x86/x86/mp_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 56cf7e426076..771cf95f36b4 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1424,6 +1424,9 @@ ipi_all_but_self(u_int ipi) cpuset_t other_cpus; int cpu, c; + if (mp_ncpus == 1) + return; + /* * IPI_STOP_HARD maps to a NMI and the trap handler needs a bit * of help in order to understand what is the source. From nobody Tue Jan 14 15:26:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXXyx4MgSz5kp43; Tue, 14 Jan 2025 15:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXXyx1cNMz3p3c; Tue, 14 Jan 2025 15:26:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ka2mYo5nFtQvAeUC1Mq9C3Ie5KJ7jac5XBu1Y894Fn0=; b=gQNAIL/20f5hiQ/jNTClId4j2EM+uvMNCqD/uGx+8XKm3jf3dHvk2GWg+koPqfu2hXuiI6 JQBfqbq/lF5ipUo+gwgiEO7WCsfVLIU1yjAgZHmzFudLKZAy+8dAkhestZ171JqaZdpyJw XW/JzbJIZDXSkGDy47ImteFKbC7g5Ht1deFuHO6HCDZU2opx49/tb3LUXLi9pMfn2+rJ2H F678OcCuQOpyencgiAaNDddrmAS2OnYFgD26g9CnwXtFlarcmQs9uKu/0H2DTLyKoKe32t RJWCJDheuSzx2jNkgbZQhJlPGFO2eAGvYVzBJcy3/G5lfMata0CGr7ZD82dX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ka2mYo5nFtQvAeUC1Mq9C3Ie5KJ7jac5XBu1Y894Fn0=; b=LLcyGNWABR/INMu861gyspwByS3BEfY2PKGjkL6cX2HZrDcW41tbPqWS+zpFEJoD0IAQIn Yn3TADQ6StKMldwQPU+8J6yYyPrMzNkHqR7+uv2uNrHaLqowxNL1zt5x4ZvQhgInUEJ/qA GZllSZADYOUfczsLI0C86V5E7PjTki81DTuxE7EywzlnGd8LYt7jewO7CKcvBpMDUW1d26 d4D53wNyBo3in7BeTHz1JkwGNidzYc3D4y7Aw7FkGLOHIQXEX2RtRAW6BGVC6SXEbkW+CM a7w5GIcKWOkPeEA9H4BfRRJN2z2AN/CG/fJHud1XlBYH/HY46MtPba65YZ58hQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736868377; a=rsa-sha256; cv=none; b=i8jDktrzKxUIRsE+t84n6WhGodqEs6d0hp0kuE0OSHl21fOYWq/AuDYX2renE1HkKti5h6 areir+vl+8sY/UlfUL1LuQvccoYFrg77aJAbiwyFanPn9ChTpGr5gDdOKQ0dGueVelOM9C ZNIHZkfM16wyhm7Cl3n3SUlvAd+/NmmV4iXepETcrhSHtcpfQ0j4HwAvzmVedrxjzs9lBX Dxpr8Zf2RkOyHrNTW1hqfhQZTfDscAsQ0y6gxLenofcQ6lXAuqRKoLMjkExiEy+ZMTokMS cyJ6Op4RRE1G3JboH4+usShlQtDQ5F02hzMnYiZW3xyIwylfy3YnME+G8wIIyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXXyx0TNgz1L8b; Tue, 14 Jan 2025 15:26: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 50EFQGx0090713; Tue, 14 Jan 2025 15:26:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFQGbs090710; Tue, 14 Jan 2025 15:26:16 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:26:16 GMT Message-Id: <202501141526.50EFQGbs090710@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: f78fe930854c - main - audit: Fix short-circuiting in syscallenter() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f78fe930854cac6eed55859b45e0a7b5d87189d6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f78fe930854cac6eed55859b45e0a7b5d87189d6 commit f78fe930854cac6eed55859b45e0a7b5d87189d6 Author: Mark Johnston AuthorDate: 2025-01-14 14:19:24 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:19:28 +0000 audit: Fix short-circuiting in syscallenter() syscallenter() has a slow path to handle syscall auditing and dtrace syscall tracing. It uses AUDIT_SYSCALL_ENTER() to check whether to take the slow path, but this macro also has side effects: it writes the audit log entry. When systrace (dtrace syscall tracing) is enabled, this would get short-circuited, and we end up not writing audit log entries. Introduce a pure macro to check whether auditing is enabled, use it in syscallenter() instead of AUDIT_SYSCALL_ENTER(). Reviewed by: kib Reported by: Joe Duin Fixes: 2f7292437d0c ("Merge audit and systrace checks") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48448 --- sys/kern/subr_syscall.c | 8 +++++--- sys/security/audit/audit.h | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 22bc35774e70..16fa47c5605a 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -141,9 +141,8 @@ syscallenter(struct thread *td) sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - if (__predict_false(SYSTRACE_ENABLED() || - AUDIT_SYSCALL_ENTER(sa->code, td) || - !sy_thr_static)) { + if (__predict_false(AUDIT_SYSCALL_ENABLED() || + SYSTRACE_ENABLED() || !sy_thr_static)) { if (!sy_thr_static) { error = syscall_thread_enter(td, &se); sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; @@ -158,6 +157,9 @@ syscallenter(struct thread *td) if (__predict_false(se->sy_entry != 0)) (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif + + AUDIT_SYSCALL_ENTER(sa->code, td); + error = (se->sy_call)(td, sa->args); /* Save the latest error return value. */ if (__predict_false((td->td_pflags & TDP_NERRNO) != 0)) diff --git a/sys/security/audit/audit.h b/sys/security/audit/audit.h index b87dd52e0773..28e84dce79f3 100644 --- a/sys/security/audit/audit.h +++ b/sys/security/audit/audit.h @@ -389,9 +389,11 @@ void audit_thread_free(struct thread *td); audit_arg_vnode2((vp)); \ } while (0) +#define AUDIT_SYSCALL_ENABLED() audit_syscalls_enabled + #define AUDIT_SYSCALL_ENTER(code, td) ({ \ bool _audit_entered = false; \ - if (__predict_false(audit_syscalls_enabled)) { \ + if (audit_syscalls_enabled) { \ audit_syscall_enter(code, td); \ _audit_entered = true; \ } \ @@ -468,6 +470,7 @@ void audit_thread_free(struct thread *td); #define AUDITING_TD(td) 0 +#define AUDIT_SYSCALL_ENABLED() 0 #define AUDIT_SYSCALL_ENTER(code, td) 0 #define AUDIT_SYSCALL_EXIT(error, td) From nobody Tue Jan 14 15:26:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXXyy3FNWz5kpPH; Tue, 14 Jan 2025 15:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXXyy175mz3p5J; Tue, 14 Jan 2025 15:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQIYaQpLnGpUltcMEc9UUhr3iqCG/MTbJ836MyisuGc=; b=XGxjjmQIxc+8yfe7tFfQ+yArv1BFrG+rg2nVgLIniT7BuWWorqLAGI8YXHePo5OYgQBPIq ts9xG5KbWKb9T16slb8Iv4kuPNW8vsIESm4QjjM50K06FWCrLSvjloQok8mVetrnXtqpji CjdHadNQXEcIMTrSxiAwcqOaLzQ74FJeqxiuFGDrnA6Psh62JR0ay5QK/FlS4ZVMk7i7LA vDCzGhjSskQgOO2u4eEW4h+jUpvTvVLHg9DnYBrAOXHvJN0MTBxtU4Xklgts5sDlBQ2J93 h16s9NDpoUYtHQpEGCcHm4gqVrQq7RP2IqaK8tcq1aj8aERhpQtLfsB6Ns8b7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQIYaQpLnGpUltcMEc9UUhr3iqCG/MTbJ836MyisuGc=; b=gygr21g2dH+a9fvYfU4JV90ASJNTfZRlyWov8ZmHAp+/RLYQ4HJZ9VqPmteOpUHGTJZvlv w64F50yzB4pyOwRIQJfKc/JO6CzQ8N6eem27iPgUI3SpC0eXwfuTOY+Ae+PgMm75rtTEgf Ihz5DsI/ePuPkAsS8qK3H7ZhB9gka474ivdVJ4HxbpDY7PAyT0nxsL1vDmGxpv1wURF0wl 9Dmrhz2tDH/HYg3p7f6L1k9QdXTKVDMg6sLJZ6r23FxxqF8PfHmGB2cX9gyWzpTZ4UJPOf oo1h/7RUhJPxO/UChYWEm4qNeget6KzNxd7G3al23CrIlDJ/gOct4ozb3/+6hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736868378; a=rsa-sha256; cv=none; b=TJzj57K5Uq6XMm8SL4TdEabsfSGxPtSW0JXbCOr7MtIl7YGh2diskX36Bur0WxEHtR+8ji c7WhU4YNp4pSO752YZLwjSh6byOAeYkQ4VUx3VGexITku24uj/Nttutyq2y4D5cq16gjCg hCRWXzjMfQUxsYp5n0/bV6f9AzrZSrNuA3M6z7hTih9/idE8/CASTrqas78sps/2GUpg/v JFOp8xSyJ5Tdt91ElzjsnBJabsoVAQZ9mjTACKfWegPKgkpGaOLtcw66AziUYYwGeyb+Lq I+wvnEltmJag3x4S3v9E6kbj7/1djHcwlh1PAowoyCVHRT1n32QQBam50CEcoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXXyy0f7cz1LFR; Tue, 14 Jan 2025 15:26: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 50EFQIWv090777; Tue, 14 Jan 2025 15:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFQIH6090774; Tue, 14 Jan 2025 15:26:18 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:26:18 GMT Message-Id: <202501141526.50EFQIH6090774@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: ae4f708f0b38 - main - syslogd: Ensure that forwarded messages are sent from port 514 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae4f708f0b383277505daa191e21db399b558839 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ae4f708f0b383277505daa191e21db399b558839 commit ae4f708f0b383277505daa191e21db399b558839 Author: Mark Johnston AuthorDate: 2025-01-14 14:19:56 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:19:56 +0000 syslogd: Ensure that forwarded messages are sent from port 514 Prior to commit 4ecbee2760f7, syslogd used its listening socket(s) to forward messages to remote hosts, when so configured. As a consequence, they are sent from the address+port to which those sockets are bound, typically 0.0.0.0:514. When in capability mode, sendto() is not permitted, so we instead pre-create sockets and connect them to the forwarding addresses, letting the kernel pick an ephemeral source port. However, this doesn't match syslogd's previous behaviour, breaking some setups. So, restore the old behaviour by binding forwarding sockets to the addresses on which syslogd is listening. Since we cannot use the same sockets for receiving messages and also for forwarding them, use SO_REUSEPORT to enable duplicate bindings to port 514, relying on the existing behaviour that the first socket bound to that port is the one that actually receives messages. Add some regression tests to cover this and related functionality of syslogd's -a option. Reviewed by: jfree Reported by: Michael Butler Fixes: 4ecbee2760f7 ("syslogd: Open forwarding socket descriptors") Differential Revision: https://reviews.freebsd.org/D48222 --- usr.sbin/syslogd/syslogd.c | 179 +++++++++++++++++++++++---- usr.sbin/syslogd/syslogd.h | 6 + usr.sbin/syslogd/syslogd_cap_config.c | 2 + usr.sbin/syslogd/tests/syslogd_test.sh | 216 +++++++++++++++++++++++++++++++++ 4 files changed, 378 insertions(+), 25 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index e1d3dffe013a..726cedc17b1d 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -373,6 +373,7 @@ close_filed(struct filed *f) switch (f->f_type) { case F_FORW: if (f->f_addr_fds != NULL) { + free(f->f_addrs); for (size_t i = 0; i < f->f_num_addr_fds; ++i) close(f->f_addr_fds[i]); free(f->f_addr_fds); @@ -2987,11 +2988,152 @@ parse_selector(const char *p, struct filed *f) return (q); } +static int +maybe_dup_forw_socket(const nvlist_t *nvl, const struct sockaddr *rsa, + const struct sockaddr *lsa) +{ + const nvlist_t * const *line; + size_t linecount; + + if (!nvlist_exists_nvlist_array(nvl, "filed_list")) + return (-1); + line = nvlist_get_nvlist_array(nvl, "filed_list", &linecount); + for (size_t i = 0; i < linecount; i++) { + const struct forw_addr *forw; + const int *fdp; + size_t fdc; + + if (nvlist_get_number(line[i], "f_type") != F_FORW) + continue; + fdp = nvlist_get_descriptor_array(line[i], "f_addr_fds", &fdc); + forw = nvlist_get_binary(line[i], "f_addrs", NULL); + for (size_t j = 0; j < fdc; j++) { + int fd; + + if (memcmp(&forw[j].raddr, rsa, rsa->sa_len) != 0 || + memcmp(&forw[j].laddr, lsa, lsa->sa_len) != 0) + continue; + + fd = dup(fdp[j]); + if (fd < 0) + err(1, "dup"); + return (fd); + } + } + + return (-1); +} + +/* + * Create a UDP socket that will forward messages from "lai" to "ai". + * Capsicum doesn't permit connect() or sendto(), so we can't reuse the (bound) + * sockets used to listen for messages. + */ +static int +make_forw_socket(const nvlist_t *nvl, struct addrinfo *ai, struct addrinfo *lai) +{ + int s; + + s = socket(ai->ai_family, ai->ai_socktype, 0); + if (s < 0) + err(1, "socket"); + if (lai != NULL) { + if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &(int){1}, + sizeof(int)) < 0) + err(1, "setsockopt"); + if (bind(s, lai->ai_addr, lai->ai_addrlen) < 0) + err(1, "bind"); + } + if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0) { + if (errno == EADDRINUSE && lai != NULL) { + int s1; + + s1 = maybe_dup_forw_socket(nvl, ai->ai_addr, + lai->ai_addr); + if (s1 < 0) + errc(1, EADDRINUSE, "connect"); + (void)close(s); + s = s1; + } else { + err(1, "connect"); + } + } + /* Make it a write-only socket. */ + if (shutdown(s, SHUT_RD) < 0) + err(1, "shutdown"); + + return (s); +} + +static void +make_forw_socket_array(const nvlist_t *nvl, struct filed *f, + struct addrinfo *res) +{ + struct addrinfo *ai; + size_t i; + + f->f_num_addr_fds = 0; + + /* How many sockets do we need? */ + for (ai = res; ai != NULL; ai = ai->ai_next) { + struct socklist *boundsock; + int count; + + count = 0; + STAILQ_FOREACH(boundsock, &shead, next) { + if (boundsock->sl_ai.ai_family == ai->ai_family) + count++; + } + if (count == 0) + count = 1; + f->f_num_addr_fds += count; + } + + f->f_addr_fds = calloc(f->f_num_addr_fds, sizeof(*f->f_addr_fds)); + f->f_addrs = calloc(f->f_num_addr_fds, sizeof(*f->f_addrs)); + if (f->f_addr_fds == NULL || f->f_addrs == NULL) + err(1, "malloc failed"); + + /* + * Create our forwarding sockets: for each bound socket + * belonging to the destination address, create one socket + * connected to the destination and bound to the address of the + * listening socket. + */ + i = 0; + for (ai = res; ai != NULL; ai = ai->ai_next) { + struct socklist *boundsock; + int count; + + count = 0; + STAILQ_FOREACH(boundsock, &shead, next) { + if (boundsock->sl_ai.ai_family == + ai->ai_family) { + memcpy(&f->f_addrs[i].raddr, ai->ai_addr, + ai->ai_addrlen); + memcpy(&f->f_addrs[i].laddr, + boundsock->sl_ai.ai_addr, + boundsock->sl_ai.ai_addrlen); + f->f_addr_fds[i++] = make_forw_socket(nvl, ai, + &boundsock->sl_ai); + count++; + } + } + if (count == 0) { + memcpy(&f->f_addrs[i].raddr, ai->ai_addr, + ai->ai_addrlen); + f->f_addr_fds[i++] = make_forw_socket(nvl, ai, NULL); + } + } + assert(i == f->f_num_addr_fds); +} + static void -parse_action(const char *p, struct filed *f) +parse_action(const nvlist_t *nvl, const char *p, struct filed *f) { - struct addrinfo *ai, hints, *res; - int error, i; + struct addrinfo hints, *res; + size_t i; + int error; const char *q; bool syncfile; @@ -3045,27 +3187,7 @@ parse_action(const char *p, struct filed *f) dprintf("%s\n", gai_strerror(error)); break; } - - for (ai = res; ai != NULL; ai = ai->ai_next) - ++f->f_num_addr_fds; - - f->f_addr_fds = calloc(f->f_num_addr_fds, - sizeof(*f->f_addr_fds)); - if (f->f_addr_fds == NULL) - err(1, "malloc failed"); - - for (ai = res, i = 0; ai != NULL; ai = ai->ai_next, ++i) { - int *sockp = &f->f_addr_fds[i]; - - *sockp = socket(ai->ai_family, ai->ai_socktype, 0); - if (*sockp < 0) - err(1, "socket"); - if (connect(*sockp, ai->ai_addr, ai->ai_addrlen) < 0) - err(1, "connect"); - /* Make it a write-only socket. */ - if (shutdown(*sockp, SHUT_RD) < 0) - err(1, "shutdown"); - } + make_forw_socket_array(nvl, f, res); freeaddrinfo(res); f->f_type = F_FORW; break; @@ -3161,7 +3283,7 @@ cfline(nvlist_t *nvl, const char *line, const char *prog, const char *host, /* skip to action part */ while (*p == '\t' || *p == ' ') p++; - parse_action(p, &f); + parse_action(nvl, p, &f); /* An nvlist is heap allocated heap here. */ nvl_filed = filed_to_nvlist(&f); @@ -3772,6 +3894,13 @@ socksetup(struct addrinfo *ai, const char *name, mode_t mode) return (NULL); } + if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &(int){1}, + sizeof(int)) < 0) { + logerror("setsockopt(SO_REUSEPORT)"); + close(s); + return (NULL); + } + /* * For AF_LOCAL sockets, the process umask is applied to the * mode set above, so temporarily clear it to ensure that the diff --git a/usr.sbin/syslogd/syslogd.h b/usr.sbin/syslogd/syslogd.h index 744465a9cc00..5644dcaf2671 100644 --- a/usr.sbin/syslogd/syslogd.h +++ b/usr.sbin/syslogd/syslogd.h @@ -127,6 +127,11 @@ enum f_type { F_PIPE, /* pipe to program */ }; +struct forw_addr { + struct sockaddr_storage laddr; + struct sockaddr_storage raddr; +}; + /* * This structure represents the files that will have log * copies printed. @@ -158,6 +163,7 @@ struct filed { char f_hname[MAXHOSTNAMELEN]; int *f_addr_fds; size_t f_num_addr_fds; + struct forw_addr *f_addrs; }; /* F_FORW */ struct { char f_pname[MAXPATHLEN]; diff --git a/usr.sbin/syslogd/syslogd_cap_config.c b/usr.sbin/syslogd/syslogd_cap_config.c index a952dbe325a0..0cf6fb67491d 100644 --- a/usr.sbin/syslogd/syslogd_cap_config.c +++ b/usr.sbin/syslogd/syslogd_cap_config.c @@ -140,6 +140,8 @@ filed_to_nvlist(const struct filed *filed) nvlist_add_string(nvl_filed, "f_hname", filed->f_hname); nvlist_add_descriptor_array(nvl_filed, "f_addr_fds", filed->f_addr_fds, filed->f_num_addr_fds); + nvlist_add_binary(nvl_filed, "f_addrs", filed->f_addrs, + filed->f_num_addr_fds * sizeof(*filed->f_addrs)); } else if (filed->f_type == F_PIPE) { nvlist_add_string(nvl_filed, "f_pname", filed->f_pname); if (filed->f_procdesc >= 0) { diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh index 51c3a5fca1c6..fd3d0c49c080 100644 --- a/usr.sbin/syslogd/tests/syslogd_test.sh +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -2,6 +2,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2021, 2023 The FreeBSD Foundation +# Copyright (c) 2024 Mark Johnston # # This software was developed by Mark Johnston under sponsorship from # the FreeBSD Foundation. @@ -337,6 +338,217 @@ jail_noinet_cleanup() jail -r syslogd_noinet } +# Create a pair of jails, connected by an epair. The idea is to run syslogd in +# one jail (syslogd_allowed_peer), listening on 169.254.0.1, and logger(1) can +# send messages from the other jail (syslogd_client) using source addrs +# 169.254.0.2 or 169.254.0.3. +allowed_peer_test_setup() +{ + local epair + + atf_check jail -c name=syslogd_allowed_peer vnet persist + atf_check jail -c name=syslogd_client vnet persist + + atf_check -o save:epair ifconfig epair create + epair=$(cat epair) + epair=${epair%%a} + + atf_check ifconfig ${epair}a vnet syslogd_allowed_peer + atf_check ifconfig ${epair}b vnet syslogd_client + atf_check jexec syslogd_allowed_peer ifconfig ${epair}a inet 169.254.0.1/16 + atf_check jexec syslogd_allowed_peer ifconfig lo0 inet 127.0.0.1/8 + atf_check jexec syslogd_client ifconfig ${epair}b inet 169.254.0.2/16 + atf_check jexec syslogd_client ifconfig ${epair}b alias 169.254.0.3/16 + atf_check jexec syslogd_client ifconfig lo0 inet 127.0.0.1/8 +} + +allowed_peer_test_cleanup() +{ + jail -r syslogd_allowed_peer + jail -r syslogd_client + ifconfig $(cat epair) destroy +} + +atf_test_case allowed_peer "cleanup" +allowed_peer_head() +{ + atf_set descr "syslogd -a works" + atf_set require.user root +} +allowed_peer_body() +{ + local logfile + + allowed_peer_test_setup + + logfile="${PWD}/jail.log" + printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32' + + # Make sure that a message from 169.254.0.2:514 is logged. + atf_check jexec syslogd_client \ + logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + atf_check -o match:"test1: hello, world" cat "${logfile}" + # ... but not a message from port 515. + atf_check -o ignore jexec syslogd_client \ + logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + atf_check -o not-match:"test2: hello, world" cat "${logfile}" + atf_check -o ignore jexec syslogd_client \ + logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + atf_check -o not-match:"test2: hello, world" cat "${logfile}" + + syslogd_stop + + # Now make sure that we can filter by port. + syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:515' + + atf_check jexec syslogd_client \ + logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + atf_check -o not-match:"test3: hello, world" cat "${logfile}" + atf_check jexec syslogd_client \ + logger -p user.debug -t test4 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + atf_check -o match:"test4: hello, world" cat "${logfile}" + + syslogd_stop +} +allowed_peer_cleanup() +{ + allowed_peer_test_cleanup +} + +atf_test_case allowed_peer_forwarding "cleanup" +allowed_peer_forwarding_head() +{ + atf_set descr "syslogd forwards messages from its listening port" + atf_set require.user root +} +allowed_peer_forwarding_body() +{ + local logfile + + allowed_peer_test_setup + + printf "user.debug\t@169.254.0.1\n" > client_config + printf "mark.debug\t@169.254.0.1:515\n" >> client_config + syslogd_start -j syslogd_client -b 169.254.0.2:514 -f ${PWD}/client_config + + logfile="${PWD}/jail.log" + printf "+169.254.0.2\nuser.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start -j syslogd_allowed_peer -P ${SYSLOGD_PIDFILE}.2 \ + -b 169.254.0.1:514 -a 169.254.0.2/32 + + # A message forwarded to 169.254.0.1:514 should be logged, but one + # forwarded to 169.254.0.1:515 should not. + atf_check jexec syslogd_client \ + logger -h 169.254.0.2 -p user.debug -t test1 "hello, world" + atf_check jexec syslogd_client \ + logger -h 169.254.0.2 -p mark.debug -t test2 "hello, world" + + atf_check -o match:"test1: hello, world" cat "${logfile}" + atf_check -o not-match:"test2: hello, world" cat "${logfile}" +} +allowed_peer_forwarding_cleanup() +{ + allowed_peer_test_cleanup +} + +atf_test_case allowed_peer_wildcard "cleanup" +allowed_peer_wildcard_head() +{ + atf_set descr "syslogd -a works with port wildcards" + atf_set require.user root +} +allowed_peer_wildcard_body() +{ + local logfile + + allowed_peer_test_setup + + logfile="${PWD}/jail.log" + printf "user.debug\t${logfile}\n" > "${SYSLOGD_CONFIG}" + syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:*' + + # Make sure that a message from 169.254.0.2:514 is logged. + atf_check jexec syslogd_client \ + logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + atf_check -o match:"test1: hello, world" cat "${logfile}" + # ... as is a message from 169.254.0.2:515, allowed by the wildcard. + atf_check jexec syslogd_client \ + logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + atf_check -o match:"test2: hello, world" cat "${logfile}" + # ... but not a message from 169.254.0.3. + atf_check -o ignore jexec syslogd_client \ + logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:514 "hello, world" + atf_check -o not-match:"test3: hello, world" cat "${logfile}" + atf_check -o ignore jexec syslogd_client \ + logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + atf_check -o not-match:"test3: hello, world" cat "${logfile}" + + syslogd_stop +} +allowed_peer_wildcard_cleanup() +{ + allowed_peer_test_cleanup +} + +atf_test_case "forward" "cleanup" +forward_head() +{ + atf_set descr "syslogd forwards messages to a remote host" + atf_set require.user root +} +forward_body() +{ + local epair logfile + + atf_check -o save:epair ifconfig epair create + epair=$(cat epair) + epair=${epair%%a} + + atf_check jail -c name=syslogd_server vnet persist + atf_check ifconfig ${epair}a vnet syslogd_server + atf_check jexec syslogd_server ifconfig ${epair}a inet 169.254.0.1/16 + atf_check jexec syslogd_server ifconfig ${epair}a alias 169.254.0.2/16 + atf_check jexec syslogd_server ifconfig lo0 inet 127.0.0.1/8 + + atf_check jail -c name=syslogd_client vnet persist + atf_check ifconfig ${epair}b vnet syslogd_client + atf_check jexec syslogd_client ifconfig ${epair}b inet 169.254.0.3/16 + atf_check jexec syslogd_client ifconfig lo0 inet 127.0.0.1/8 + + cat <<__EOF__ > ./client_config +user.debug @169.254.0.1 +mail.debug @169.254.0.2 +ftp.debug @169.254.0.1 +__EOF__ + + logfile="${PWD}/jail.log" + cat <<__EOF__ > ./server_config +user.debug ${logfile} +mail.debug ${logfile} +ftp.debug ${logfile} +__EOF__ + + syslogd_start -j syslogd_server -f ${PWD}/server_config -b 169.254.0.1 -b 169.254.0.2 + syslogd_start -j syslogd_client -f ${PWD}/client_config -P ${SYSLOGD_PIDFILE}.2 + + atf_check jexec syslogd_client \ + logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p user.debug -t test1 "hello, world" + atf_check jexec syslogd_client \ + logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p mail.debug -t test2 "you've got mail" + atf_check jexec syslogd_client \ + logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p ftp.debug -t test3 "transfer complete" + + atf_check -o match:"test1: hello, world" cat "${logfile}" + atf_check -o match:"test2: you've got mail" cat "${logfile}" + atf_check -o match:"test3: transfer complete" cat "${logfile}" +} +forward_cleanup() +{ + jail -r syslogd_server + jail -r syslogd_client +} + atf_init_test_cases() { atf_add_test_case "unix" @@ -349,4 +561,8 @@ atf_init_test_cases() atf_add_test_case "host_action" atf_add_test_case "pipe_action" atf_add_test_case "jail_noinet" + atf_add_test_case "allowed_peer" + atf_add_test_case "allowed_peer_forwarding" + atf_add_test_case "allowed_peer_wildcard" + atf_add_test_case "forward" } From nobody Tue Jan 14 15:26:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXXyz5KfHz5kp2W; Tue, 14 Jan 2025 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXXyz1sXNz3p3g; Tue, 14 Jan 2025 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ah4XxiJDF4QO+4fAjaOibkWajUMuAqLvmfSQdjGYNyo=; b=e+Bf9oRy2TD9/0Dm1IhZ1QucUttXhSqmOWsZY9KqXmr5PdT1J6S+J8HTs9gtSGJCRcHm9o vxQ7orJPcR77jBUHFWQlr2uxJpTmV2VXcpe296Cay9Kmq8ljCF5sYu5qgr8n2bnj2598AQ ZfMSCndAZSJvTtcu1EvGGqK3pczY4l5An6ozZ9H+Noj81q/E0PPoOAN51upK9MXU4t18sN cHD1OLZc3uf6Ou64mOEcqlR/fTs8QJGlY6uk9B3Sh9bLfPng7FxBQ9NPaxliV+Ifugy2ni usPWvjCEWclbHbckMJ0OqkcJB712TfGn348SRhHLzEilN6R9KG64ydzdpC+gTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ah4XxiJDF4QO+4fAjaOibkWajUMuAqLvmfSQdjGYNyo=; b=hgS6VzqQ3HuGAOl6vH3T4bDrZqu8MjbO7vxKr2OT37A7lc9ypcFNy3ZTjjRaeZ3INp6gmp Vo9gXeXwwGBk/+g1EfafwPTyCdpitjagtd7NvS0hv4ARrJPiHSNAi3veGKeJ3kBeSv7SUP +YKAD0MUpq1i6cF7+0q4g0JFyCtGPX6/2YjbeWx0hk0L/cnQSsLoW1QN1+DMausIViqI2E 7kof9Hoaq/NP7EPqxlkzoNskYa9mhJxrkRgHzMwJLq+79o+VzrPisDnDw8qCZG6Cyik0y8 eUQ5rjKr7IWvc8GT+7jy6Ng5kOxlCY/Ou9Cu+1wymHSrMIKeQqQXJqbmWAV9vQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736868379; a=rsa-sha256; cv=none; b=PyCt4QOFmDktFV85y8VYwIKIPb7S+dnX4Uxu9LWBxrztMANtYpWMoFH1KlexlovpGf/em2 edIzOdraScLyBCmutbbUIaIshY8A4C4HBAlFpEudug7ucGEifASajkfJhd/JPUVSSPK3NH qfS5FcCHes9GMruwdzZ2NMkenxtwHP8XwfXRQf871l7Kptxw3w4jhytOcNlQYb+YqM24n8 hTM/3OI3HBZPckUFnlVGnzIzqZiRaXoi4CiCDdU/6833QXBQzDMdyXYhnQmHG0wBng9pN6 MtpEvbwcgRQ53sUc/tq2hfvcMV6QtZ8RCxUSYMI5v9m6B5nIHwqynhziEu5B+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXXyz1KyRz1LY8; Tue, 14 Jan 2025 15:26: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 50EFQJdj090831; Tue, 14 Jan 2025 15:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFQJNc090828; Tue, 14 Jan 2025 15:26:19 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:26:19 GMT Message-Id: <202501141526.50EFQJNc090828@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: e6c9c463384d - main - ls: Release resources before returning from traverse() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6c9c463384d11a44af3e5f2cc947fb69f3a1968 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c9c463384d11a44af3e5f2cc947fb69f3a1968 commit e6c9c463384d11a44af3e5f2cc947fb69f3a1968 Author: Mark Johnston AuthorDate: 2025-01-14 14:20:26 +0000 Commit: Mark Johnston CommitDate: 2025-01-14 14:20:26 +0000 ls: Release resources before returning from traverse() PR: 278476 MFC after: 2 weeks Reported by: valgrind --- bin/ls/ls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index a285838e2ee1..048cfc9293e6 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -643,8 +643,10 @@ traverse(int argc, char *argv[], int options) chp = fts_children(ftsp, 0); if (chp != NULL) display(NULL, chp, options); - if (f_listdir) + if (f_listdir) { + fts_close(ftsp); return; + } /* * If not recursing down this tree and don't need stat info, just get @@ -693,6 +695,7 @@ traverse(int argc, char *argv[], int options) } if (errno) err(1, "fts_read"); + fts_close(ftsp); } /* From nobody Tue Jan 14 15:35:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXY9T2tYZz5kpwg; Tue, 14 Jan 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXY9T1zw2z3r3L; Tue, 14 Jan 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3vhHqkm8hkZyBO2c4paAKHqadYuyiwfYYI8ZcFmKzI=; b=QAbV7kkjtHgiTGKRMS5RDtU0zfWpZk2fJ9bSbmuN4rQi6t3N+gomqz0yYvfTrBDy1/ZHI2 AzJaTzPa3cG1LvHKb1qCjY3g43K7/OjexvH5pBohTJyrdfNTQ+zy1Pngnd8hwuQNVg15e7 FwI03qWXUwElPXzDN1Sep/ggdl8HtvpoVHIcYUxS40YMqWpkqYIoThW5BjxErD8cuOpNrA TemsSbaxc8NqE0nQSUgqVdp3xWbLUn2QO9RB5hTahsW/CkSZcrHHN/nJi/kO5QahUI4Kwn JOmC4CfdjAgqw0DcRC7UnbrXrTLxkby7tcwSQKhpAojgntQ/sRSkDk/xWV/siA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736868925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I3vhHqkm8hkZyBO2c4paAKHqadYuyiwfYYI8ZcFmKzI=; b=D3t/PdzcBBpJAM91yYdZwVx/DkSgj1J8uDrHcmHRjEzPOUAkTrVc1CpuWsQ6L8uIwh2iZO SUVsUCd0UUDW4bU3+o4+fsFicN+pozyYjDkA2UPy7HjbLrWbyQ75jxIVtZP+K57xozqfxR ltYpXGkd3EbEihjLKwgejMAAJ2Q+7BySimQOUjG6OfYc7fG8CYlCWDbccwQ5JEJbwzcVwI ecjTOlNpknCYNH0Pj8CapzGRM5Uw3S6FjlJ1J8b+AP7nIMsmySHH0PsVPMrIGQuK4zQibD iiRUIQ/zu97BgRzWYLTlcfJuzltunFM8eaoSA1yOf5/y3eOuCuxjLsZd8Q+B+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736868925; a=rsa-sha256; cv=none; b=Mgavtbs2r9iyRGeQswRZ7IMq5PTMeLi4YNge9FQ7nD1Mp3eShKIWIHZUWTwKmZ29duIx46 zXkBczbicT9CSS9k65ex1laRxGvzMZe2qR5JAoGravbNJovZCAg/yhbaGFOlrQXL1ZFGTi vAZhISSCV6RJCxFwsIWWWkWLN+MNGOX+8TsN3QzPletRpploUQTLHPkefLWGUiYCjU9Khq fs4j55uwItci9sCaHf8mgHlobowoCqCor6K9jcditNdW0spDtgjKRvf4dqa49PmO1a7yQv EpKP+cWAEJfDYs1zuVTFI3faK1oC3GVxnFiPlRZhcugLyVPMLe0YSgFPy4Hrkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXY9T1Y6Lz1LvW; Tue, 14 Jan 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50EFZPIb010271; Tue, 14 Jan 2025 15:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFZPdT010268; Tue, 14 Jan 2025 15:35:25 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:35:25 GMT Message-Id: <202501141535.50EFZPdT010268@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: c2cd12b7ae28 - main - cxgbe tom: Make t4_push_frames static to t4_cpl_io.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2cd12b7ae28a34e551d1b96906620249a860bc0 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c2cd12b7ae28a34e551d1b96906620249a860bc0 commit c2cd12b7ae28a34e551d1b96906620249a860bc0 Author: John Baldwin AuthorDate: 2025-01-14 15:34:45 +0000 Commit: John Baldwin CommitDate: 2025-01-14 15:34:45 +0000 cxgbe tom: Make t4_push_frames static to t4_cpl_io.c This function is not used outside of this file. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47760 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 +- sys/dev/cxgbe/tom/t4_tom.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 8cafac61fa8b..8547f21586e1 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -633,7 +633,7 @@ write_tx_sgl(void *dst, struct mbuf *start, struct mbuf *stop, int nsegs, int n) * stalls). When drop is set this function MUST drop the bytes and wake up any * writers. */ -void +static void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) { struct mbuf *sndptr, *m, *sb_sndptr; diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 1f97dd81a0bc..6295a3484b9f 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -525,7 +525,6 @@ int t4_send_fin(struct toedev *, struct tcpcb *); int t4_send_rst(struct toedev *, struct tcpcb *); void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *, uint16_t, uint64_t, uint64_t, int, int); -void t4_push_frames(struct adapter *, struct toepcb *, int); void t4_push_pdus(struct adapter *, struct toepcb *, int); /* t4_ddp.c */ From nobody Tue Jan 14 15:39:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXYGj5rfKz5kq8g; Tue, 14 Jan 2025 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXYGj4TXlz3rPb; Tue, 14 Jan 2025 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736869197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AM9LHiLVXyPbexvv8NLVNyHtRiXpV1UYezvpWY2HXyc=; b=bEQyTGVlKkcN/rbITEeMpljWjngnNb3Q0ESwrowZ1QHgPnnoNMmMAdc+WDJ0fjSpyLq1QC 6MF59lmuVo0FlJ7SHuaR3RJCD+PVc1j66T3/PLbFT+iBNStIpi+5YEGtxBWOyCCFzCx5qd tW/jx5ZAwz+1iRjAVZr/Tf2C7gSCgyXkg5c+9vD5SegBexvmeEWEYEPaVIyMf1g/fP4bqG VuybTWL6COMElfbp/rkFmXR+YlVCKiV7eT9z6oV7u5MiX6zvnFi/bAqbafLkYyxCUgkL8F 3IQ8o6RlMo+5/xuR+4iCJa2F7V6IzkG68Si38iw2nepPrm5IXBlncbbpmFGbMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736869197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AM9LHiLVXyPbexvv8NLVNyHtRiXpV1UYezvpWY2HXyc=; b=KLMJOikddRV7XpyS3BqutF/YoNRSYfgPIw09rjUie2MBEKQPNXyJLVPvLikxPsd3cZJkQQ doDNSOhBhbh9uhQ1y8FprCRdmRYcHCVejUdvLq9OykYCXb2BC+ZMs3mBDZSX7M6eVhatYo izx0SUDzwmlTLoKlmiXS06gQnafJ5+TlNErdFvoxiMnK26lTH5ra6f0AzvOg11s78BRdzj X1DecsWsh6SJ5IS8tBsCWrzHW7kX16vU5lGetmYsl3poYYmpiZJW9nlNZl+Wi5LMpbRsR+ tCF4CHqMimQzav/HCih0dfq7TyLRLBwE9EtPY2qnPVawvroYjmx+YqUGpgJnLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736869197; a=rsa-sha256; cv=none; b=vgGab54yAYwydyDJmUqC5fqNzyeQCnSg1ThMdVXx89H5N0S8Gq7toVJn1gn8IXV9nfguhp GqBcnXkBHETOIe9TKkEw9yCTAUIpBwd61+00rYFeEWaFgYF73md7DspnwYf5hOkMFiVpSt nC/obwlJ+Vq/Jk2fGKpHxFBRv3qBLdD0z2QgcJ3A3hhoAESy8c3raKT8ltR/iJEOIGDAbG HRJfHBe8WYFuE1obvFEVNIFBI6aKVryhhd2fjAjr89vlBsfaUTBiuGM9IVI47Hfc4J5OOm bngDBm5ArG/0xAqn493eBPmn/gpFlcEtKTaFs848hK9AByjxxFV6yvEdXxNJMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXYGj428vz1L9D; Tue, 14 Jan 2025 15:39: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 50EFdvfB011704; Tue, 14 Jan 2025 15:39:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFdvZn011702; Tue, 14 Jan 2025 15:39:57 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:39:57 GMT Message-Id: <202501141539.50EFdvZn011702@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: de11299323e0 - main - pmcannotate: Add a '-m' mode option to control per-line annotations. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de11299323e0a647ae2164f74ca966862e7c4dd8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=de11299323e0a647ae2164f74ca966862e7c4dd8 commit de11299323e0a647ae2164f74ca966862e7c4dd8 Author: John Baldwin AuthorDate: 2025-01-14 15:39:53 +0000 Commit: John Baldwin CommitDate: 2025-01-14 15:39:53 +0000 pmcannotate: Add a '-m' mode option to control per-line annotations. - "block" (the default mode) displays per-block percentages in front of each annotated line. - "global" displays a global percentage in front of each line. - "raw" displays the raw count of sample hits in front of each line. Reviewed by: Pau Amma , mav Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D35401 --- usr.sbin/pmcannotate/pmcannotate.8 | 15 ++++++++++- usr.sbin/pmcannotate/pmcannotate.c | 54 ++++++++++++++++++++++++++++++++------ 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/usr.sbin/pmcannotate/pmcannotate.8 b/usr.sbin/pmcannotate/pmcannotate.8 index 9a89c40db1e7..e2fae0a7a7e0 100644 --- a/usr.sbin/pmcannotate/pmcannotate.8 +++ b/usr.sbin/pmcannotate/pmcannotate.8 @@ -25,7 +25,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.Dd November 20, 2008 +.Dd January 14, 2025 .Dt PMCANNOTATE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl h .Op Fl k Ar pathname .Op Fl l Ar level +.Op Fl m Ar mode .Ar pmcout.out binaryobj .Sh DESCRIPTION The @@ -84,6 +85,18 @@ This directory specifies where should look for the kernel and its modules. The default is .Pa /boot/kernel . +.It Fl m Ar mode +Format to use when annotating source or assembly lines. +One of: +.Bl -tag -width indent +.It Cm block +Display percentage of matching samples relative to samples +falling in the current block. +.It Cm global +Display percentage of matching samples relative to all samples. +.It Cm raw +Display the raw count of matching samples. +.El .El .Sh LIMITATIONS As long as diff --git a/usr.sbin/pmcannotate/pmcannotate.c b/usr.sbin/pmcannotate/pmcannotate.c index 01af75090793..5958ff615e4b 100644 --- a/usr.sbin/pmcannotate/pmcannotate.c +++ b/usr.sbin/pmcannotate/pmcannotate.c @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ exit(EXIT_FAILURE); \ } while (0) -#define PERCSAMP(x) ((x) * 100 / totalsamples) +#define PERCSAMP(x) ((float)(x) * 100 / totalsamples) struct entry { TAILQ_ENTRY(entry) en_iter; @@ -108,7 +109,9 @@ static TAILQ_HEAD(, aggent) fqueue = TAILQ_HEAD_INITIALIZER(fqueue); * Use a float value in order to automatically promote operations * to return a float value rather than use casts. */ -static float totalsamples; +static u_int totalsamples; + +static enum { RAW, BLOCK_PERCENT, GLOBAL_PERCENT } print_mode; /* * Identifies a string cointaining objdump's assembly printout. @@ -500,6 +503,30 @@ general_insertent(struct entry *entry) TAILQ_INSERT_TAIL(&mainlst, entry, en_iter); } +/* + * Return a string either holding a percentage or the raw count value. + */ +static const char * +print_count(u_int nsamples, u_int totsamples) +{ + static char buf[16]; + + switch (print_mode) { + case RAW: + snprintf(buf, sizeof(buf), "%u", nsamples); + break; + case BLOCK_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totsamples); + break; + case GLOBAL_PERCENT: + snprintf(buf, sizeof(buf), "%.2f%%", (float)nsamples * 100 / + totalsamples); + break; + } + return (buf); +} + /* * Printout the body of an "objdump -d" assembly function. * It does simply stops when a new function is encountered, @@ -528,8 +555,8 @@ general_printasm(FILE *fp, struct aggent *agg) if (obj == NULL) printf("\t| %s", buffer); else - printf("%.2f%%\t| %s", - (float)obj->en_nsamples * 100 / agg->ag_nsamples, + printf("%7s | %s", + print_count(obj->en_nsamples, agg->ag_nsamples), buffer); } } @@ -622,8 +649,8 @@ printblock(FILE *fp, struct aggent *agg) printf("\t| %s", buffer); else { done = 1; - printf("%.2f%%\t| %s", - (float)tnsamples * 100 / agg->ag_nsamples, buffer); + printf("%7s | %s", + print_count(tnsamples, agg->ag_nsamples), buffer); } } @@ -656,7 +683,7 @@ usage(const char *progname) { fprintf(stderr, - "usage: %s [-a] [-h] [-k kfile] [-l lb] pmcraw.out binary\n", + "usage: %s [-a] [-h] [-k kfile] [-l lb] [-m mode] pmcraw.out binary\n", progname); exit(EXIT_SUCCESS); } @@ -681,7 +708,8 @@ main(int argc, char *argv[]) kfile = NULL; asmsrc = 0; limit = 0.5; - while ((cget = getopt(argc, argv, "ahl:k:")) != -1) + print_mode = BLOCK_PERCENT; + while ((cget = getopt(argc, argv, "ahl:m:k:")) != -1) switch(cget) { case 'a': asmsrc = 1; @@ -692,6 +720,16 @@ main(int argc, char *argv[]) case 'l': limit = (float)atof(optarg); break; + case 'm': + if (strcasecmp(optarg, "raw") == 0) + print_mode = RAW; + else if (strcasecmp(optarg, "global") == 0) + print_mode = GLOBAL_PERCENT; + else if (strcasecmp(optarg, "block") == 0) + print_mode = BLOCK_PERCENT; + else + errx(1, "Invalid mode %s", optarg); + break; case 'h': case '?': default: From nobody Tue Jan 14 15:49:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXYTc1F7Bz5kqD1; Tue, 14 Jan 2025 15:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXYTb5sfDz3sRS; Tue, 14 Jan 2025 15:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736869763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsBwwvdmbShOp3xkq5eEclm/ccvZ4hvrx5O9UiNgm3Y=; b=PXSNiDoO4f1CcAGOcvvYfrgHCWjqN5ZBFiO9reS9/JjyRsfvT0FGtW/eC9P7c1jlM0UKUg 081YGgad9cN3DHZgrlqfAvrO49b7u7dnLjO41RqObsoK9j1z1IOg+CYNpAuKKvAz7vABRX GlhMsgkXGXdxxzJBylLDrIuFIhiuctn/LlyxrbNbbsJYTWsRs3nhEpP9xnY/cbNadxkbcL 3lJYkLm8mOk34rXVwyVgDQYhjz/pUoczMWJEOwbwrLcrTYEr3DG24Y7NmyF9dD+jVgKg86 N4dBbfQCTTvC1DD+IhQzLCnnwuUNvaH8l2RlqcoawBkjusPP+LEU1UORlFI+oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736869763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsBwwvdmbShOp3xkq5eEclm/ccvZ4hvrx5O9UiNgm3Y=; b=oED2HH47QJ+NxAZPyP3nFsRc82mspHuoizyhN4np9pN4pBfYPaDmWapROKqWP3eqFYM7ng njKfvUQBG+GyAouPQ7uEIrxkwWDv60vElrdW+MT9RAPd3WdVzrIPS4pBWPu6rp8qOzVq25 AJsIx983O/q5YRJnBe2WoQuWb6REHVwfunxlcGbCLPFugGBBrjov1cb5PdSK9WyX9XIM+q ytvcsUEjTDUGPqBfMjRH0dueq3BR7IQHjTTd/mkAEyYEoDtxDMK55dD8V5pXdCtNEs4DqK zvmyUej/w5MGh1kv/Rp+tDQisGjk+ycR5s1zMJkLPgd37Yq/OmvlCrhnarAF4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736869763; a=rsa-sha256; cv=none; b=A46OeX7oeq10cQZK+2H+iafoBLSMjPx3e2YUo3aBLu1R8dZajv3zqX4M6huN2PqNW4/uDt xluXS6rYkr+dGxGsLbPaJjYo9DKSpsnV6mQG3XT71/GU2B4+kcahN9MHAoIkckoumtziNH yotVu3wS1wqupsJ7pGtIcaq9jGCuKnk/1yIlMcleQJFN/vwNXE6Z9Ec5UfrP4UH+GJGgVK PMHysTldJKCkfW8DKgrnHm9AwYoBE5AJz9mQEpuGisqqaEZdpOXyjpqU4dETX5xPutD65B 8wHElktCEuVM+sA/YsIo8CpF3uyWRH9exgiwMyMkxozWSyc0TJLOF3U8KimKmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXYTb5Jcvz1M9G; Tue, 14 Jan 2025 15:49: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 50EFnNOY030058; Tue, 14 Jan 2025 15:49:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EFnNxf030055; Tue, 14 Jan 2025 15:49:23 GMT (envelope-from git) Date: Tue, 14 Jan 2025 15:49:23 GMT Message-Id: <202501141549.50EFnNxf030055@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: 660331da7a75 - main - Centralize and simpify implemention of some VM macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 660331da7a75e897ae9710c9933962d82f0a194c Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=660331da7a75e897ae9710c9933962d82f0a194c commit 660331da7a75e897ae9710c9933962d82f0a194c Author: Brooks Davis AuthorDate: 2025-01-14 15:48:07 +0000 Commit: John Baldwin CommitDate: 2025-01-14 15:48:07 +0000 Centralize and simpify implemention of some VM macros These macros have substantially identical implementations on each platform. Use roundup2/rounddown2 for round_page/trunc_page. This version standardizes on not using explicit casts and instead preserving the original type. A couple of tweaks were required to make this work. Reviewed by: brooks, kib, markj Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D48450 --- sys/amd64/amd64/pmap.c | 2 +- sys/amd64/include/param.h | 7 ------- sys/arm/arm/minidump_machdep.c | 3 ++- sys/arm/include/param.h | 7 ------- sys/arm64/include/param.h | 8 -------- sys/i386/include/param.h | 7 ------- sys/powerpc/include/param.h | 7 ------- sys/riscv/include/param.h | 8 -------- sys/sys/param.h | 11 +++++++++++ usr.bin/systat/sysput.c | 3 +-- 10 files changed, 15 insertions(+), 48 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 265d48e26c0b..5d31ad0dd495 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2499,7 +2499,7 @@ pmap_init(void) ret = vm_page_blacklist_add(0x40000000 + ptoa(i), false); if (!ret && bootverbose) - printf("page at %#lx already used\n", + printf("page at %#x already used\n", 0x40000000 + ptoa(i)); } } diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 8ad1c0e93c6a..371128c6fe20 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -142,20 +142,13 @@ /* * Mach derived conversion macros */ -#define round_page(x) ((((unsigned long)(x)) + PAGE_MASK) & ~(PAGE_MASK)) -#define trunc_page(x) ((unsigned long)(x) & ~(PAGE_MASK)) #define trunc_2mpage(x) ((unsigned long)(x) & ~PDRMASK) #define round_2mpage(x) ((((unsigned long)(x)) + PDRMASK) & ~PDRMASK) #define trunc_1gpage(x) ((unsigned long)(x) & ~PDPMASK) -#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) - #define amd64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define amd64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) - #define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \ || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS)) diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c index 802b3184ed06..2e7fe6ebc51d 100644 --- a/sys/arm/arm/minidump_machdep.c +++ b/sys/arm/arm/minidump_machdep.c @@ -221,7 +221,8 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) if (error != 0) goto fail; - printf("Physical memory: %u MB\n", ptoa((uintmax_t)physmem) / 1048576); + printf("Physical memory: %ju MB\n", + ptoa((uintmax_t)physmem) / 1048576); printf("Dumping %llu MB:", (long long)dumpsize >> 20); /* Dump my header */ diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 3e1503e17709..03131ebcb436 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -123,17 +123,10 @@ /* * Mach derived conversion macros */ -#define trunc_page(x) ((x) & ~PAGE_MASK) -#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) #define trunc_1mpage(x) ((unsigned)(x) & ~PDRMASK) #define round_1mpage(x) ((((unsigned)(x)) + PDRMASK) & ~PDRMASK) -#define atop(x) ((unsigned)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned)(x) << PAGE_SHIFT) - #define arm32_btop(x) ((unsigned)(x) >> PAGE_SHIFT) #define arm32_ptob(x) ((unsigned)(x) << PAGE_SHIFT) -#define pgtok(x) ((x) * (PAGE_SIZE / 1024)) - #endif /* !_ARM_INCLUDE_PARAM_H_ */ diff --git a/sys/arm64/include/param.h b/sys/arm64/include/param.h index 6eb58a69dba1..c3f6990db79b 100644 --- a/sys/arm64/include/param.h +++ b/sys/arm64/include/param.h @@ -119,17 +119,9 @@ /* * Mach derived conversion macros */ -#define round_page(x) (((unsigned long)(x) + PAGE_MASK) & ~PAGE_MASK) -#define trunc_page(x) ((unsigned long)(x) & ~PAGE_MASK) - -#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) - #define arm64_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define arm64_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) - #endif /* !_MACHINE_PARAM_H_ */ #endif /* !__arm__ */ diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 2b9982324d19..79b6eee9db69 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -144,19 +144,12 @@ /* * Mach derived conversion macros */ -#define trunc_page(x) ((x) & ~PAGE_MASK) -#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) #define trunc_4mpage(x) ((x) & ~PDRMASK) #define round_4mpage(x) ((((x)) + PDRMASK) & ~PDRMASK) -#define atop(x) ((x) >> PAGE_SHIFT) -#define ptoa(x) ((x) << PAGE_SHIFT) - #define i386_btop(x) ((x) >> PAGE_SHIFT) #define i386_ptob(x) ((x) << PAGE_SHIFT) -#define pgtok(x) ((x) * (PAGE_SIZE / 1024)) - #define INKERNEL(va) (TRUE) #endif /* !_I386_INCLUDE_PARAM_H_ */ diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index 56a7308a21b3..b40ada24ad11 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -141,20 +141,13 @@ /* * Mach derived conversion macros */ -#define trunc_page(x) ((x) & ~(PAGE_MASK)) -#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) #define trunc_2mpage(x) ((unsigned long)(x) & ~L3_PAGE_MASK) #define round_2mpage(x) ((((unsigned long)(x)) + L3_PAGE_MASK) & ~L3_PAGE_MASK) #define trunc_1gpage(x) ((unsigned long)(x) & ~L2_PAGE_MASK) -#define atop(x) ((x) >> PAGE_SHIFT) -#define ptoa(x) ((x) << PAGE_SHIFT) - #define powerpc_btop(x) ((x) >> PAGE_SHIFT) #define powerpc_ptob(x) ((x) << PAGE_SHIFT) -#define pgtok(x) ((x) * (PAGE_SIZE / 1024UL)) - #define btoc(x) ((vm_offset_t)(((x)+PAGE_MASK)>>PAGE_SHIFT)) #endif /* !_POWERPC_INCLUDE_PARAM_H_ */ diff --git a/sys/riscv/include/param.h b/sys/riscv/include/param.h index d06bd0663bac..ca9c91f3f981 100644 --- a/sys/riscv/include/param.h +++ b/sys/riscv/include/param.h @@ -93,15 +93,7 @@ /* * Mach derived conversion macros */ -#define round_page(x) (((unsigned long)(x) + PAGE_MASK) & ~PAGE_MASK) -#define trunc_page(x) ((unsigned long)(x) & ~PAGE_MASK) - -#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT) -#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT) - #define riscv_btop(x) ((unsigned long)(x) >> PAGE_SHIFT) #define riscv_ptob(x) ((unsigned long)(x) << PAGE_SHIFT) -#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024)) - #endif /* !_MACHINE_PARAM_H_ */ diff --git a/sys/sys/param.h b/sys/sys/param.h index d2aad1ff98a1..6d611f251add 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -200,6 +200,17 @@ #define MJUM9BYTES (9 * 1024) /* jumbo cluster 9k */ #define MJUM16BYTES (16 * 1024) /* jumbo cluster 16k */ +/* + * Mach derived conversion macros + */ +#define round_page(x) roundup2(x, PAGE_SIZE) +#define trunc_page(x) rounddown2(x, PAGE_SIZE) + +#define atop(x) ((x) >> PAGE_SHIFT) +#define ptoa(x) ((x) << PAGE_SHIFT) + +#define pgtok(x) ((x) * (PAGE_SIZE / 1024)) + /* * Some macros for units conversion */ diff --git a/usr.bin/systat/sysput.c b/usr.bin/systat/sysput.c index 4053037236f4..6ae0075bb54d 100644 --- a/usr.bin/systat/sysput.c +++ b/usr.bin/systat/sysput.c @@ -25,13 +25,12 @@ * SUCH DAMAGE. */ -#include +#include #include #include #include #include -#include #include #include "systat.h" From nobody Tue Jan 14 16:08:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXYvR70gXz5kr8X for ; Tue, 14 Jan 2025 16:08:19 +0000 (UTC) (envelope-from hank@szepllogistics.com) Received: from mail-m10110.netease.com (mail-m10110.netease.com [154.81.10.110]) (using TLSv1.3 with cipher TLS_AES_256_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 4YXYvN3rqSz3vXM for ; Tue, 14 Jan 2025 16:08:15 +0000 (UTC) (envelope-from hank@szepllogistics.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=szepllogistics.com header.s=default header.b=CTQHHpl1; spf=pass (mx1.freebsd.org: domain of hank@szepllogistics.com designates 154.81.10.110 as permitted sender) smtp.mailfrom=hank@szepllogistics.com; dmarc=pass (policy=quarantine) header.from=szepllogistics.com Content-Type: multipart/alternative; BOUNDARY="=_Part_2244476_122023906.1736870890082" Message-ID: To: Dev-commits-src-all Reply-To: hank@epllogistics.cn Subject: =?UTF-8?B?QSB0cnVzdGVkIGxvZ2lzdGljcyBwYXJ0bmVy?= X-Priority: 3 X-Originating-IP: 113.90.130.87 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Received: by mail-proxy.epllogistics.cn with SMTP id 0a9465928a500732kunm19434aa4074 for ; Wed, 15 Jan 2025 00:08:10 +0800 (GMT+08:00) X-Mailer: MailMasterMac/4.15.8.1281 (13.3.1) From: Hank Disposition-Notification-To: hank@szepllogistics.com Date: Wed, 15 Jan 2025 00:08:10 +0800 (GMT+08:00) X-WM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOSEtLS0k3V1ktWUFJV1kPCRoVCBIfWUFZGkpMGlYYTRgaH08ZTkIdTR1WDBZVEw ETFhoSFyQUDg9ZV1kYEgtZQVlKS1VKSEJVSE9VSUtPWVdZFhoPEhUdFFlBWU9LSFVKS0lCQkJOVU pLS1VLWQY+ X-WM-Tid: 0a9465928a500732kunm19434aa4074 X-WM-MType: 2 X-WM-Sender-Digest: e1kMHhlZQQ8JDh5XWRIfHhUPWUFZRzo9GDoNOjgNMggDSE8JKjc5Fh0R HBoUMFVKVUpMSE1DTEtDQktDSkxVMxYaEhdVExoVEDsIAR4LFxcUHBIIDxIYCFUYFBZFWVdZEgtZ QVlKS1VKSEJVSE9VSUtPWVdZCAFZQUlPQk1ON1dZFAsPEhQVCFlBTDcG DKIM-Signature:a=rsa-sha256; b=CTQHHpl1lBfIOOeEQ1UoxJne4QRNXdDzonss+wtwMEFOBhXynNr0eZlm+Jo79voZBMOvoF6yPIuO53cgURgg4HiKFEk6hbfVTyzk9AhTjgrKBXdnMSo6k4CBUrixKQYEA3T/NBmxcOx5ewMcKXgxzYMjJc53fOvZLTkElhVVsc8=; s=default; c=relaxed/relaxed; d=szepllogistics.com; v=1; bh=QQpmOjECbYrRiTsOJyc4QmzSdZo4IaYKsa4/uuX1ank=; h=date:mime-version:subject:message-id:from; X-Spamd-Result: default: False [0.50 / 15.00]; SUBJ_EXCESS_BASE64(1.50)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.967]; NEURAL_SPAM_SHORT(0.97)[0.966]; DMARC_POLICY_ALLOW(-0.50)[szepllogistics.com,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:154.81.10.0/24:c]; R_DKIM_ALLOW(-0.20)[szepllogistics.com:s=default]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_BASE64_TEXT(0.10)[]; RWL_MAILSPIKE_GOOD(-0.10)[154.81.10.110:from]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; SUSPICIOUS_AUTH_ORIGIN(0.00)[]; FORWARDED(0.00)[hank@epllogistics.cn]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_X_PRIO_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; HAS_XOIP(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; REPLYTO_DOM_NEQ_TO_DOM(0.00)[]; RBL_SENDERSCORE_REPUT_8(0.00)[154.81.10.110:from]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:137263, ipnet:154.81.10.0/24, country:HK]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DKIM_TRACE(0.00)[szepllogistics.com:+]; HAS_REPLYTO(0.00)[hank@epllogistics.cn] X-Spamd-Bar: / X-Rspamd-Queue-Id: 4YXYvN3rqSz3vXM --=_Part_2244476_122023906.1736870890082 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 SGkgIERldi1jb21taXRzLXNyYy1hbGzvvIwKIApXZSBhcmUgYSBwcm9mZXNzaW9uYWwgbG9naXN0 aWNzIGNvbXBhbnkgc3BlY2lhbGl6aW5nIGluIENoaW5hJ3MgaW1wb3J0IGFuZCBleHBvcnQsIHdp dGggYSBoaXN0b3J5IG9mIDE2eWVhcnMuCiAKQ291bGQgeW91IHRlbGwgbWUgaG93IG11Y2ggeW91 IHVzdWFsbHkgc2hpcCA/IApZb3UgY2FuIHRyeSB0byBnaXZlIG1lIGFuIGlucXVpcnkKSSdsbCBn aXZlIHlvdSBhIGNvc3QgeW91IGxpa2UKCgpJJ20gbG9va2luZyBmb3J3YXJkIHRvIHlvdXIgZWFy bHkgcmVwbHkhCldpc2ggeW91IGFsbCB0aGUgYmVzdAoKCgpCZXN0IHJlZ2FyZHMKCgpIYW5rICBD aGVuCgoK5rex5Zyz5Lic5p6B5Zu96ZmF54mp5rWB5pyJ6ZmQ5YWs5Y+4ClNoZW5aaGVuIEVwb2xh ciBMb2dpc3RpY3MgQ28uLExURApBZGRyZXNzOlJvb20gNTA3LCBCdWlsZGluZyA4LFl1bmxpIElu dGVsbGlnZW50IFBhcmssCkxvbmdnYW5nIERpc3RyaWN0LCBTaGVuemhlbiwgQ2hpbmEKRW1hbGw6 aGFua0BlcGxsb2dpc3RpY3MuY24KVGVs77yaKzg2LTA3NTUtMjg1MDcxMjYKV2VjaGF0OisxOTky NjU1MjM5NwpXaGF0c2FwcDorODYtMTM2MTAzNTM1MDIKCgogICAKCgoNCg0K --=_Part_2244476_122023906.1736870890082 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6U291cmNlIEhhbiBTYW5zO2ZvbnQtc2l6ZToxNnB4O2xp bmUtaGVpZ2h0OjEuNTtjb2xvcjojMjYyNjI2O3RleHQtYWxpZ246bGVmdDsiIGRhdGEtbWNlLXN0 eWxlPSJmb250LWZhbWlseTpTb3VyY2UgSGFuIFNhbnM7Zm9udC1zaXplOjE2cHg7bGluZS1oZWln aHQ6MS41O2NvbG9yOiMyNjI2MjY7dGV4dC1hbGlnbjpsZWZ0OyI+CiA8ZGl2PgogIEhpICZuYnNw OzxzcGFuIGNsYXNzPSJtY2UtbHgtdmFyIG1jZU5vbkVkaXRhYmxlIHZhclNwYW4iIGNvbnRlbnRl ZGl0YWJsZT0iZmFsc2UiIGRhdGEtdmFyPSJEZXYtY29tbWl0cy1zcmMtYWxsIiBkYXRhLXZhci1z aG93PSJb5aeT5ZCNMl0iPkRldi1jb21taXRzLXNyYy1hbGw8L3NwYW4+77yMPGJyPiZuYnNwOzxi cj5XZSBhcmUgYSBwcm9mZXNzaW9uYWwgbG9naXN0aWNzIGNvbXBhbnkgc3BlY2lhbGl6aW5nIGlu IENoaW5hJ3MgaW1wb3J0IGFuZCBleHBvcnQsIHdpdGggYSBoaXN0b3J5IG9mIDE2eWVhcnMuPGJy PiZuYnNwOzxicj5Db3VsZCB5b3UgdGVsbCBtZSBob3cgbXVjaCB5b3UgdXN1YWxseSBzaGlwID8m bmJzcDs8YnI+WW91IGNhbiB0cnkgdG8gZ2l2ZSBtZSBhbiBpbnF1aXJ5PGJyPkknbGwgZ2l2ZSB5 b3UgYSBjb3N0IHlvdSBsaWtlCiA8L2Rpdj4KIDxkaXY+CiAgPGJyIGRhdGEtbWNlLWJvZ3VzPSIx Ij4KIDwvZGl2PgogPGRpdj4KICBJJ20gbG9va2luZyBmb3J3YXJkIHRvIHlvdXIgZWFybHkgcmVw bHkhCiA8L2Rpdj48c3BhbiBkYXRhLW1jZS10eXBlPSJib29rbWFyayIgaWQ9Im1jZV8xX3N0YXJ0 IiBkYXRhLW1jZS1zdHlsZT0ib3ZlcmZsb3c6aGlkZGVuO2xpbmUtaGVpZ2h0OjBweCIgc3R5bGU9 Im92ZXJmbG93OiBoaWRkZW47IGxpbmUtaGVpZ2h0OiAwcHg7Ij48L3NwYW4+V2lzaCB5b3UgYWxs IHRoZSBiZXN0PHNwYW4gZGF0YS1tY2UtdHlwZT0iYm9va21hcmsiIGlkPSJtY2VfMl9zdGFydCIg ZGF0YS1tY2Utc3R5bGU9Im92ZXJmbG93OmhpZGRlbjtsaW5lLWhlaWdodDowcHgiIHN0eWxlPSJv dmVyZmxvdzogaGlkZGVuOyBsaW5lLWhlaWdodDogMHB4OyI+PC9zcGFuPjxicj4KPC9kaXY+Cjxk aXY+CiA8YnIgZGF0YS1tY2UtYm9ndXM9IjEiPgo8L2Rpdj4KPGRpdiBjbGFzcz0ibWFpbC1zaWdu YXR1cmUiPgogPGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVvdDtTb3VyY2Ug SGFuIFNhbnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJp YW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBsZXR0ZXIt c3BhY2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0LXRyYW5z Zm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0 cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRpb24tdGhp Y2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRleHQtZGVj b3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgY29sb3I6IHJnYigzNSwgNDUsIDcxKTsgYm9yZGVyOiBu b25lOyBtYXJnaW4tYm90dG9tOiA0cHg7IGZvbnQtc2l6ZTogMTZweDsgbGluZS1oZWlnaHQ6IDIw cHg7IGZvbnQtd2VpZ2h0OiBib2xkZXI7IHRleHQtYWxpZ246IGxlZnQ7IiBkYXRhLW1jZS1zdHls ZT0iZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAnU291cmNlIEhhbiBTYW5zJywgc2Fucy1zZXJpZjsg Zm9udC1zdHlsZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQt dmFyaWFudC1jYXBzOiBub3JtYWw7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9ycGhhbnM6IDI7 IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6IDI7IHdvcmQt c3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdoaXRlLXNwYWNl OiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRleHQtZGVjb3Jh dGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0aWFsOyBjb2xv cjogIzIzMmQ0NzsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA0cHg7IGZvbnQtc2l6ZTog MTZweDsgbGluZS1oZWlnaHQ6IDIwcHg7IGZvbnQtd2VpZ2h0OiBib2xkZXI7IHRleHQtYWxpZ246 IGxlZnQ7Ij4KICA8c3BhbiBzdHlsZT0iZm9udC1zaXplOiAxNHB4OyBmb250LWZhbWlseTogQ2Fy bGlicmk7IiBkYXRhLW1jZS1zdHlsZT0iZm9udC1zaXplOiAxNHB4OyBmb250LWZhbWlseTogQ2Fy bGlicmk7Ij5CZXN0IHJlZ2FyZHM8L3NwYW4+CiA8L2Rpdj4KIDxkaXYgc3R5bGU9ImZvbnQtZmFt aWx5OiBQaW5nRmFuZywgJnF1b3Q7U291cmNlIEhhbiBTYW5zJnF1b3Q7LCBzYW5zLXNlcmlmOyBm b250LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12 YXJpYW50LWNhcHM6IG5vcm1hbDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3JwaGFuczogMjsg dGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czogMjsgd29yZC1z cGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hpdGUtc3BhY2U6 IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4dC1kZWNvcmF0 aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRpYWw7IGNvbG9y OiByZ2IoMzUsIDQ1LCA3MSk7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogNHB4OyBmb250 LXNpemU6IDE2cHg7IGxpbmUtaGVpZ2h0OiAyMHB4OyBmb250LXdlaWdodDogYm9sZGVyOyB0ZXh0 LWFsaWduOiBsZWZ0OyIgZGF0YS1tY2Utc3R5bGU9ImZvbnQtZmFtaWx5OiBQaW5nRmFuZywgJ1Nv dXJjZSBIYW4gU2FucycsIHNhbnMtc2VyaWY7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJp YW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBsZXR0ZXIt c3BhY2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0LXRyYW5z Zm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0 cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRpb24tdGhp Y2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRleHQtZGVj b3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgY29sb3I6ICMyMzJkNDc7IGJvcmRlcjogbm9uZTsgbWFy Z2luLWJvdHRvbTogNHB4OyBmb250LXNpemU6IDE2cHg7IGxpbmUtaGVpZ2h0OiAyMHB4OyBmb250 LXdlaWdodDogYm9sZGVyOyB0ZXh0LWFsaWduOiBsZWZ0OyI+CiAgPGJyIGRhdGEtbWNlLWJvZ3Vz PSIxIj4KIDwvZGl2PgogPGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVvdDtT b3VyY2UgSGFuIFNhbnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9u dC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBs ZXR0ZXItc3BhY2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0 LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10 ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRp b24tdGhpY2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRl eHQtZGVjb3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgY29sb3I6IHJnYigzNSwgNDUsIDcxKTsgYm9y ZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA0cHg7IGZvbnQtc2l6ZTogMTZweDsgbGluZS1oZWln aHQ6IDIwcHg7IGZvbnQtd2VpZ2h0OiBib2xkZXI7IHRleHQtYWxpZ246IGxlZnQ7IiBkYXRhLW1j ZS1zdHlsZT0iZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAnU291cmNlIEhhbiBTYW5zJywgc2Fucy1z ZXJpZjsgZm9udC1zdHlsZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7 IGZvbnQtdmFyaWFudC1jYXBzOiBub3JtYWw7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9ycGhh bnM6IDI7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6IDI7 IHdvcmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdoaXRl LXNwYWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRleHQt ZGVjb3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0aWFs OyBjb2xvcjogIzIzMmQ0NzsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA0cHg7IGZvbnQt c2l6ZTogMTZweDsgbGluZS1oZWlnaHQ6IDIwcHg7IGZvbnQtd2VpZ2h0OiBib2xkZXI7IHRleHQt YWxpZ246IGxlZnQ7Ij4KICBIYW5rJm5ic3A7IENoZW4KIDwvZGl2PgogPGRpdiBzdHlsZT0iY29s b3I6IHJnYigxMjIsIDEzMywgMTUzKTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVvdDtTb3Vy Y2UgSGFuIFNhbnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTRweDsgZm9udC1zdHls ZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQtdmFyaWFudC1j YXBzOiBub3JtYWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9y cGhhbnM6IDI7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6 IDI7IHdvcmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdo aXRlLXNwYWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRl eHQtZGVjb3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0 aWFsOyBib3JkZXI6IG5vbmU7IG1hcmdpbi1ib3R0b206IDhweDsgdGV4dC1hbGlnbjogbGVmdDsi IGRhdGEtbWNlLXN0eWxlPSJjb2xvcjogIzdhODU5OTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAn U291cmNlIEhhbiBTYW5zJywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBmb250LXN0eWxl OiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12YXJpYW50LWNh cHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3Jw aGFuczogMjsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czog Mjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hp dGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4 dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRp YWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyB0ZXh0LWFsaWduOiBsZWZ0OyI+ CiAgPGJyIGRhdGEtbWNlLWJvZ3VzPSIxIj4KIDwvZGl2PgogPGRpdiBzdHlsZT0iY29sb3I6IHJn YigxMjIsIDEzMywgMTUzKTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVvdDtTb3VyY2UgSGFu IFNhbnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTRweDsgZm9udC1zdHlsZTogbm9y bWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQtdmFyaWFudC1jYXBzOiBu b3JtYWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9ycGhhbnM6 IDI7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6IDI7IHdv cmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdoaXRlLXNw YWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRleHQtZGVj b3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0aWFsOyBi b3JkZXI6IG5vbmU7IG1hcmdpbi1ib3R0b206IDhweDsgdGV4dC1hbGlnbjogbGVmdDsiIGRhdGEt bWNlLXN0eWxlPSJjb2xvcjogIzdhODU5OTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAnU291cmNl IEhhbiBTYW5zJywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBmb250LXN0eWxlOiBub3Jt YWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12YXJpYW50LWNhcHM6IG5v cm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3JwaGFuczog MjsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czogMjsgd29y ZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hpdGUtc3Bh Y2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4dC1kZWNv cmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRpYWw7IGJv cmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyB0ZXh0LWFsaWduOiBsZWZ0OyI+CiAg5rex 5Zyz5Lic5p6B5Zu96ZmF54mp5rWB5pyJ6ZmQ5YWs5Y+4CiA8L2Rpdj4KIDxkaXYgc3R5bGU9ImNv bG9yOiByZ2IoMTIyLCAxMzMsIDE1Myk7IGZvbnQtZmFtaWx5OiBQaW5nRmFuZywgJnF1b3Q7U291 cmNlIEhhbiBTYW5zJnF1b3Q7LCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE0cHg7IGZvbnQtc3R5 bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZhcmlhbnQt Y2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0ZXItc3BhY2luZzogbm9ybWFsOyBv cnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dz OiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3 aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRpb24tdGhpY2tuZXNzOiBpbml0aWFsOyB0 ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1jb2xvcjogaW5p dGlhbDsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA4cHg7IHRleHQtYWxpZ246IGxlZnQ7 IiBkYXRhLW1jZS1zdHlsZT0iY29sb3I6ICM3YTg1OTk7IGZvbnQtZmFtaWx5OiBQaW5nRmFuZywg J1NvdXJjZSBIYW4gU2FucycsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTRweDsgZm9udC1zdHls ZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQtdmFyaWFudC1j YXBzOiBub3JtYWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9y cGhhbnM6IDI7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6 IDI7IHdvcmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdo aXRlLXNwYWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRl eHQtZGVjb3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0 aWFsOyBib3JkZXI6IG5vbmU7IG1hcmdpbi1ib3R0b206IDhweDsgdGV4dC1hbGlnbjogbGVmdDsi PgogIFNoZW5aaGVuIEVwb2xhciBMb2dpc3RpY3MgQ28uLExURAogPC9kaXY+CiA8ZGl2IHN0eWxl PSJjb2xvcjogcmdiKDEyMiwgMTMzLCAxNTMpOyBmb250LWZhbWlseTogUGluZ0ZhbmcsICZxdW90 O1NvdXJjZSBIYW4gU2FucyZxdW90Oywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBmb250 LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12YXJp YW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1h bDsgb3JwaGFuczogMjsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdp ZG93czogMjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBw eDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlh bDsgdGV4dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6 IGluaXRpYWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyB0ZXh0LWFsaWduOiBs ZWZ0OyIgZGF0YS1tY2Utc3R5bGU9ImNvbG9yOiAjN2E4NTk5OyBmb250LWZhbWlseTogUGluZ0Zh bmcsICdTb3VyY2UgSGFuIFNhbnMnLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE0cHg7IGZvbnQt c3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZhcmlh bnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0ZXItc3BhY2luZzogbm9ybWFs OyBvcnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9uZTsgd2lk b3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4 OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRpb24tdGhpY2tuZXNzOiBpbml0aWFs OyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1jb2xvcjog aW5pdGlhbDsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA4cHg7IHRleHQtYWxpZ246IGxl ZnQ7Ij4KICA8c3BhbiBkYXRhLW1jZS10eXBlPSJib29rbWFyayIgaWQ9Im1jZV8xOF9zdGFydCIg ZGF0YS1tY2Utc3R5bGU9Im92ZXJmbG93OmhpZGRlbjtsaW5lLWhlaWdodDowcHgiIHN0eWxlPSJv dmVyZmxvdzogaGlkZGVuOyBsaW5lLWhlaWdodDogMHB4OyI+PC9zcGFuPkFkZHJlc3M6Um9vbSA1 MDcsIEJ1aWxkaW5nIDgsWXVubGkgSW50ZWxsaWdlbnQgUGFyaywKIDwvZGl2PgogPGRpdiBzdHls ZT0iY29sb3I6IHJnYigxMjIsIDEzMywgMTUzKTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVv dDtTb3VyY2UgSGFuIFNhbnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTRweDsgZm9u dC1zdHlsZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQtdmFy aWFudC1jYXBzOiBub3JtYWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFjaW5nOiBub3Jt YWw7IG9ycGhhbnM6IDI7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3 aWRvd3M6IDI7IHdvcmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAw cHg7IHdoaXRlLXNwYWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRp YWw7IHRleHQtZGVjb3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9y OiBpbml0aWFsOyBib3JkZXI6IG5vbmU7IG1hcmdpbi1ib3R0b206IDhweDsgdGV4dC1hbGlnbjog bGVmdDsiIGRhdGEtbWNlLXN0eWxlPSJjb2xvcjogIzdhODU5OTsgZm9udC1mYW1pbHk6IFBpbmdG YW5nLCAnU291cmNlIEhhbiBTYW5zJywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBmb250 LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12YXJp YW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1h bDsgb3JwaGFuczogMjsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdp ZG93czogMjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBw eDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlh bDsgdGV4dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6 IGluaXRpYWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyB0ZXh0LWFsaWduOiBs ZWZ0OyI+CiAgTG9uZ2dhbmcgRGlzdHJpY3QsIFNoZW56aGVuLCBDaGluYQogPC9kaXY+CiA8ZGl2 IHN0eWxlPSJjb2xvcjogcmdiKDEyMiwgMTMzLCAxNTMpOyBmb250LWZhbWlseTogUGluZ0Zhbmcs ICZxdW90O1NvdXJjZSBIYW4gU2FucyZxdW90Oywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4 OyBmb250LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9u dC12YXJpYW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6 IG5vcm1hbDsgb3JwaGFuczogMjsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5v bmU7IHdpZG93czogMjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lk dGg6IDBweDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczog aW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24t Y29sb3I6IGluaXRpYWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyB0ZXh0LWFs aWduOiBsZWZ0OyIgZGF0YS1tY2Utc3R5bGU9ImNvbG9yOiAjN2E4NTk5OyBmb250LWZhbWlseTog UGluZ0ZhbmcsICdTb3VyY2UgSGFuIFNhbnMnLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE0cHg7 IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250 LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0ZXItc3BhY2luZzog bm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9u ZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0 aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRpb24tdGhpY2tuZXNzOiBp bml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1j b2xvcjogaW5pdGlhbDsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9tOiA4cHg7IHRleHQtYWxp Z246IGxlZnQ7Ij4KICBFbWFsbDpoYW5rQGVwbGxvZ2lzdGljcy5jbgogPC9kaXY+CiA8ZGl2IHN0 eWxlPSJjb2xvcjogcmdiKDEyMiwgMTMzLCAxNTMpOyBmb250LWZhbWlseTogUGluZ0ZhbmcsICZx dW90O1NvdXJjZSBIYW4gU2FucyZxdW90Oywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBm b250LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12 YXJpYW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5v cm1hbDsgb3JwaGFuczogMjsgdGV4dC1hbGlnbjogbGVmdDsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4 dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czogMjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQt dGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0 aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0 ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRpYWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRv bTogOHB4OyIgZGF0YS1tY2Utc3R5bGU9ImNvbG9yOiAjN2E4NTk5OyBmb250LWZhbWlseTogUGlu Z0ZhbmcsICdTb3VyY2UgSGFuIFNhbnMnLCBzYW5zLXNlcmlmOyBmb250LXNpemU6IDE0cHg7IGZv bnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFsOyBmb250LXZh cmlhbnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0ZXItc3BhY2luZzogbm9y bWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWFsaWduOiBsZWZ0OyB0ZXh0LWluZGVudDogMHB4OyB0ZXh0 LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsgLXdlYmtpdC10 ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0LWRlY29yYXRp b24tdGhpY2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGluaXRpYWw7IHRl eHQtZGVjb3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgYm9yZGVyOiBub25lOyBtYXJnaW4tYm90dG9t OiA4cHg7Ij4KICA8ZGl2IHN0eWxlPSJjb2xvcjogcmdiKDEyMiwgMTMzLCAxNTMpOyBmb250LWZh bWlseTogUGluZ0ZhbmcsICZxdW90O1NvdXJjZSBIYW4gU2FucyZxdW90Oywgc2Fucy1zZXJpZjsg Zm9udC1zaXplOiAxNHB4OyBmb250LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVy ZXM6IG5vcm1hbDsgZm9udC12YXJpYW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsg bGV0dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3JwaGFuczogMjsgdGV4dC1hbGlnbjogbGVmdDsgdGV4 dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czogMjsgd29yZC1zcGFj aW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hpdGUtc3BhY2U6IG5v cm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9u LXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRpYWw7IGJvcmRlcjog bm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyIgZGF0YS1tY2Utc3R5bGU9ImNvbG9yOiAjN2E4NTk5 OyBmb250LWZhbWlseTogUGluZ0ZhbmcsICdTb3VyY2UgSGFuIFNhbnMnLCBzYW5zLXNlcmlmOyBm b250LXNpemU6IDE0cHg7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJl czogbm9ybWFsOyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBs ZXR0ZXItc3BhY2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWFsaWduOiBsZWZ0OyB0ZXh0 LWluZGVudDogMHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNp bmc6IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9y bWFsOyB0ZXh0LWRlY29yYXRpb24tdGhpY2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24t c3R5bGU6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgYm9yZGVyOiBu b25lOyBtYXJnaW4tYm90dG9tOiA4cHg7Ij4KICAgVGVs77yaKzg2LTA3NTUtMjg1MDcxMjYKICA8 L2Rpdj4KICA8ZGl2IHN0eWxlPSJjb2xvcjogcmdiKDEyMiwgMTMzLCAxNTMpOyBmb250LWZhbWls eTogUGluZ0ZhbmcsICZxdW90O1NvdXJjZSBIYW4gU2FucyZxdW90Oywgc2Fucy1zZXJpZjsgZm9u dC1zaXplOiAxNHB4OyBmb250LXN0eWxlOiBub3JtYWw7IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6 IG5vcm1hbDsgZm9udC12YXJpYW50LWNhcHM6IG5vcm1hbDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0 dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3JwaGFuczogMjsgdGV4dC1hbGlnbjogbGVmdDsgdGV4dC1p bmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7IHdpZG93czogMjsgd29yZC1zcGFjaW5n OiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDBweDsgd2hpdGUtc3BhY2U6IG5vcm1h bDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLXN0 eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29sb3I6IGluaXRpYWw7IGJvcmRlcjogbm9u ZTsgbWFyZ2luLWJvdHRvbTogOHB4OyIgZGF0YS1tY2Utc3R5bGU9ImNvbG9yOiAjN2E4NTk5OyBm b250LWZhbWlseTogUGluZ0ZhbmcsICdTb3VyY2UgSGFuIFNhbnMnLCBzYW5zLXNlcmlmOyBmb250 LXNpemU6IDE0cHg7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczog bm9ybWFsOyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0 ZXItc3BhY2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWFsaWduOiBsZWZ0OyB0ZXh0LWlu ZGVudDogMHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6 IDBweDsgLXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFs OyB0ZXh0LWRlY29yYXRpb24tdGhpY2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5 bGU6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgYm9yZGVyOiBub25l OyBtYXJnaW4tYm90dG9tOiA4cHg7Ij4KICAgV2VjaGF0OisxOTkyNjU1MjM5NwogIDwvZGl2Pgog IDxkaXYgc3R5bGU9ImNvbG9yOiByZ2IoMTIyLCAxMzMsIDE1Myk7IGZvbnQtZmFtaWx5OiBQaW5n RmFuZywgJnF1b3Q7U291cmNlIEhhbiBTYW5zJnF1b3Q7LCBzYW5zLXNlcmlmOyBmb250LXNpemU6 IDE0cHg7IGZvbnQtc3R5bGU6IG5vcm1hbDsgZm9udC12YXJpYW50LWxpZ2F0dXJlczogbm9ybWFs OyBmb250LXZhcmlhbnQtY2Fwczogbm9ybWFsOyBmb250LXdlaWdodDogNDAwOyBsZXR0ZXItc3Bh Y2luZzogbm9ybWFsOyBvcnBoYW5zOiAyOyB0ZXh0LWFsaWduOiBsZWZ0OyB0ZXh0LWluZGVudDog MHB4OyB0ZXh0LXRyYW5zZm9ybTogbm9uZTsgd2lkb3dzOiAyOyB3b3JkLXNwYWNpbmc6IDBweDsg LXdlYmtpdC10ZXh0LXN0cm9rZS13aWR0aDogMHB4OyB3aGl0ZS1zcGFjZTogbm9ybWFsOyB0ZXh0 LWRlY29yYXRpb24tdGhpY2tuZXNzOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tc3R5bGU6IGlu aXRpYWw7IHRleHQtZGVjb3JhdGlvbi1jb2xvcjogaW5pdGlhbDsgYm9yZGVyOiBub25lOyBtYXJn aW4tYm90dG9tOiA4cHg7IiBkYXRhLW1jZS1zdHlsZT0iY29sb3I6ICM3YTg1OTk7IGZvbnQtZmFt aWx5OiBQaW5nRmFuZywgJ1NvdXJjZSBIYW4gU2FucycsIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTog MTRweDsgZm9udC1zdHlsZTogbm9ybWFsOyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7 IGZvbnQtdmFyaWFudC1jYXBzOiBub3JtYWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFj aW5nOiBub3JtYWw7IG9ycGhhbnM6IDI7IHRleHQtYWxpZ246IGxlZnQ7IHRleHQtaW5kZW50OiAw cHg7IHRleHQtdHJhbnNmb3JtOiBub25lOyB3aWRvd3M6IDI7IHdvcmQtc3BhY2luZzogMHB4OyAt d2Via2l0LXRleHQtc3Ryb2tlLXdpZHRoOiAwcHg7IHdoaXRlLXNwYWNlOiBub3JtYWw7IHRleHQt ZGVjb3JhdGlvbi10aGlja25lc3M6IGluaXRpYWw7IHRleHQtZGVjb3JhdGlvbi1zdHlsZTogaW5p dGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNvbG9yOiBpbml0aWFsOyBib3JkZXI6IG5vbmU7IG1hcmdp bi1ib3R0b206IDhweDsiPgogICBXaGF0c2FwcDo8c3BhbiBzdHlsZT0iY29sb3I6IHJnYig2Mywg NzMsIDE4Nik7IiBkYXRhLW1jZS1zdHlsZT0iY29sb3I6ICMzZjQ5YmE7Ij4rODYtMTM2MTAzNTM1 MDI8c3BhbiBkYXRhLW1jZS10eXBlPSJib29rbWFyayIgaWQ9Im1jZV8yN19zdGFydCIgZGF0YS1t Y2Utc3R5bGU9Im92ZXJmbG93OiBoaWRkZW47IGxpbmUtaGVpZ2h0OiAwcHg7IiBzdHlsZT0ib3Zl cmZsb3c6IGhpZGRlbjsgbGluZS1oZWlnaHQ6IDBweDsiPjwvc3Bhbj48L3NwYW4+PGJyIGRhdGEt bWNlLWJvZ3VzPSIxIj4KICA8L2Rpdj4KIDwvZGl2PgogPGRpdiBzdHlsZT0iY29sb3I6IHJnYigx MjIsIDEzMywgMTUzKTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAmcXVvdDtTb3VyY2UgSGFuIFNh bnMmcXVvdDssIHNhbnMtc2VyaWY7IGZvbnQtc2l6ZTogMTRweDsgZm9udC1zdHlsZTogbm9ybWFs OyBmb250LXZhcmlhbnQtbGlnYXR1cmVzOiBub3JtYWw7IGZvbnQtdmFyaWFudC1jYXBzOiBub3Jt YWw7IGZvbnQtd2VpZ2h0OiA0MDA7IGxldHRlci1zcGFjaW5nOiBub3JtYWw7IG9ycGhhbnM6IDI7 IHRleHQtYWxpZ246IGxlZnQ7IHRleHQtaW5kZW50OiAwcHg7IHRleHQtdHJhbnNmb3JtOiBub25l OyB3aWRvd3M6IDI7IHdvcmQtc3BhY2luZzogMHB4OyAtd2Via2l0LXRleHQtc3Ryb2tlLXdpZHRo OiAwcHg7IHdoaXRlLXNwYWNlOiBub3JtYWw7IHRleHQtZGVjb3JhdGlvbi10aGlja25lc3M6IGlu aXRpYWw7IHRleHQtZGVjb3JhdGlvbi1zdHlsZTogaW5pdGlhbDsgdGV4dC1kZWNvcmF0aW9uLWNv bG9yOiBpbml0aWFsOyBib3JkZXI6IG5vbmU7IG1hcmdpbi1ib3R0b206IDhweDsiIGRhdGEtbWNl LXN0eWxlPSJjb2xvcjogIzdhODU5OTsgZm9udC1mYW1pbHk6IFBpbmdGYW5nLCAnU291cmNlIEhh biBTYW5zJywgc2Fucy1zZXJpZjsgZm9udC1zaXplOiAxNHB4OyBmb250LXN0eWxlOiBub3JtYWw7 IGZvbnQtdmFyaWFudC1saWdhdHVyZXM6IG5vcm1hbDsgZm9udC12YXJpYW50LWNhcHM6IG5vcm1h bDsgZm9udC13ZWlnaHQ6IDQwMDsgbGV0dGVyLXNwYWNpbmc6IG5vcm1hbDsgb3JwaGFuczogMjsg dGV4dC1hbGlnbjogbGVmdDsgdGV4dC1pbmRlbnQ6IDBweDsgdGV4dC10cmFuc2Zvcm06IG5vbmU7 IHdpZG93czogMjsgd29yZC1zcGFjaW5nOiAwcHg7IC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6 IDBweDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgdGV4dC1kZWNvcmF0aW9uLXRoaWNrbmVzczogaW5p dGlhbDsgdGV4dC1kZWNvcmF0aW9uLXN0eWxlOiBpbml0aWFsOyB0ZXh0LWRlY29yYXRpb24tY29s b3I6IGluaXRpYWw7IGJvcmRlcjogbm9uZTsgbWFyZ2luLWJvdHRvbTogOHB4OyI+CiAgJm5ic3A7 Jm5ic3A7Jm5ic3A7PGltZyBzcmM9Imh0dHBzOi8vY293b3JrLXN0b3JhZ2UtcHVibGljLWNkbi5s eC5uZXRlYXNlLmNvbS9seGJnLzIwMjQvMDYvMDQvZWY5NmU5NTk4YWIxNGMxYThhZTNlYTk4MGMw NjBjNzIucG5nIiBkYXRhLXRpbWVkYXRlPSIxNzE3NDY4NTk5MjY0IiB3aXJ0ZS1vcmlnaW4tc3Jj PSJodHRwczovL2Nvd29yay1zdG9yYWdlLXB1YmxpYy1jZG4ubHgubmV0ZWFzZS5jb20vbHhiZy8y MDI0LzA2LzA0L2VmOTZlOTU5OGFiMTRjMWE4YWUzZWE5ODBjMDYwYzcyLnBuZyIgZGF0YS1zcmM9 InRlbXBsYXRlIj4KIDwvZGl2Pgo8L2Rpdj4gPGltZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBzcmM9 Imh0dHBzOi8vd2FpbWFvLW5vcnRoLXN0YXItbWFpbC5xaXllLjE2My5jb20vYXBpL3B1Yi9lZG0v cmVhZD9zaWduPVYyLmVJR1VvcVppYTRxLUJSTzFiVndxUU9RZWJGOEZaWnNmbGNGQzlacFhXa092 RnhrS04tZ0w3bGcwaTg0anYxYXVOOHlURE8tblBzZ3BoQngybHpKdFlPZkNiYUJVSG03OUo4ZFR5 LUl5ZC1WWWNCSWRGNERsN1BYMkFrbWFuT20xIj48YnI+ --=_Part_2244476_122023906.1736870890082-- From nobody Tue Jan 14 17:39:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXbw45Lvfz5kCTK; Tue, 14 Jan 2025 17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXbw44Z5sz42tJ; Tue, 14 Jan 2025 17: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=1736876340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dxPkoKZexFXwyxk6sTkXPmBVN8myqofZ3KrC4Ywaiew=; b=dYE9hkV4q9VTcNLeqcgotw2SuhZjfYaNG7kDBm5bMKTYa6AIxO4I1Fw+kVlfp/7d0voUD4 8RRdy3c/+aoRLx/5VqQ/QGbejQxRzMYz+ZfMdPdBWTQjh720xhgwKeinbvR9AoE3WGy8el YZT9JmVM6wOsMxG9Rwon+sEvu0M8KtHaEgStTqlGubAzP1HyjjlG/LhUjbeRaSo/GF5f6u xybBTj6YqYNRGIluoDe72+OC1pNQ5mQbZh4sdS+XNoBSDRXYmizIgPy76NWhA97vsE8bmi ZuOTBVnTu85+IqM0WKgXMGtbZQynsBcnfCODY+rT7neJiTHjNZn1f4c39TYnfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736876340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dxPkoKZexFXwyxk6sTkXPmBVN8myqofZ3KrC4Ywaiew=; b=mN0W+2MzN9/OZT9YVtnZZDCLZ58+ae0nctHsi6qyFgDJiqfz4tsawHNRBVHC12L9yLVPY3 Q8mqR7efl2L7HfiS1KCfyNb3oDOKYYReECP7gqgbqzPe1Ck1Rbd6uWQkaBEKQFGjsNDFHQ N20PPW9BFmBgoOCpJ/jxtNtIbS4i4Y8dLcC+ILmnjWGSnUpzTdiDVhaF8EnH0bAJ88Zula x0850d0w0yXZJ9ArjnX5dgaZh3667M/DB1TVS86do7GlbZxqRTnIToJ5iXtVe1I94yR6Wl 2jnAcwMMjvl38G3wbM1JYjJwVNi02HpBgppOp4hYsERkuLafjq+YWe5TU+Jntw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736876340; a=rsa-sha256; cv=none; b=OFZ3ryA/onUv21vmdEe3lHeHJkY1DLeLXJr/xkt11izg982XuxHkj5nSJriesZnRqolIu2 +Jdrm2S7sg26jFN47Zk0xCv1mLpPPY0azRc9lh2A+DdI4pHEpIltzt0y2tQW2/BrwKxaz7 6WPBmFrMEpihZM/4EQnZKBjTgF4OJ3WWoX0Czg9Z1zurpZmG9ACoSbTfFsbAGodk1jVa8/ x8hxlXdqgRDNm6Aws7X1gY3xmG8pxwcx6/kCLZsguerA/E+TuB9SqCbCM2FA8F1TIa6C7P xC1epbeRgFeK1eh1iQ6azI+YKNjPSe5SfHbdK5x9SsV6SyPjr9R+65CLcWzgTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXbw43rpVz1PTs; Tue, 14 Jan 2025 17: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 50EHd0P7036160; Tue, 14 Jan 2025 17: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 50EHd0a7036157; Tue, 14 Jan 2025 17:39:00 GMT (envelope-from git) Date: Tue, 14 Jan 2025 17:39:00 GMT Message-Id: <202501141739.50EHd0a7036157@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: 618d1621c2d4 - main - nvmecontrol: Fix error message for invalid Fabrics I/O queue size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 618d1621c2d42ba8b0e17c8ba0859c80e1b54367 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=618d1621c2d42ba8b0e17c8ba0859c80e1b54367 commit 618d1621c2d42ba8b0e17c8ba0859c80e1b54367 Author: John Baldwin AuthorDate: 2025-01-14 17:36:55 +0000 Commit: John Baldwin CommitDate: 2025-01-14 17:38:47 +0000 nvmecontrol: Fix error message for invalid Fabrics I/O queue size Sponsored by: Chelsio Communications --- sbin/nvmecontrol/fabrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/fabrics.c b/sbin/nvmecontrol/fabrics.c index de069e3df62a..27ecc8fb6cdc 100644 --- a/sbin/nvmecontrol/fabrics.c +++ b/sbin/nvmecontrol/fabrics.c @@ -457,7 +457,7 @@ connect_nvm_queues(const struct nvmf_association_params *aparams, else if (queue_size > (u_int)mqes + 1) { shutdown_controller(*admin); nvmf_free_association(na); - warn("I/O queue size exceeds controller maximum (%u)", + warnx("I/O queue size exceeds controller maximum (%u)", mqes + 1); return (EX_USAGE); } From nobody Tue Jan 14 17:54:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXcFW1LlCz5kD7S; Tue, 14 Jan 2025 17:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXcFW0VHhz445W; Tue, 14 Jan 2025 17:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vp0X9WE27XzrSgAJLwXmxpH78yr7BDCDCr6QmfbsxrA=; b=NUkfs7kv0d4q7gfwSfxq/B8l5AgzgatKt3zsHgdlE6uVo0g8+fu7WBSLS/cx9mSfKRoMJ+ ueis1b3nlt+XM8/I24Q4wzxC5Q5bGZ6HPxD8itHjBGe1ylNjxHz3jcEGg1SkYRclRZdk18 0qX5hqj1Q3oFtfteAup5OmFK0Of54B/4Ch4gMnBENZBn+BhUMYCCVrwi2lteFySE8qm8qR vuBBVb53+tAs0s8/8vFxUYfQUZSiiwIbBQbH30bdbqpb3NEgrc3Au/grQce5fouvHMNCCa y2K7kNM5qT+iicM63ls2JyjUm+J7l1pymtF7ljvVYvHt5pKB7FquDmWIwmtwIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vp0X9WE27XzrSgAJLwXmxpH78yr7BDCDCr6QmfbsxrA=; b=ybB5NbIq0p0aRSt2FOVtq5bJRM9CgjWPVSRRYxHBCxta5VbAIQxQJfHzTBZhr8ZtJIpRmt T6sXcekKzCh+BultCf6G3kHkk2DH1CpwtlUKAZ31VMtwmL/+bZyiBtVL2lL3/VByYZwiiT DuilNuCfQAGk72UXERfvuiMWPfmjH3Pu7veZuZsgUtIN6DCl4h/GgsKLYgxTiUZ2DvSFBd s3caRBACmWbZK7Cx0ZGkP5hEMbTlz2qRSCGEshShj5LdIV/DbYdgIl7MkLZC8Axog5yYXz ccBxZb1+5EoDItluNvnJviiC1Ks9XbU3Ps0MVC47gjF1jtp+vjORgRLJOahmQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736877247; a=rsa-sha256; cv=none; b=ytyCRNvjhO3lOD4RoNw8pjEDsWkuJIwkQm0Mnuma4QOqgKeR+E1pTeKaokJ8DkKHcebQ0z WLo6ehqiQhUf2+0eDqyl4chzKI+OFQ06d0iFQyzzMD6/zbr4Slyr9a+J3ajwXLC89/B5mA qAAzPd3SHUmyONfa0k9p8fWcjEVeIniuLSQ3v6NZmt9iIVrchNlnn7pJwmknCpPp/V+/Oq tQWGvjRaAeHSDROs7ia4luYT1OR+MN4Wdux3TYg48KlVC0zf9uNwIU0ITcN9bdGSOtCegu fylQGPfpP2UohjdxftmE1LZUgwpRjVAEkEDLysIz7qiq3MLO1tA1BnHInKnXkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXcFV70h3z1QST; Tue, 14 Jan 2025 17:54: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 50EHs63t071992; Tue, 14 Jan 2025 17:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EHs6kJ071989; Tue, 14 Jan 2025 17:54:06 GMT (envelope-from git) Date: Tue, 14 Jan 2025 17:54:06 GMT Message-Id: <202501141754.50EHs6kJ071989@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: bec5a3c046ba - main - nextboot: Smarter warning about deleting nextboot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bec5a3c046ba2bd970679a31f7227f260bef4935 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bec5a3c046ba2bd970679a31f7227f260bef4935 commit bec5a3c046ba2bd970679a31f7227f260bef4935 Author: Warner Losh AuthorDate: 2025-01-14 17:32:01 +0000 Commit: Warner Losh CommitDate: 2025-01-14 17:52:54 +0000 nextboot: Smarter warning about deleting nextboot Read only filesystems always error when trying to remove something with EROFS. However, that's true even if the file isn't there. The code assumed it would always get a ENOENT if the file wasn't there, but produced a gross message on read only systems. This message was harmless, but annoying. Instead, stat the file first and return if it's already not there. Some readings of POSIX require that the ENOENT error take precidence over the EROFS error. Linux made this change years ago, and we should too. POSIX.1-2024 isn't explicit, but does say for unlink() does say "[EROFS] The directory entry to be unlinked is part of a read-only file system" and "[ENOENT] A component of path does not name an existing file" implying that EROFS should only be returned for an existing file. FreeBSD doesn't implement this, so this workaround is necessary. Ideally, we'd fix this in the kernel in the future. Sponsored by: Netflix Discussed with: jrtc23 Differential Revision: https://reviews.freebsd.org/D48425 --- sbin/reboot/reboot.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index c6b0e0980c88..9825d4f96319 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -308,7 +308,22 @@ main(int argc, char *argv[]) errx(1, "-r and -k cannot be used together, there is no next kernel"); if (Dflag) { - if (unlink(PATH_NEXTBOOT) != 0 && errno != ENOENT) + struct stat sb; + + /* + * Break the rule about stat then doing + * something. When we're booting, there's no + * race. When we're a read-only root, though, the + * read-only error takes priority over the file not + * there error in unlink. So stat it first and exit + * with success if it isn't there. Otherwise, let + * unlink sort error reporting. POSIX-1.2024 suggests + * ENOENT should be preferred to EROFS for unlink, + * but FreeBSD historically has preferred EROFS. + */ + if (stat(PATH_NEXTBOOT, &sb) != 0 && errno == ENOENT) + exit(0); + if (unlink(PATH_NEXTBOOT) != 0) warn("unlink " PATH_NEXTBOOT); exit(0); } From nobody Tue Jan 14 17:55:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXcGn5tb1z5kD0p; Tue, 14 Jan 2025 17:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXcGn5Kwfz44cx; Tue, 14 Jan 2025 17:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdrIVILWEfg4MH7TaFDr4FeWt0Sp3fcxG9elz7SUGVU=; b=UtFxOyJs5kyvmlpzApZvcR7e5PiuYcHPGWxzRIKADOtr24xXmZP+VlS41RFSzFBErgl7nT JfvLmSJ+zLnLkxh2A2Z5+3X/EYfIrR8lVP6+HJubzy/wVC/jg2g/Jgi2d0yl9a//KBIc0y 3kNCqXEmVQOdKEFdss59+gBvrdn/66Mg7l8IF4TuFcdWeRlqmE6JFHVzUNG0/stO0bCf/U NqmN7qHPpJCiUO3NfKdw7bYxA9RjPeqbugrWv0v5y/x8qZ+A/p5DG918pj1PH8TtHWuxNm mt1hjbmfGaFGAi6ukfly/wz8Me9uwzyEOfhgOD1ZIPxy4troplb2KfHJztAq3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdrIVILWEfg4MH7TaFDr4FeWt0Sp3fcxG9elz7SUGVU=; b=fUYOLB2h5JmhuDjLh1V9BUmt2hZlj8+CRV/voqHyBpi/4NZuU/OvTly2B0PHGYcPbe/c2U e6tNGQWYI9YusNipLE1ZTD6tHb/ZRBOCKzW3nO+58ygiD9K0fls25lyEr0Mg1obAnU2FOm mg7B/aZlljgIzAKLP8yh0HW4GXi0mUvfjJSHIWhhOa1hD1qrRT2Wy43wiTEacRtrnPkSfF HhytdF5BO3evrwxeATqChoSyYumqMpwS6DXSOqjjrLsDqGOnSFQ7BCrpDvPXOPiTzsVkUf O88vEYLM+AZ9QMEOGspZkMRAMpKXYPxmS4wWIWybmEoxkWSivoEi23CAHGTtdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736877313; a=rsa-sha256; cv=none; b=qUsJ4HfhxkAFLAK0icjNPsrnaCmXRvPX1sfY6l7X238njnnWacuqQPCM8009KBzwOCIOfb H+3B+fNCTlo8DzP5bAPQjwsy8ITPiXPxuEzxDpypb4D0i1hHqaaBOyxN0I+BJsdTlH/TCV +ykFIuaGIBUQVgKgrCq8LG4FlEtx9T+MLaKeowdQ5DSdAo9qw8OELOa67YKfNh/w3IW3i5 +4A5ua18tGp06Qaa9NKtH42v37rJ8DBI2Gx6HuHPEJZvvyGT2zZ7qaNG/zAzxQxSnhF+In 0DAnNOOtJaecdT7w2Mh1+HFkNSrIX+qTZN/qo9OxF+ld1yX04CfxvuY25H7NzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXcGn4kQbz1QSV; Tue, 14 Jan 2025 17:55: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 50EHtDV7072545; Tue, 14 Jan 2025 17:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EHtD0T072542; Tue, 14 Jan 2025 17:55:13 GMT (envelope-from git) Date: Tue, 14 Jan 2025 17:55:13 GMT Message-Id: <202501141755.50EHtD0T072542@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: 4804cb433dbe - main - libthr: use atomic_add_int() instead of atomic_fetchadd_int() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4804cb433dbec2555695dc2bf391f286f2172621 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4804cb433dbec2555695dc2bf391f286f2172621 commit 4804cb433dbec2555695dc2bf391f286f2172621 Author: Konstantin Belousov AuthorDate: 2025-01-13 19:18:40 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 17:55:07 +0000 libthr: use atomic_add_int() instead of atomic_fetchadd_int() the return value is ignored. Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48454 --- lib/libthr/thread/thr_list.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index 7da851dff681..bca2bfc75fef 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -149,16 +149,16 @@ _thr_alloc(struct pthread *curthread) if (thread == NULL) { if (total_threads > MAX_THREADS) return (NULL); - atomic_fetchadd_int(&total_threads, 1); + atomic_add_int(&total_threads, 1); thread = calloc(1, sizeof(struct pthread)); if (thread == NULL) { - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } if ((thread->sleepqueue = _sleepq_alloc()) == NULL || (thread->wake_addr = _thr_alloc_wake_addr()) == NULL) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); return (NULL); } } else { @@ -176,7 +176,7 @@ _thr_alloc(struct pthread *curthread) thread->tcb = tcb; } else { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); thread = NULL; } return (thread); @@ -202,7 +202,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread) thread->tcb = NULL; if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { thr_destroy(curthread, thread); - atomic_fetchadd_int(&total_threads, -1); + atomic_add_int(&total_threads, -1); } else { /* * Add the thread to the free thread list, this also avoids From nobody Tue Jan 14 17:55:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXcGp6dskz5kDPF; Tue, 14 Jan 2025 17:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXcGp65TSz44qd; Tue, 14 Jan 2025 17:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTwfkDo+alpuPtnE8W+dInciCLliYAobHONfjehRvEE=; b=Oa9p3uRbsGg6RxY8tMTkJuhnQvxtHx0T5BF08974Dppf7PBuoKHJgPI2kvcJ5RHGvvSQbZ aF+IfvrFcG9Vc1iRibaaw1cSZoTi6JDdNwYNfX2KoumD1OD164GgJ8hWNolnnkLbBsa4lm aKiwgXoRfxLBsPZ8gvRG9JPiIQJeyigfPF/IghvMcT2U7QzDKQdF8oAs7uqjA2MRSQZMLG aTo1AhiXHoNT/KSHezsIXW9hMXJTc5t2A17+aoR005L3lHlU7kmXHFvk5Oo0IbmfF2+WCE AHcrT37KTTmw/KXFCqFe27irVFlRbTqf7wZuR2rlS18A4l5xRDu5eUUvvwMFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTwfkDo+alpuPtnE8W+dInciCLliYAobHONfjehRvEE=; b=Vsch4Tzh1+iC4Gf+tQbpXs9Bg5oOH+4UvAWIJfOgh+DdhKpjvADkMKL/ZQB2/tsFL2F9y5 hbBCVvcC+Cmz0TsPj8O13cSxGeptgpYlKVMN894HBCONl8E19vh8tBM4oYTHASGI/KruB2 XImtZTsX6kG+sA3zD5ExybkgG/3gYFDq0ld6Wbo2/en+EUH+ww2tOc+ftObIjoTc0ERccr nnwGTDr2fc1dVxwqRIGm+dE7K3g5DdaSljee2qFoJs00oGY48yJu9LIfjB8ra6cY91DzB7 o9vkWCO0PXI970bGiNlzmpbm1wEOOUoWp0pAEBIvHRTdSdVMq4op0ShJqKpB+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736877314; a=rsa-sha256; cv=none; b=rFnkybZfLrxdMri9nyDoI3uHKAfamoTo7R/ecDFJmK8xz6kqpn/v/uxlxW06FrYbC8HT6x vPDie6f96CpEEz8S0V2nrjs9jb9U4SE+CALcijDm/+fOmnDTlOUhZmIFem8u43a4FUlJ4U AaHvqY2Kr2NLatEYAoUpeGjw2BxANowes87E1RjtQGYMxgveeBWt6uHueggpBMVQjWleiE qT9n7SI7igbwkr/dP98nNGu1Vf6c5odzyqinvoGGCWDxi4juLXVpQ6nkWB0Zd5ZwdY23+b gOShd1P3H0//gffw2GGoOlysaNtQmdwHFd9qPY1X5a28+j5FNrASSDFXKi1O+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXcGp5h1vz1Phx; Tue, 14 Jan 2025 17:55: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 50EHtEq6072587; Tue, 14 Jan 2025 17:55:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EHtE5s072584; Tue, 14 Jan 2025 17:55:14 GMT (envelope-from git) Date: Tue, 14 Jan 2025 17:55:14 GMT Message-Id: <202501141755.50EHtE5s072584@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: 9718f18471f7 - main - pthread_mutex_trylock(): init libthr if needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9718f18471f700b271eb898c764e02b7fcd3766f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9718f18471f700b271eb898c764e02b7fcd3766f commit 9718f18471f700b271eb898c764e02b7fcd3766f Author: Konstantin Belousov AuthorDate: 2025-01-12 11:28:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 17:55:07 +0000 pthread_mutex_trylock(): init libthr if needed Reported by: yuri Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48454 --- lib/libthr/thread/thr_mutex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index ca8971cc720a..32bdc4afe65f 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -619,6 +619,7 @@ __Tthr_mutex_trylock(pthread_mutex_t *mutex) uint32_t id; int ret, robust; + _thr_check_init(); ret = check_and_init_mutex(mutex, &m); if (ret != 0) return (ret); From nobody Tue Jan 14 17:55:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXcGr69nDz5kDBt; Tue, 14 Jan 2025 17:55:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXcGq70Y2z44LG; Tue, 14 Jan 2025 17:55:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vjg7gx+3vIXAeYyJ4Ya0VqN62BQvUCz/XiEPkJ/Ngic=; b=hECWCzieg5M/1LcqvdikWeEH5tdoVMlC9F70hWKCjhuTbgQGnnBNxlP6Zy8huHf5oygmZm AVFR8T4Xn3/77SCvA/HrrAHThELzqli1UW2kwL3LsM26wb7OX1t+tXFZdh+zmVkPKlpd8m 0+NBTGW2cLKk0VDjkIyE8J4VaNZFUtHZSVBd6p9mzbtxro/6pGfYo7CHP8yPXKgeqJGU+G uz58bmg0Cd0GgSNgCAszD7mQbzCqDrhkaidJoCHClXwDCHg09glqUjVRVTnG3ktnXu48n5 GX2BVltasqp5VzmS8suBclXcatbjjz9RMOb+bfLJ1na58lSy2Mjn6rMxNR2vfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736877316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vjg7gx+3vIXAeYyJ4Ya0VqN62BQvUCz/XiEPkJ/Ngic=; b=V4G+xbTktaYVw4Ts6znsEGybFdU1Sxj/d8iohSzQ5F3UoPx1JyNQokQ5LLMmdWKeYQB1f7 xQ9BO67WPWV1DQRN0ZuAdu0lp9MJASYymPnaKn4453icUQZusi40ARtOARmh86HucWVD6r rL5qDMpd0bJrJrR63TlUhup5nOhoJdPKGQR40yvzfWrbTVbNw4seBSuiCR3Di7zgSBb3pd tR0GCxecJpMfl0LRdvYWm362leljdFQX4WQieJcTBCZYRvlaKIDI79LR11jv80rVqHEv1P tA6L+XKGM0QKoQXwd0s+GuLGo76IX7XVU3EoFZKX40t9K3Xbc8lPOGHcxtTKBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736877316; a=rsa-sha256; cv=none; b=w6R8FyrvmFIXvQ+zN5QtYC96XoBg+wpJaO2CW0h68LAvHWrctY2yOIfcT2/Vr3AlNtUN9Z oHo/0M2DOjk+cyuMUqIkgsMyPY461Q+PllLUq+IdkALB2xhjQyu32L8JJ3MvHyioBMhSBe MJXSbX/FrKvMe2oWhg1Lx79w1s5zbhpZsNKFeZiDLi3cFju8jWEtE4PMuP83JXc+u5C2iv Yj1M5v555NQxM+AanqoqhwiIMGwMR62P7o4wIQdnV2FpEjKtm1DH19ML/7SjB7PeoYIb0n 73jOyLcOsgdJbgds+YrOtryg6jODHsEOjRqpx5Sg9VSbPM2Toq+vzhQDOX2O7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXcGq6TKRz1PW2; Tue, 14 Jan 2025 17:55: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 50EHtFEf072650; Tue, 14 Jan 2025 17:55:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EHtFwt072647; Tue, 14 Jan 2025 17:55:15 GMT (envelope-from git) Date: Tue, 14 Jan 2025 17:55:15 GMT Message-Id: <202501141755.50EHtFwt072647@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: 9a2ae72421cd - main - libthr: switch thread and sleepq memory allocator to crt from libc malloc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a2ae72421cd75c741984f63b8c9ee89346a188d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9a2ae72421cd75c741984f63b8c9ee89346a188d commit 9a2ae72421cd75c741984f63b8c9ee89346a188d Author: Konstantin Belousov AuthorDate: 2025-01-14 09:06:58 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 17:55:08 +0000 libthr: switch thread and sleepq memory allocator to crt from libc malloc There are more complex interactions between malloc and libthr initialization that can happen if libthr functions are called from ELF object' constructors, before libthr is initialized. Break the dependencies loop by using the private allocator with controlled init. Reported by: yuri Reviewed by: markj, olce Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48454 --- lib/libthr/thread/thr_list.c | 4 ++-- lib/libthr/thread/thr_sleepq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c index bca2bfc75fef..bbc1d2899cb9 100644 --- a/lib/libthr/thread/thr_list.c +++ b/lib/libthr/thread/thr_list.c @@ -150,7 +150,7 @@ _thr_alloc(struct pthread *curthread) if (total_threads > MAX_THREADS) return (NULL); atomic_add_int(&total_threads, 1); - thread = calloc(1, sizeof(struct pthread)); + thread = __thr_calloc(1, sizeof(struct pthread)); if (thread == NULL) { atomic_add_int(&total_threads, -1); return (NULL); @@ -222,7 +222,7 @@ thr_destroy(struct pthread *curthread __unused, struct pthread *thread) _sleepq_free(thread->sleepqueue); if (thread->wake_addr != NULL) _thr_release_wake_addr(thread->wake_addr); - free(thread); + __thr_free(thread); } /* diff --git a/lib/libthr/thread/thr_sleepq.c b/lib/libthr/thread/thr_sleepq.c index d7de9ab4e25a..9c680acd0ac0 100644 --- a/lib/libthr/thread/thr_sleepq.c +++ b/lib/libthr/thread/thr_sleepq.c @@ -62,7 +62,7 @@ _sleepq_alloc(void) { struct sleepqueue *sq; - sq = calloc(1, sizeof(struct sleepqueue)); + sq = __thr_calloc(1, sizeof(struct sleepqueue)); TAILQ_INIT(&sq->sq_blocked); SLIST_INIT(&sq->sq_freeq); return (sq); @@ -71,7 +71,7 @@ _sleepq_alloc(void) void _sleepq_free(struct sleepqueue *sq) { - free(sq); + __thr_free(sq); } void From nobody Tue Jan 14 20:42:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXh0K4DYCz5kPPn; Tue, 14 Jan 2025 20:42:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 4YXh0K0cxMz4K6f; Tue, 14 Jan 2025 20:42:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-467a3c85e11so39898081cf.2; Tue, 14 Jan 2025 12:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736887375; x=1737492175; 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=Dedt2iOdRid8QeXO3wtoStVGyLUekpZE+D2rqVAFzvQ=; b=Vmqi/AtgJZYoZam/NwsG/McaC8JiYHeaUAuxxVU3sNzlNJpeHX8lwUFIUWDTIL9Lrn PeTY59fcpAhk6TvdnPwvdW93HAi9qDwqd4HtASCL4/hkbBEtrmhf8QSLpS6d/sGx/N5T 3aOCUMEhmpl8pArbMKhcNOLJanIF8rlsmjWr96qONHWBophn2s6WFubGCvhN//3zeSK1 T5jQVJzILr8NkoBsXXl2zoct+scnBFa/+ADlE0AdZS+8QJA5/5odJJY313N3V8+4JcAP CTS5zE/PsfCrnP4ngAOY2VYta3HyyPH6qktSUPDJtfKCBrzzkARA1lYy5thd9dRTdJfj la2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736887375; x=1737492175; 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=Dedt2iOdRid8QeXO3wtoStVGyLUekpZE+D2rqVAFzvQ=; b=q6WdO6GZVSbld3aeU/TXp8hh5s5f9n7rdekHIE9nHBIdxuFVmmudfHY2lOr64hEhd1 vhNwQPWmvnAP4USUT4EFNIuNj1OBYMfH+lFoFgaBJVpG7vY7+qCE7L7EaVhjlkoMxxJp lQZbmZMXtKYh9Wbe6xQz7cHKP3p9GG3ntuhfHtoI/+W4lhnccXOX+EiGfLG3Xr4DqWJU 0D6ZiKpcA5MUP7A8q8SJe5qIOqfpXNGZZIAUtk7esLYhqSf//jpC2pT1BENfjgNHqKIP uG1nruMM6SpVkOzVntITkReugXMXmFJZSHSl8n0XespYN4M3V7XpMiM6ZlLfgtRzaNtJ GzxA== X-Forwarded-Encrypted: i=1; AJvYcCWty6ayp3//mwBoFODOJ2kh1aSiGab0q4bgMSn3Vkm1iVZq9sxcOzgnVdG+ercFb7vXW7bon57++VDEqXVWfRLxoXwY8Eg=@freebsd.org, AJvYcCXodiV+kwe+unO9d8iZi2k4/YJKUtOgkseSucK8T5kPqwNISi2Ze5KNyvThNa/uDLYfVcQ+vFnEqMk0CZiLGQrc5w5X@freebsd.org X-Gm-Message-State: AOJu0YwOVzk372G6AHkL6AIyrALEoeMPvCyUmlJu8AiLkzm7bmGF+C7T CzVeZsjE17/OGOAQ+Dj/OBbSOwmA35EUf4dpPl/F+23FpMdJOmlqtXHPoA== X-Gm-Gg: ASbGncvgoejJYgN65RQHpJVmTOd4yk5AzxT/cB2XVps8FIoPV2YujKatmbnj7YEfHBk tTUuGfdTt7yYn0WYdmUd/09t04OCsIZNW2mcq46JWyijYZsEf+hmz1Gps+4nH16/CwW7mXnEeZV l1bHz4IWVu2lD2TMK7f33Q+0p9ewKMrpF5KyTwigrcWE1MrKFmk5A6Tiu8OslIjs44KVTTfuzXm oMyMWuhE+6y0bbLcp5KKzSx/i3uMwDYi41m2nHrfQzhfwJocjmKERiKaCwnud5G/FC78dk= X-Google-Smtp-Source: AGHT+IEwpkokaGMxzMKZU4zTgiwEmzBdKBtA0IGRgRvb96T3VFekfM+tMGILn4Cn7p/U0NeqG7V6Pg== X-Received: by 2002:a05:622a:1314:b0:467:5da6:808f with SMTP id d75a77b69052e-46c7108f485mr385721951cf.22.1736887375338; Tue, 14 Jan 2025 12:42:55 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dfade72b04sm56325036d6.83.2025.01.14.12.42.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 12:42:54 -0800 (PST) Date: Tue, 14 Jan 2025 15:42:52 -0500 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: 9a2ae72421cd - main - libthr: switch thread and sleepq memory allocator to crt from libc malloc Message-ID: References: <202501141755.50EHtFwt072647@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501141755.50EHtFwt072647@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4YXh0K0cxMz4K6f 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 Tue, Jan 14, 2025 at 05:55:15PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a2ae72421cd75c741984f63b8c9ee89346a188d > > commit 9a2ae72421cd75c741984f63b8c9ee89346a188d > Author: Konstantin Belousov > AuthorDate: 2025-01-14 09:06:58 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-01-14 17:55:08 +0000 > > libthr: switch thread and sleepq memory allocator to crt from libc malloc > > There are more complex interactions between malloc and libthr > initialization that can happen if libthr functions are called from ELF > object' constructors, before libthr is initialized. Break the > dependencies loop by using the private allocator with controlled init. > > Reported by: yuri > Reviewed by: markj, olce > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D48454 I see some startup deadlock when running the googletest regression tests (/usr/tests/lib/googletest/gmock_main) after this commit. gdb (which itself also hangs due to this bug) shows: (gdb) bt #0 _umtx_op_err () at /home/markj/sb/main/src/lib/libsys/amd64/_umtx_op_err.S:38 #1 0x000015e1ba96fd2c in __thr_umutex_lock (mtx=0x15e1ba974468, id=100113) at /usr/src/lib/libthr/thread/thr_umtx.c:69 #2 0x000015e1ba966a41 in __thr_calloc (num=1, size=17) at /usr/src/lib/libthr/thread/thr_malloc.c:92 #3 0x000015e1ba969213 in mutex_init (mutex=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) 0x15e1bd5c0240, mutex_attr=, calloc_cb=) at /usr/src/lib/libthr/thread/thr_mutex.c:291 #4 init_static (thread=0x1dc347e4b008, mutex=mutex@entry=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) 0x15e1bd5c0240) at /usr/src/lib/libthr/thread/thr_mutex.c:307 #5 0x000015e1ba967192 in check_and_init_mutex (mutex=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) 0x15e1bd5c0240, m=) at /usr/src/lib/libthr/thread/thr_mutex.c:606 #6 __Tthr_mutex_lock (mutex=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) 0x15e1bd5c0240) at /usr/src/lib/libthr/thread/thr_mutex.c:751 #7 0x000015e1bd54e714 in std::__1::__libcpp_mutex_lock[abi:se190105](pthread_mutex**) (__m=0x15e1ba974468) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/include/__thread/support/pthread.h:95 #8 std::__1::__call_once (flag=@0x15e1bd5c0cf0: 0, arg=0x11, func=0x0) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/call_once.cpp:44 #9 0x000015e1bd58a6a3 in std::__1::call_once[abi:se190105](std::__1::once_flag&, std::__1::locale::id::__get()::$_0&&) ( __flag=..., __func=...) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/include/__mutex/once_flag.h:131 #10 std::__1::locale::id::__get (this=0x15e1bd5c0cf0 ::id>) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:596 #11 std::__1::locale::__imp::install > (this=0x15e1bd5c0e30 , f=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:153 #12 std::__1::locale::__imp::__imp (this=this@entry=0x15e1bd5c0e30 , refs=refs@entry=1) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:161 #13 0x000015e1bd58c143 in std::__1::__no_destroy::__emplace[abi:se190105](unsigned int&&) ( this=0x15e1bd5c0e30 , __args=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/include/__utility/no_destroy.h:42 #14 std::__1::locale::classic()::$_0::operator()() const (this=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:502 #15 std::__1::locale::classic () at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:500 #16 0x000015e1bd58ea0b in std::__1::locale::__global () at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:509 #17 std::__1::locale::locale (this=0x15e1bd5c0798) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/locale.cpp:523 #18 0x000015e1bd55fcf0 in std::__1::basic_streambuf >::basic_streambuf (this=warning: (Internal error: pc 0x15e1bd5c0790 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0790 in address map, but not in symtab.) 0x15e1bd5c0790) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/include/streambuf:300 #19 0x000015e1bd56d9b8 in std::__1::__stdinbuf::__stdinbuf (this=warning: (Internal error: pc 0x15e1bd5c0790 in read in CU, but not in symtab.) warning: (Error: pc 0x15e1bd5c0790 in address map, but not in symtab.) 0x15e1bd5c0790, __fp=0x15e1c095a560, __st=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/std_stream.h:72 #20 std::__1::DoIOSInit::DoIOSInit (this=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/iostream.cpp:131 #21 0x000015e1bd56e06d in std::__1::ios_base::Init::Init (this=) at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/iostream.cpp:166 #22 0x000015e1bd56eef5 in __cxx_global_var_init () at /home/markj/sb/main/src/contrib/llvm-project/libcxx/src/iostream_init.h:2 #23 0x000015e1bd56eef5 in global constructors keyed to 000100 () from /lib/libc++.so.1 #24 0x0000357474de453d in objlist_call_init (list=list@entry=0x15e1b85f0a70, lockstate=lockstate@entry=0x15e1b85f0860) at /home/markj/sb/main/src/libexec/rtld-elf/rtld.c:3110 #25 0x0000357474de3219 in _rtld (sp=, exit_proc=0x15e1b85f0ae0, objp=0x15e1b85f0ae8) at /home/markj/sb/main/src/libexec/rtld-elf/rtld.c:974 #26 0x0000357474de0019 in rtld_start () at /home/markj/sb/main/src/libexec/rtld-elf/amd64/rtld_start.S:40 From nobody Tue Jan 14 21:08:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhYG1cgkz5kR52; Tue, 14 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhYG02G3z4Nf3; Tue, 14 Jan 2025 21: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=1736888882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMRVIa2jjxKAe9lV0jVizjRgCI+XaL10JrML13dPUHg=; b=eI0bkfpCQvETiUYFUVc7Oe0wR2VNsiT3CqaBQQDTKrtZEjkIXEjJbG7EOWSk77LRp1TeE7 1t3lcHQdRVoYKuCK1M3GBtwuKJJEJ5FPz4TOOmkAu7VAxvLXhxjDpbbAjvEz+7Ow3AEwB6 9H50nfuUrbpl8++XfKPZ+x/DIUf9zLw601/Nnisl7PhK25sU4VqDSBsIrT5UTKGmswblMb vpNAuVyuLuwHvlSx0tbp+lIqkSghytMV0VyVF2tb/hbRPrvXaX3mtzRLJpTNKr7d7M/AcK nN2cEgsHLAr6Da+hmjqpYOOTQZI2hLQh20UJTFO2W+pZK9GHtUN0IfUhspAp1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMRVIa2jjxKAe9lV0jVizjRgCI+XaL10JrML13dPUHg=; b=EEIFJkfC3H9Yv/lYe0mq0EdRCL4S2vAaOOSEskuqOazxN8WACVvi2HACz5ZboVl6oW1X7g yAYY0VSF0fmUs7JkY1G7kbfZwSFfGxx7qmzae2wBuur1OFsS5adIoqbqe+nafCqd4jmEH9 Skv9svnXl4pvJOjb6pnmAI9+jT1BCJv8j4lm8v5xrIx5A5zimdC4HAoPxCxpxdv5ksKja8 5H4tlfwFXeBAPoRStWQNuXoQufvDBZMu27Nnsi5soudV8d7lLL1QrgBWcpixbLpOga6nc8 Xf5FgmoycTPmpXN69qqKhfW1B9qKZi0IdnT7zbLlDOz6lSeSTYLZK2Wk8mlH3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736888882; a=rsa-sha256; cv=none; b=QgDBvTC0yRZIs9dqDyyb9RCIYtzM8J6Cou7eXE6tdaPBiVf/K7sDl5uYO5W5fP/TEwbMxx YB0+1RF+9dokxhwPSvVYyEndaz4gpuXVnCcYYlixqc3qx2K1w0t9A4iN0baLhGXsQ5ctQD tz4X2nwij1aUoLraBSRoQU1HX5KqPQ34/VnqQR/vJkzAKjtTNNeFnWu/RJOeWhaOT84nEM KkONVC57RKKupwx8SgER4JFeKeBLTibqW5g47+Rvr1VhM2fK4MsPrDVWw3Ell8XFezpp7J ++RP3lijvZ6/CYzlEqnJgHBxwZlrwAAH/Sm0D7CUc0utR4BgDyTdXyxpCPLPRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXhYF6cMpz2H5; Tue, 14 Jan 2025 21: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 50EL81PG029894; Tue, 14 Jan 2025 21: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 50EL810F029891; Tue, 14 Jan 2025 21:08:01 GMT (envelope-from git) Date: Tue, 14 Jan 2025 21:08:01 GMT Message-Id: <202501142108.50EL810F029891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 999c7a888f4f - stable/14 - makefs: Fix cd9660 filename buffer maximum length List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 999c7a888f4fbe74573bc342052f3146b8d756c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=999c7a888f4fbe74573bc342052f3146b8d756c9 commit 999c7a888f4fbe74573bc342052f3146b8d756c9 Author: Ed Maste AuthorDate: 2024-12-24 16:08:10 +0000 Commit: Ed Maste CommitDate: 2025-01-14 21:07:39 +0000 makefs: Fix cd9660 filename buffer maximum length The maximum length is 30 characters for name and extension, two separators (. and ;) and 5 characters for file version from 1 to 32767, which is 37 characters. Add one for the null term as we treat these buffers as C strings. This is not an issue in practice, as the file version is always 1 in makefs. While here, drop `_WITH_PADDING` from the macro name and update the previously-unused ISO_FILENAME_MAXLENGTH for the corrected length. A 0x00 padding byte is used by ISO9660 when needed for alignment, which can be the null byte at the end of the string. Use sizeof where appropriate. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48193 (cherry picked from commit 2e09cef8dc6f46faba8bab87c42c3f19ba2ffe87) --- usr.sbin/makefs/cd9660.c | 16 +++++++--------- usr.sbin/makefs/cd9660.h | 9 ++++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 0263970bba89..5fc3ae4d8b2a 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -502,7 +502,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, real_root->isoDirRecord = emalloc(sizeof(*real_root->isoDirRecord)); /* Leave filename blank for root */ memset(real_root->isoDirRecord->name, 0, - ISO_FILENAME_MAXLENGTH_WITH_PADDING); + sizeof(real_root->isoDirRecord->name)); real_root->level = 0; diskStructure->rootNode = real_root; @@ -805,10 +805,10 @@ static int cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) { u_char flag; - char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char temp[ISO_FILENAME_MAXLENGTH]; /* Now populate the isoDirRecord structure */ - memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memset(temp, 0, sizeof(temp)); (void)cd9660_convert_filename(diskStructure, newnode->node->name, temp, sizeof(temp), !(S_ISDIR(newnode->node->type))); @@ -1053,7 +1053,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, else maxlength = ISO_FILENAME_MAXLENGTH_BEFORE_VERSION; - tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); + tmp = emalloc(ISO_FILENAME_MAXLENGTH); while (i < num && iter) { powers = 1; @@ -1114,8 +1114,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, while (digits > 0) { digit = (int)(temp / powers); temp = temp - digit * powers; - snprintf(&tmp[numbts], - ISO_FILENAME_MAXLENGTH_WITH_PADDING - numbts, + snprintf(&tmp[numbts], ISO_FILENAME_MAXLENGTH - numbts, "%d", digit); digits--; numbts++; @@ -1162,8 +1161,7 @@ cd9660_copy_filenames(iso9660_disk *diskStructure, cd9660node *node) TAILQ_FOREACH(cn, &node->cn_children, cn_next_child) { cd9660_copy_filenames(diskStructure, cn); - memcpy(cn->o_name, cn->isoDirRecord->name, - ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memcpy(cn->o_name, cn->isoDirRecord->name, sizeof(cn->o_name)); } } @@ -1286,7 +1284,7 @@ cd9660_rrip_move_directory(iso9660_disk *diskStructure, cd9660node *dir) /* TODO: Inherit permissions / ownership (basically the entire inode) */ /* Set the new name */ - memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memset(dir->isoDirRecord->name, 0, sizeof(dir->isoDirRecord->name)); strncpy(dir->isoDirRecord->name, newname, 8); dir->isoDirRecord->length[0] = 34 + 8; dir->isoDirRecord->name_len[0] = 8; diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index b7324322d383..2892d6d206c2 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -72,8 +72,7 @@ /*30 for name and extension, as well as version number and padding bit*/ #define ISO_FILENAME_MAXLENGTH_BEFORE_VERSION 30 -#define ISO_FILENAME_MAXLENGTH 36 -#define ISO_FILENAME_MAXLENGTH_WITH_PADDING 37 +#define ISO_FILENAME_MAXLENGTH 38 #define ISO_FLAG_CLEAR 0x00 #define ISO_FLAG_HIDDEN 0x01 @@ -118,7 +117,7 @@ typedef struct _iso_directory_record_cd9660 { u_char interleave [ISODCL (28, 28)]; /* 711 */ u_char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ u_char name_len [ISODCL (33, 33)]; /* 711 */ - char name [ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char name [ISO_FILENAME_MAXLENGTH]; } iso_directory_record_cd9660; /* TODO: Lots of optimization of this structure */ @@ -154,7 +153,7 @@ typedef struct _cd9660node { int fileRecordSize;/*copy of a variable, int for quicker calculations*/ /* Old name, used for renaming - needs to be optimized but low priority */ - char o_name [ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char o_name [ISO_FILENAME_MAXLENGTH]; /***** SPACE RESERVED FOR EXTENSIONS *****/ /* For memory efficiency's sake - we should move this to a separate struct @@ -194,7 +193,7 @@ typedef struct _path_table_entry u_char extended_attribute_length[ISODCL (2, 2)]; u_char first_sector[ISODCL (3, 6)]; u_char parent_number[ISODCL (7, 8)]; - char name[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char name[ISO_FILENAME_MAXLENGTH]; } path_table_entry; typedef struct _volume_descriptor From nobody Tue Jan 14 21:08:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhYF23h1z5kR1G; Tue, 14 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhYD6S1vz4Nf2; Tue, 14 Jan 2025 21: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=1736888880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZYXca2KfZpVr7j3E2F5dKYO6LuDFSjqxMMdohkQVIbk=; b=kymIDJwgdfc2ijnUCjfHgkWjaB+weWQbxfQk0Gkvt8fF1pFZBN8CwqUf7TYZDaX6KG6QBA xNGgdQjbcCVbhcTyRIIH/1zI5hVFZtjexMI6hd8etSifWJZL+8xJxBqtpstuo6zgquH17R 92TR18/vlZVi4frh14TdlgYRxV5uztuX+hutclyUpTieRXE7d5DN28AWO3u3ohaB+CTWN4 JDdoUpjwg+U2C8v8Ms0PKLMmpccc8RubszF+3+07NQMdI49pOEEAsuRkNFFXlH9G0zRlD3 fPLrQRCEgTGlqCKOPhs2+QFGOpY6PtwyGryeHuv6skLbDgTzU6f1ok+5t7SO1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZYXca2KfZpVr7j3E2F5dKYO6LuDFSjqxMMdohkQVIbk=; b=r8r+kObVMh2rthxoxoN5arqXRToSOqR3VcAwKl3NoMhHMeqEhCcgvZ+RtnLQgQx6MEk3aO t5U0Zn4IlQw5NbCf8Mdr9JBQRSJ1ifFOyhaVmYlixOovqmG3XRAPubIvsi8kL48IsZNaTc 0NZ9CBRFejYssRC+jrgLuejyWi51dR/Q5oqj5/IxYraloiJHeozuMMDzOo4LFElriZJd7i 7jNnOrnujKsGTBtQrZ8VGfmR67TUSQLft83NYHn/u6kCyTJJ3F+spBWwM6Bbb2v9hJLyyW hzeVyyTBWD4oUfkR43HRmqvu0N8iSGlz70s7lmWYYTpTwXJt6EWezV2W0K4DrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736888880; a=rsa-sha256; cv=none; b=HYYewDxuI9PltQ4GDa8cg1kP6aqpcypIvv+/x+xpUuyHE/QQ8yht4/cFBYceDFlgIDMLHk HulNEkGE8eKTTRpwNvsTwQIcZuSbkFCYEv5UteqCy1gQ9sOh2qY3JX7n38ERjnKWyAfktx uDGjbpNlU9bxYBC+ub6iSH2dPAhoX7vliAjg4rjET4Y495zP6CwtMr/QWml3xPmTjhQcXi d7RgZfOnaM8cVlfEOUg67QrBU4a6mih1AblKXSFHrvgoAhs83GNPqdmyuW5VEiJ7xMclEJ 92sFUum2ABGe1ykKHclvYIBOcyTwt6x37ByAHlJ/ECxLrrxPhY7fgjbJfViEuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXhYD5xkNz2TK; Tue, 14 Jan 2025 21: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 50EL801h029843; Tue, 14 Jan 2025 21: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 50EL80kt029840; Tue, 14 Jan 2025 21:08:00 GMT (envelope-from git) Date: Tue, 14 Jan 2025 21:08:00 GMT Message-Id: <202501142108.50EL80kt029840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fb0239e69f17 - stable/14 - makefs: Crudely fix a sprintf warning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb0239e69f17400b08421a002a72b9520afd8285 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fb0239e69f17400b08421a002a72b9520afd8285 commit fb0239e69f17400b08421a002a72b9520afd8285 Author: Ed Maste AuthorDate: 2024-12-22 16:00:49 +0000 Commit: Ed Maste CommitDate: 2025-01-14 21:07:39 +0000 makefs: Crudely fix a sprintf warning Reviewed by: kevans Obtained from: OpenBSD d95291fdb2dc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48178 (cherry picked from commit 2069f6ecb1b1268deac980176c652ffab264970e) --- usr.sbin/makefs/cd9660.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index bb3a86b7c8b5..0263970bba89 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -142,10 +142,11 @@ static void cd9660_convert_structure(iso9660_disk *, fsnode *, cd9660node *, int static void cd9660_free_structure(cd9660node *); static int cd9660_generate_path_table(iso9660_disk *); static int cd9660_level1_convert_filename(iso9660_disk *, const char *, char *, - int); + size_t, int); static int cd9660_level2_convert_filename(iso9660_disk *, const char *, char *, + size_t, int); +static int cd9660_convert_filename(iso9660_disk *, const char *, char *, size_t, int); -static int cd9660_convert_filename(iso9660_disk *, const char *, char *, int); static void cd9660_populate_dot_records(iso9660_disk *, cd9660node *); static int64_t cd9660_compute_offsets(iso9660_disk *, cd9660node *, int64_t); #if 0 @@ -225,7 +226,8 @@ cd9660_set_defaults(iso9660_disk *diskStructure) memset(diskStructure->primaryDescriptor.abstract_file_id, 0x20,37); memset(diskStructure->primaryDescriptor.bibliographic_file_id, 0x20,37); - strcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD"); + strlcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD", + sizeof(diskStructure->primaryDescriptor.system_id)); /* Boot support: Initially disabled */ diskStructure->has_generic_bootimage = 0; @@ -809,7 +811,7 @@ cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); (void)cd9660_convert_filename(diskStructure, newnode->node->name, - temp, !(S_ISDIR(newnode->node->type))); + temp, sizeof(temp), !(S_ISDIR(newnode->node->type))); flag = ISO_FLAG_CLEAR; if (S_ISDIR(newnode->node->type)) @@ -1112,7 +1114,9 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, while (digits > 0) { digit = (int)(temp / powers); temp = temp - digit * powers; - sprintf(&tmp[numbts] , "%d", digit); + snprintf(&tmp[numbts], + ISO_FILENAME_MAXLENGTH_WITH_PADDING - numbts, + "%d", digit); digits--; numbts++; powers = powers / 10; @@ -1578,7 +1582,7 @@ cd9660_compute_full_filename(cd9660node *node, char *buf) */ static int cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { /* * ISO 9660 : 10.1 @@ -1589,6 +1593,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, int namelen = 0; int extlen = 0; int found_ext = 0; + char *orignewname = newname; while (*oldname != '\0' && extlen < 3) { /* Handle period first, as it is special */ @@ -1630,7 +1635,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, if (!found_ext && !diskStructure->omit_trailing_period) *newname++ = '.'; /* Add version */ - sprintf(newname, ";%i", 1); + snprintf(newname, newnamelen - (newname - orignewname), ";%i", 1); } return namelen + extlen + found_ext; } @@ -1638,7 +1643,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, /* XXX bounds checking! */ static int cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { /* * ISO 9660 : 7.5.1 @@ -1652,6 +1657,7 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, int namelen = 0; int extlen = 0; int found_ext = 0; + char *orignewname = newname; while (*oldname != '\0' && namelen + extlen < 30) { /* Handle period first, as it is special */ @@ -1697,7 +1703,7 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, if (!found_ext && !diskStructure->omit_trailing_period) *newname++ = '.'; /* Add version */ - sprintf(newname, ";%i", 1); + snprintf(newname, newnamelen - (newname - orignewname), ";%i", 1); } return namelen + extlen + found_ext; } @@ -1712,15 +1718,15 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, */ static int cd9660_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { assert(1 <= diskStructure->isoLevel && diskStructure->isoLevel <= 2); if (diskStructure->isoLevel == 1) return(cd9660_level1_convert_filename(diskStructure, - oldname, newname, is_file)); + oldname, newname, newnamelen, is_file)); else if (diskStructure->isoLevel == 2) return (cd9660_level2_convert_filename(diskStructure, - oldname, newname, is_file)); + oldname, newname, newnamelen, is_file)); abort(); } @@ -1932,7 +1938,7 @@ cd9660_create_virtual_entry(iso9660_disk *diskStructure, const char *name, temp->isoDirRecord = emalloc(sizeof(*temp->isoDirRecord)); cd9660_convert_filename(diskStructure, tfsnode->name, - temp->isoDirRecord->name, file); + temp->isoDirRecord->name, sizeof(temp->isoDirRecord->name), file); temp->node = tfsnode; temp->parent = parent; From nobody Tue Jan 14 21:08:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhYH3tFXz5kQh6; Tue, 14 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhYH0t16z4Nf4; Tue, 14 Jan 2025 21: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=1736888883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qr1kwfDHAcT2HltvJF66VUeYwY4Ix5+Cvl5rW+25coA=; b=vQ4J7WPvkWX4wtE2Rl8LH3UqJvtEYhtetenBM1btv+h/nhG64zwv06N61nKdG8AhoXsQBx lplY/xJHnH0JQp7WfaZK+z8RJfyy3/KdO/8FhiDgM2Dkm8C8MTRmxT+Z5gW9GyjEVKiGjA iCWlsDIerkZbPvdC9lazoH/XBJoTI6IrWETPEEegwraJHPXMHriAnF0eEoquh9JnfkyLDv pL0DHq0y0fwQK0ikHSEEMF5qPK1ZjJ0vdo4PiYcfA6UCP8CQ3lt/L1h1L3pivDqmGcrop0 QMXqEQ5VR7CMaQJ3dhvENavcCTzTBLys7rH6LDz8YpDfNkXkoVDsXKr5jWFPUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qr1kwfDHAcT2HltvJF66VUeYwY4Ix5+Cvl5rW+25coA=; b=KF56ZmWGxpjt8pBrHEL3RaHp+M6Nn92wE8fXc6AB4y/1VEOGRtfe9qVN4RR+KnV7/tt7TN ffUdIlU9XWP6J83qR96P3CoIvnZ/dxJI9TepzQW9TVFWEsGrHkYwK/oNFedtV37iM/Gjtt Mq9zoE9PGABd9mS8FZK3pG3nvd0YO6lA0rRnQUzVh36nHh6LDqVW0lKRnlv4YVC67Ifh9F fdTg8MHB1Uhk0sbGTUZxxB5rbqEFE3pMM/XTQbHr4jvxiT0DYM7MD5cCmHKEmLmcDM4Ttb FFN0wE2E1sTxLuZEEB67vU0g4aGEGPeLKDUzOuE/gc+Hb55kuBlXmI/FuHQFkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736888883; a=rsa-sha256; cv=none; b=Y2KI45pvSMddtRDcraS62J7y3biXFcSKYipsd4ZW9oI7KoU/ma+ytuaAYkJfttyq7GE4SE 92felb1nTo0GgVMUD+nn1VQhvjzmyL524CIT8twakNJr/dhWMeDxSxuIPdcNCDVTmqBnu7 G3DT0M3NrEGiqzhw9Pb+CsBS3T3Gb3PzNIxb8F5LEK/Fb5Mkz0yxzPo6Yy7ynOnf75ubwk 3Kv8Pppw2Oofd1ApQQWp0irmcVo3teXCqwqeF57B+niL3UW6jQwjrYj0DLYcxpQFlXmYZZ d/sa4Wu9aMnuZHG+S/8obf5pqhjnAubtoXZ+uy19WNPlky6hHikS1GGgdHZDhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXhYH0Tb2z2YD; Tue, 14 Jan 2025 21: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 50EL83Ts029946; Tue, 14 Jan 2025 21: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 50EL830S029943; Tue, 14 Jan 2025 21:08:03 GMT (envelope-from git) Date: Tue, 14 Jan 2025 21:08:03 GMT Message-Id: <202501142108.50EL830S029943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 302be497fc03 - stable/14 - makefs: Remove impossible if condition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 302be497fc0349979df05b700a7d27ffdac941f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=302be497fc0349979df05b700a7d27ffdac941f4 commit 302be497fc0349979df05b700a7d27ffdac941f4 Author: Ed Maste AuthorDate: 2024-12-24 01:58:37 +0000 Commit: Ed Maste CommitDate: 2025-01-14 21:07:39 +0000 makefs: Remove impossible if condition This test is inside the else block for `if (*oldname == '.')`, so *oldname cannot be '.' here. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48243 (cherry picked from commit 788e1eb7c199297aa438fc5cb6caabc9be01b419) --- usr.sbin/makefs/cd9660.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 5fc3ae4d8b2a..440b1d6d26b7 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1683,12 +1683,8 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, else if (isupper((unsigned char)*oldname) || isdigit((unsigned char)*oldname)) *newname++ = *oldname; - else if (diskStructure->allow_multidot && - *oldname == '.') { - *newname++ = '.'; - } else { + else *newname++ = '_'; - } if (found_ext) extlen++; From nobody Tue Jan 14 21:08:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhYJ3Yfyz5kQc1; Tue, 14 Jan 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhYJ2BG0z4NWj; Tue, 14 Jan 2025 21: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=1736888884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UiaOo+dFAUg+afv9JdcUhs6ATh89qiMnmUZcZoFQGuw=; b=VDAGQ9vt3TS2N9/u4C0gum9C7xrIO73WaDTRoLZzOhht4jOfqM05REci+lXhVRk90bDGxM /ovUVT0fpRLJPUNmzTB6CgA/GPXbybfLXEsD5dpc1boKp2kpNyj6VhOxOmq3AVAUJm0/Sm pK2RdLpqj1vcQQFoC/Rp3JidxuvLdU25Q3gYWzclgFj4talvr2rhFN8igQ4pGCqGAtAOfo n5JDPYDp2UQ0dUzK52vgad7nFH9QqKD6viSIvE4CJGkykRhALxltqVF+TgRUHHKhjRZhbh YB2UqB5ylmDKUjFVecsu2Z/MFRTrCz4g8UVeg7i2aSK1mXysS2CcVHMdDpBgpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736888884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UiaOo+dFAUg+afv9JdcUhs6ATh89qiMnmUZcZoFQGuw=; b=ZzS7SP9Y8j4OkqQYMYZkkbWO98gpe5igCty45yPwbhxH1jQhJKDsfCKJOjH7EJVSaVk8F2 wMLSnuqV6/uWO0Ovw25697zpklpnrii23/23WLoSFbBxR41BVZ7wd5bnmr2Mwzyfscs1Px hK0exPRQSTBm3xv7Y7GMopWsrTG6Wp036neblQuxXl/kVAKerVaBTCLh2dDOIdHcT7cdpS EO4CC+seM5LMCcLGPUBWTyedYiLRQ8FbObo0GOnOMhiIwxFIyXXpTsyxg/6ZWr37WrONLL XtrdPp8PYWwF3RgKhfMt/IzK96d/CtJVeGfg1JbVMmCVMji4GzJbD5gTmqcY4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736888884; a=rsa-sha256; cv=none; b=EzHyp9VoypqncR6tpqsMgX1AZYEhTiONAhgQBP/KvICiU5I6Zc/EPjbfk3fVNNvgYom8bN ZjlqqnYc/DwpLz2+nSNJYpQKc7xYyovz93VnkK2uSVdno1Xxd0+hxh2OT5FK5IQ2AFAJXx G3uMDmWQ/Aoih66SuiabkfICRJeYQcL+uIdJyT3k+xg5fKGDhgdCN7mdF8dr+X4L0PDYZK JXoZqRafgNNxO3iFH/s+uDNNF6Y6ybtrIpy+3CDd+YdegDOc3Lnnt6YpO8rd7TC07HQGuj +vUfbupq6PA56L3ur2EuJhY+KYKSDkAED/aGW6uH/kFYmK6YfruZFw3gptwUFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXhYJ1nWCz2TL; Tue, 14 Jan 2025 21: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 50EL8468030002; Tue, 14 Jan 2025 21: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 50EL841v029999; Tue, 14 Jan 2025 21:08:04 GMT (envelope-from git) Date: Tue, 14 Jan 2025 21:08:04 GMT Message-Id: <202501142108.50EL841v029999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 40b11c1c16d8 - stable/14 - makefs: Fix cd9660 duplicate directory names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 40b11c1c16d85b3339be4c3c4fde2ef7fa36f3ff Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=40b11c1c16d85b3339be4c3c4fde2ef7fa36f3ff commit 40b11c1c16d85b3339be4c3c4fde2ef7fa36f3ff Author: Ed Maste AuthorDate: 2024-12-30 15:01:06 +0000 Commit: Ed Maste CommitDate: 2025-01-14 21:07:39 +0000 makefs: Fix cd9660 duplicate directory names Previously we could create cd9660 images with duplicate short (level 2) names. cd9660_level2_convert_filename used a 30-character limit (for files and directories), not including the '.' separator. cd9660_rename_filename used a 31-character limit, including the '.'. Directory names 31 characters or longer (without '.') were shortened to 30 characters, and if a collision occurred cd9660_rename_filename uniquified them starting with the 31st character. Unfortunately the directory record's name_len was already set, so the unique part of the name was stripped off. Directories are up to 31 d-characters (i.e., A-Z 0-9 and _); there is no provision for a '.' in a directory name. Increase the name length limit to 31 for directories, and exclude '.'s. This name mapping and deduplication code is still fragile and convoluted and would beenfit from a more holistic effort. PR: 283238, 283112 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48251 (cherry picked from commit 1f31d437428014e864bcce1223cf7017180e2608) --- usr.sbin/makefs/cd9660.c | 5 ++-- usr.sbin/makefs/tests/makefs_cd9660_tests.sh | 39 ++++++++++++++++++++++++++-- usr.sbin/makefs/tests/makefs_tests_common.sh | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 440b1d6d26b7..17fab3a8cfdf 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1652,14 +1652,15 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, * File version number (5 characters, 1-32767) * 1 <= Sum of File name and File name extension <= 30 */ + int maxlen = is_file ? 30 : 31; int namelen = 0; int extlen = 0; int found_ext = 0; char *orignewname = newname; - while (*oldname != '\0' && namelen + extlen < 30) { + while (*oldname != '\0' && namelen + extlen < maxlen) { /* Handle period first, as it is special */ - if (*oldname == '.') { + if (*oldname == '.' && is_file) { if (found_ext) { if (diskStructure->allow_multidot) { *newname++ = '.'; diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh index 2fdf47f76a4c..066a9d6ec0e0 100644 --- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh +++ b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh @@ -51,8 +51,8 @@ common_cleanup() check_base_iso9660_image_contents() { # Symlinks are treated like files when rockridge support isn't - # specified - check_image_contents "$@" -X c + # specified, and directories cannot contain a '.'. + check_image_contents "$@" -X c -X .g -X _g atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c @@ -374,6 +374,39 @@ o_flag_rockridge_dev_nodes_cleanup() common_cleanup } +atf_test_case duplicate_names cleanup +duplicate_names_head() +{ + atf_set "descr" "Ensure shortened directory names are unique (PR283238)" +} +duplicate_names_body() +{ + check_cd9660_support + create_test_dirs + + # Create three directories which are identical in the first 31 characters. + dir_prefix="this_directory_name_is_31_chars" + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}1 + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}2 + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}3 + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + # Disable Rock Ridge extensions to read the plain ISO Level 2 names. + mount_image -r + + # The specific way the short names are made unique is not important. + # We verify only that there are three unique names and that the unique + # part is at the end of the name. + atf_check_equal $(ls -1 $TEST_MOUNT_DIR | sort | uniq | wc -l) 3 + atf_check_equal $(ls -1 $TEST_MOUNT_DIR | cut -c -29 | sort | uniq | wc -l) 1 +} +duplicate_names_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { atf_add_test_case D_flag @@ -392,4 +425,6 @@ atf_init_test_cases() atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge atf_add_test_case o_flag_rockridge_dev_nodes + + atf_add_test_case duplicate_names } diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh index 12c7c7c84fb7..b418cafc90a6 100644 --- a/usr.sbin/makefs/tests/makefs_tests_common.sh +++ b/usr.sbin/makefs/tests/makefs_tests_common.sh @@ -138,6 +138,6 @@ mount_image() atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ mdconfig -a -f $TEST_IMAGE atf_check -e empty -o empty -s exit:0 \ - $MOUNT /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR + $MOUNT ${1} /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR } From nobody Tue Jan 14 21:24:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXhwC0823z5kRQx; Tue, 14 Jan 2025 21:24:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXhwB6JpWz3CPt; Tue, 14 Jan 2025 21:24:26 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736889866; 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=JMyS2RPydxs8FUQzvVZqFJTg33ialBEy1KJn/JTyWNc=; b=nn16bKongy1+Axr2m0SqqSLae1Ygcm62zOjeGHS1b3EAKIM2rDgLgPP1FKZf2eCbjXD6HO 9mBQEewk4taYj9sNe0QB05uNDMQ7H27NmAOoiquCusqRznuT52tKL4M2kPh7mh6pWRY365 rD4EYWsV5Ilkzo+M2ZC+rA+sq0ReokWuZZK1hdUSf6jo0vcuDKqLV41tHS/dQkT/bw2Qji GKsd8qGWInx12PFo7HNgvsNDyvYgYu40Yh0L4VOLSbCAkPE94H2HqfYy2I6l5fmSaD1weY c9pCtlcZ4D0XY1oZ+l3w4Bp9Jf8P5BsqW6RJbf4sOCY3ZusievlMFsVzUZgMQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736889866; 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=JMyS2RPydxs8FUQzvVZqFJTg33ialBEy1KJn/JTyWNc=; b=PgmGZBpiH0VV0DFhtaZRGD109CFhERARWRe6RNezPOEf4fMW0ATeg5Hbis2zIeASx/aU1r 4qdYvR2pD/oiyynTiKqGvNUpKnvx1K+BMGJfepIXrO0mf/K0jnYrqQCZuo+yKXlWs6AG7r xNetv+6r32jznvV0ndEEyYYe4wOqISzsEWTkoIduPZogsyi1KvG7TA0DooA5u59LRPrZMc 8WQ+6OkWcPrw8aHNegv3nU8j0PNSmFIfxsgbp4gCoJqvszUnKu88DPQcgv+9va8475Aydh vgwKVHYDosy5wxNHu6NsRKwvxhFCyC2VPXwI1xiAbeXQ6wJ3sKQtxNVom9UMwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736889866; a=rsa-sha256; cv=none; b=N0flQT8bAXK9FV9l4Cs5uRU4Qc7d7tawYYhH/rYMrUf3O4t7dxBT9+EYmhwUkVID86IDLv /B3FFTtfrniABFk77mvx88J1bQDszMIxSzVx7HywzBbm7B5asi8W1M4HNyEim2b9W5dbPB oO/w5a2/lsWmdvi/BVh8HNT44orZ+UuG1S57hgHQzcnJq/3l3jEyQg57WB/87Lv3tnYDHY m3289AWp322nX/ji4CUYIvMcf8t9uOt2MO1Evhrxr7VaNdop846WQuOIb8p+Dvt0MjP5Ls Mu9XQoh4bOgJw073ilEsK+NVtKZnWBko6JbDWCbaENG5+x3jomdDyba67ASM4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_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: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YXhwB0plzzvJt; Tue, 14 Jan 2025 21:24:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 14 Jan 2025 13:24:23 -0800 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 441d489493e8 - main - pf: convert DIOCRCLRTABLES to netlink Message-ID: References: <202501141037.50EAbj9o047733@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501141037.50EAbj9o047733@gitrepo.freebsd.org> On Tue, Jan 14, 2025 at 10:37:45AM +0000, Kristof Provost wrote: K> The branch main has been updated by kp: K> K> URL: https://cgit.FreeBSD.org/src/commit/?id=441d489493e8a1e2658306f1a4c709a0b18cc78b K> K> commit 441d489493e8a1e2658306f1a4c709a0b18cc78b K> Author: Kristof Provost K> AuthorDate: 2024-12-03 15:53:08 +0000 K> Commit: Kristof Provost K> CommitDate: 2025-01-14 08:54:17 +0000 K> K> pf: convert DIOCRCLRTABLES to netlink K> K> Sponsored by: Rubicon Communications, LLC ("Netgate") K> --- K> lib/libpfctl/libpfctl.c | 44 ++++++++++++++++++++++++++++++++++++++ K> lib/libpfctl/libpfctl.h | 3 +++ K> sbin/pfctl/pfctl.c | 4 ++-- K> sbin/pfctl/pfctl.h | 5 +++-- K> sbin/pfctl/pfctl_radix.c | 16 -------------- K> sbin/pfctl/pfctl_table.c | 4 ++-- K> sys/netpfil/pf/pf_nl.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ K> sys/netpfil/pf/pf_nl.h | 10 +++++++++ K> 8 files changed, 119 insertions(+), 22 deletions(-) K> K> diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c K> index 2e4cdb91bad9..b374ef05e4d7 100644 K> --- a/lib/libpfctl/libpfctl.c K> +++ b/lib/libpfctl/libpfctl.c K> @@ -3072,3 +3072,47 @@ pfctl_get_srcnodes(struct pfctl_handle *h, pfctl_get_srcnode_fn fn, void *arg) K> K> return (e.error); K> } K> + K> +static struct snl_attr_parser ap_ndel[] = { K> + { .type = PF_T_NBR_DELETED, .off = 0, .cb = snl_attr_get_uint32 }, K> +}; K> +static struct snl_field_parser fp_ndel[] = {}; K> +SNL_DECLARE_PARSER(ndel_parser, struct genlmsghdr, fp_ndel, ap_ndel); Looks like userland can also appreciate an empty vector that belongs to the library. Just like in e9255dafa1ef0c635385aee78ead3a0050b19cca. -- Gleb Smirnoff From nobody Tue Jan 14 22:12:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXjzC0h6Lz5kVbj; Tue, 14 Jan 2025 22:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXjzC02Ctz3H3c; Tue, 14 Jan 2025 22:12:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736892727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDNesE/SXtE7wt1LjIPGK7XuEd25NBEgDkOWRSf3v/o=; b=bHnbAQr8YYrB1hxGIWXtu8G3G1O6H7kuE/aGJh0Vc+fm3yEcpzDpcekSUUu7NB/xW8oaSm 05GtNUGrNCVn0h/oct27ep1s6bm0OLVMhAF2IREDBHPgzsfUiNBYGb6XG+gTn+fYRV/ImH PY9PY5RMpYW0RqEc3QKXtLRUIKFi/XA5S+d3vnEdoMR2yGjw/D+a5M/t9CI6qO2TT0Eop/ Me3nSBDbWd7CYYeMjYS4DBbF5d5OW57B2S8CQ+DU/A3hedEoSzHRP/UMsUdamcZu4H8UCR gnNT6oJndI9Nw1MGhP7vAvuRv4D7hv7P4tWMb8+SOTwbp6ETpqoshZxkfsVydQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736892727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IDNesE/SXtE7wt1LjIPGK7XuEd25NBEgDkOWRSf3v/o=; b=WWZxpsQEP7Ni5//736w+UFrirlKxAFZ56MLzJVt992vOD69dnjCvhXX1jyGbcP8pKylcmA UE5RwQqPPeBu6SvUF9/YCoR1LA0wj2yHr3Od2sxp8qRO7WZgQLXIz7QZJ69cW8XSg7cAi3 apWjtlrkOE7xNZ5Aju+MAAVuePhNTI83D9584PvlKrO4LCPAExnDQ6mQje19ma29WL0jQ7 7EETzI/x3A/cgZxs+vwkcGi3evbNhRYkicNMdOMsFogCJ3dYTlrtqSXi5KPb7iChKtWJmM /i3N8Fiv45b3Yl+uD02OB7gjl5/U1blD8wb0iMLQQwRWKvYuokZ6LSNGLwWmFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736892727; a=rsa-sha256; cv=none; b=X5pk5PJp9qCSXh1wOK9dcIpP8PicFn8hKXfrm0DlsxqO6C0p/kgq71rw6QLhGGYwAi4OSi lMTLNYW5HrxMvVA1fJgCQSs+wgH8RXvi6/rsZhMn80T1JaNRsaYTCxa0izTo3AwzL9CExu d5+0jDgQSfi1aFRCsdvUuM1hcytH1584dlsrO7v85Gbso/BqsyWpIm74Yx2XByu9uKUkbT SIn/Sxgt6XZxsBIENToghIGgLIRx2ay/Rb9ECEhRRnLpwM5gRX9bdSBKWw3ceuI9vLXIjz e5im4Wqtg8p1bYF8XcvDjNmSjS3ahrkyu3Gl5ySXDOZsnZnRUaMIHAKYn7ynXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXjzB6W88z4Lq; Tue, 14 Jan 2025 22:12: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 50EMC6QN057760; Tue, 14 Jan 2025 22:12:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50EMC6n3057757; Tue, 14 Jan 2025 22:12:06 GMT (envelope-from git) Date: Tue, 14 Jan 2025 22:12:06 GMT Message-Id: <202501142212.50EMC6n3057757@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: 1cd455f39d88 - main - fs: Add new VFCF_xxx flags for va_filerev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cd455f39d886f27c33f7726f79fc4cc566da7b3 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=1cd455f39d886f27c33f7726f79fc4cc566da7b3 commit 1cd455f39d886f27c33f7726f79fc4cc566da7b3 Author: Rick Macklem AuthorDate: 2025-01-14 22:11:06 +0000 Commit: Rick Macklem CommitDate: 2025-01-14 22:11:06 +0000 fs: Add new VFCF_xxx flags for va_filerev Richard Kojedzinszky reported a problem via email, where the Linux NFSv4.2 client did not detect a change in a directory on a FreeBSD NFSv4.2 server. Adding support for the NFSv4.2 change_attr_type attribute seems to have fixed the problem. This requires that the server file system indicate if it increments va_filerev by one, since that file attribute is used for the NFSv4.2 change attribute. Fuse requires an indication that va_filerev is based on ctime. This patch adds VFCF_FILEREVINC and VFCF_FILEREVCT to indicate this. A future patch to the NFS server will use these flags. Reviewed by: asomers, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48436 --- sys/sys/mount.h | 2 ++ sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ac84c99ac74b..6715c55d7a6d 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -685,6 +685,8 @@ struct ovfsconf { #define VFCF_SBDRY 0x01000000 /* Stop at Boundary: defer stop requests to kernel->user (AST) transition */ #define VFCF_FILEMOUNT 0x02000000 /* allow mounting files */ +#define VFCF_FILEREVINC 0x04000000 /* va_filerev is incr. by one */ +#define VFCF_FILEREVCT 0x08000000 /* va_filerev is set to ctime */ typedef uint32_t fsctlop_t; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 2bfee6a6145d..9e94d368d7c9 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -117,7 +117,7 @@ static struct vfsops ufs_vfsops = { .vfs_susp_clean = process_deferred_inactive, }; -VFS_SET(ufs_vfsops, ufs, 0); +VFS_SET(ufs_vfsops, ufs, VFCF_FILEREVINC); MODULE_VERSION(ufs, 1); static b_strategy_t ffs_geom_strategy; From nobody Tue Jan 14 22:19:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXk7c2tlFz5kVv2; Tue, 14 Jan 2025 22:19:24 +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 4YXk7b4HfQz3HbF; Tue, 14 Jan 2025 22:19:23 +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 50EMJ8lJ019196; Wed, 15 Jan 2025 00:19:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 50EMJ8lJ019196 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 50EMJ8QW019195; Wed, 15 Jan 2025 00:19:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Jan 2025 00:19:08 +0200 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9a2ae72421cd - main - libthr: switch thread and sleepq memory allocator to crt from libc malloc Message-ID: References: <202501141755.50EHtFwt072647@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 4YXk7b4HfQz3HbF 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, Jan 14, 2025 at 03:42:52PM -0500, Mark Johnston wrote: > On Tue, Jan 14, 2025 at 05:55:15PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a2ae72421cd75c741984f63b8c9ee89346a188d > > > > commit 9a2ae72421cd75c741984f63b8c9ee89346a188d > > Author: Konstantin Belousov > > AuthorDate: 2025-01-14 09:06:58 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-01-14 17:55:08 +0000 > > > > libthr: switch thread and sleepq memory allocator to crt from libc malloc > > > > There are more complex interactions between malloc and libthr > > initialization that can happen if libthr functions are called from ELF > > object' constructors, before libthr is initialized. Break the > > dependencies loop by using the private allocator with controlled init. > > > > Reported by: yuri > > Reviewed by: markj, olce > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D48454 > > I see some startup deadlock when running the googletest regression tests > (/usr/tests/lib/googletest/gmock_main) after this commit. gdb (which > itself also hangs due to this bug) shows: > > (gdb) bt > #0 _umtx_op_err () at /home/markj/sb/main/src/lib/libsys/amd64/_umtx_op_err.S:38 > #1 0x000015e1ba96fd2c in __thr_umutex_lock (mtx=0x15e1ba974468, id=100113) at /usr/src/lib/libthr/thread/thr_umtx.c:69 > #2 0x000015e1ba966a41 in __thr_calloc (num=1, size=17) at /usr/src/lib/libthr/thread/thr_malloc.c:92 > #3 0x000015e1ba969213 in mutex_init (mutex=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) > warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) The following fixed the issue for me. I am somewhat surprised that the problem did not manifested itself before. commit 783d95d0d6e6e508705cf16cfd9e4a5e2f8db8e4 Author: Konstantin Belousov Date: Wed Jan 15 00:11:48 2025 +0200 libpthread_init(): ensure curthread == NULL until set explicitly Otherwise libthr::_get_curthread() returns a garbage kept there from allocate_initial_tls(), until libthr initialization proceeds enough to set initial pcb->pcb_thread. The garbage pcb_thread was dereferenced as struct pthread and some memory read as TID. Since it was not consistent between reads, thr_malloc_umtx unlock returned EPERM instead of clearing the lock word. Reported by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 708c425d69c1..e5e438897dee 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -334,6 +334,7 @@ _libpthread_init(struct pthread *curthread) /* Set the initial thread. */ if (curthread == NULL) { first = 1; + _tcb_get()->tcb_thread = NULL; /* Create and initialize the initial thread. */ curthread = _thr_alloc(NULL); if (curthread == NULL) From nobody Tue Jan 14 22:28:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXkL85LKzz5kWVQ; Tue, 14 Jan 2025 22:28:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) (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 4YXkL82P4Bz3L5W; Tue, 14 Jan 2025 22:28:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6d8fd060e27so48823886d6.1; Tue, 14 Jan 2025 14:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736893711; x=1737498511; 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=f4LxTL2KfiCyptCccNppROFKAhwK4vqnHgK9mBIC5vs=; b=ALpnpRf3LQGZPuQfK5HX6qJig16dKFU+AIQ3DAq05KQqHu4wU5sPlsFPRmObQuF9IO Z+zxnnqtWOaRwHNJ5C2wpDdijx3tC09MwSdakkvsNXvXP0d50G3I7T4bN/esvE/htfRg nJB1aVybAzSE4k57FvwNYC3RmcYfkt4CfYOWwXhrweSBakNmmSDpXiZV8m6Ed224srMd 9Mpp+DLBL8Su+ZshDfju6Iih1fvM7wR/Ol/T6JRI4vkL3ZAiIcq+VBvsnKhHw7Ybsgt0 pJrqjiXGRsBnyy22SSMb8Qd8Ofp7/Uf473uXOLbgLu2z04apF5p3U5ZU428EXo6PJW6B vuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736893711; x=1737498511; 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=f4LxTL2KfiCyptCccNppROFKAhwK4vqnHgK9mBIC5vs=; b=sbMjEGBtZ5v7PdmiG3oxbQTxvioeCGdeGFdqn7b1kniTeLzWkRAiEbBfFUeOdvOhLu FsV7i1TgRcZJqEjjW0LO5g4pZIS+F+2M6JnZYtG9LLWIsgRsE3CEGZrFvwcWHmxOZm7P JQ14SGpD7Zs3g8/PYobiz80TKSlotVweOfLWf3IJKBIwtFbckBA/bVfVykhZRrIXagVs cdnm+QXsCLmla7i252x2THUfv801BzZe3+Kks683Z3Re/ElB/CtkCIij+IJaa+XWdDhC L5sb6Q9kFqYw6id700s+c292pKd1qlx7LhuNQ4dLM4qVMZbSo4gBfYJyS39NM1Vyvsqk YOKw== X-Forwarded-Encrypted: i=1; AJvYcCUCLzCtflwc3aMahXXCSGyfEcoRmW3mfqaV7I35TG/kHTHIpryl5Y/aLqKxKiuB9GpR0RYvaisHc4Hq9VWI5Wpi1jpN@freebsd.org, AJvYcCVcREw9UAreDYO/qJj4r+Nl0BBUUpX0ab3NKANvbQH61eTspj1mWmeBCxIPsYaHrwKavPlTE41YXQrPyGN+8auEm260w9A=@freebsd.org X-Gm-Message-State: AOJu0YyHm88IB03AoIYNtEM2dTC4KNBsTs1BPnWmsnxNKyargs7jdo3+ IJwYk/C2a3ycccHS8yNvwtwX7pbGeJ5mEfxZI8LwwTDHjh0lUagi X-Gm-Gg: ASbGncs7eHFr6pCudRGCTkNz7qG58D8+OSqB/Sb622zpq69JS53l0GDMbc79mIxstJC 1vhWuR9jaValOCwpdHV56dpePFgwDqKJRIAM4VHBg7V5FrPWnoSSiKZ9n/l5jx97UlNB6jiLaRn YJeAJKH/0jvNgzNd4mkNabSvg7IGMYgjhitu9WLtkjolGTulPEEWyHuPdyiUXcPNM8V4JB2aTs+ elCCktaf3KBq4aOHIxBWDF6q/kmcDsf9vITqOjeYevmQTAGH/6jXcLg0R8aKpS19fH8VfM= X-Google-Smtp-Source: AGHT+IEE4Wr7NSNoUczKtHxBvy255GMe1y7YIEE2ulwPPz8RWwzFVQGP5Qu5eEeKn81qJq0eyeUnDw== X-Received: by 2002:a05:6214:501a:b0:6df:9740:68a3 with SMTP id 6a1803df08f44-6df9b2b3231mr487072996d6.38.1736893711055; Tue, 14 Jan 2025 14:28:31 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce3516004sm651336585a.101.2025.01.14.14.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 14:28:29 -0800 (PST) Date: Tue, 14 Jan 2025 17:28:27 -0500 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: 9a2ae72421cd - main - libthr: switch thread and sleepq memory allocator to crt from libc malloc Message-ID: References: <202501141755.50EHtFwt072647@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4YXkL82P4Bz3L5W 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, Jan 15, 2025 at 12:19:08AM +0200, Konstantin Belousov wrote: > On Tue, Jan 14, 2025 at 03:42:52PM -0500, Mark Johnston wrote: > > On Tue, Jan 14, 2025 at 05:55:15PM +0000, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=9a2ae72421cd75c741984f63b8c9ee89346a188d > > > > > > commit 9a2ae72421cd75c741984f63b8c9ee89346a188d > > > Author: Konstantin Belousov > > > AuthorDate: 2025-01-14 09:06:58 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2025-01-14 17:55:08 +0000 > > > > > > libthr: switch thread and sleepq memory allocator to crt from libc malloc > > > > > > There are more complex interactions between malloc and libthr > > > initialization that can happen if libthr functions are called from ELF > > > object' constructors, before libthr is initialized. Break the > > > dependencies loop by using the private allocator with controlled init. > > > > > > Reported by: yuri > > > Reviewed by: markj, olce > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D48454 > > > > I see some startup deadlock when running the googletest regression tests > > (/usr/tests/lib/googletest/gmock_main) after this commit. gdb (which > > itself also hangs due to this bug) shows: > > > > (gdb) bt > > #0 _umtx_op_err () at /home/markj/sb/main/src/lib/libsys/amd64/_umtx_op_err.S:38 > > #1 0x000015e1ba96fd2c in __thr_umutex_lock (mtx=0x15e1ba974468, id=100113) at /usr/src/lib/libthr/thread/thr_umtx.c:69 > > #2 0x000015e1ba966a41 in __thr_calloc (num=1, size=17) at /usr/src/lib/libthr/thread/thr_malloc.c:92 > > #3 0x000015e1ba969213 in mutex_init (mutex=warning: (Internal error: pc 0x15e1bd5c0240 in read in CU, but not in symtab.) > > warning: (Error: pc 0x15e1bd5c0240 in address map, but not in symtab.) > > The following fixed the issue for me. I am somewhat surprised that the > problem did not manifested itself before. It seems to fix the hang for me as well, thanks. > commit 783d95d0d6e6e508705cf16cfd9e4a5e2f8db8e4 > Author: Konstantin Belousov > Date: Wed Jan 15 00:11:48 2025 +0200 > > libpthread_init(): ensure curthread == NULL until set explicitly > > Otherwise libthr::_get_curthread() returns a garbage kept there from > allocate_initial_tls(), until libthr initialization proceeds enough to > set initial pcb->pcb_thread. The garbage pcb_thread was dereferenced > as struct pthread and some memory read as TID. Since it was not > consistent between reads, thr_malloc_umtx unlock returned EPERM instead > of clearing the lock word. > > Reported by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c > index 708c425d69c1..e5e438897dee 100644 > --- a/lib/libthr/thread/thr_init.c > +++ b/lib/libthr/thread/thr_init.c > @@ -334,6 +334,7 @@ _libpthread_init(struct pthread *curthread) > /* Set the initial thread. */ > if (curthread == NULL) { > first = 1; > + _tcb_get()->tcb_thread = NULL; > /* Create and initialize the initial thread. */ > curthread = _thr_alloc(NULL); > if (curthread == NULL) From nobody Tue Jan 14 23:14:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXlLj5lL3z5kZDf; Tue, 14 Jan 2025 23:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXlLj4RgMz3QS8; Tue, 14 Jan 2025 23:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736896445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sr4BobZtwHQCSM90Jtyzhmub6i+jBNsHdcQKMtWkcqQ=; b=wGm9spjuyEbTnYf0/ULG0Q7EXDzmF77VMHCtJmO4JqyVhxWMTT3DNdxn0Qr9WEi73DkAu9 0d8Npfc427erPYZ6tsoxlwsFgYqvXGc/U8KGEQyALp0/7YVUzB6XBOXsMNkZ9acBrmVh92 DjzAnTJcjrtdDesNHaR78fdXuYx1DZGDMmwYFs8YMUE89YOP+MaGNkDvlRwBkVGftJ5PQY 6BEoC4CXcny2NbWlBQ2jE+QQaYner6eXSXLBSt8eT8vvr0nw1PTMHaOjwSIZm8cFmhvxKN klebXQEGPYOx6eaR+rXuaipGLGiWS9TEB/OfdC1MVwe+w9zrWX2ZCBZUfyVITA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736896445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sr4BobZtwHQCSM90Jtyzhmub6i+jBNsHdcQKMtWkcqQ=; b=UFM/anovoAEZjs48pHhkTcivYsgaJyAIQvOIzR2m5uemgCwKIMcjBnYHbTvYB7YcskTpRj 58bwxn99aEsMRoxW8MwI3fk6W6pES8RbgPfGOaa+b1OJ0pFhxn6bHsAIn9tr85omprjjXb m4y63JVgY6Y39rx/YP9vgcC48vrzZ1e6hn9kUOo1XBmYB9aWp8LzLKZUyi93LmQ+db8hpR brPBV9bAYv++oVOgngZGMDJlD1k/NXblY9pcmLx4m71TvXGeR6gF+QMwO88c7uHF4qJC8D wYSD8MzPQ95lLjBKnEO6yuGe8TaUOj7rcjjR9jQ5hbvOIwxI1iDxd6msd78MlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736896445; a=rsa-sha256; cv=none; b=FKNWb9t0wVvyMPJU9cl8+OJgh+UwVuFHzclkiKRcKGAx/UHq5lP6DZ69tCfsQD016W0EF/ ZcuoPlOChbuZzcvSXCvta5ygj6FP+Ad7bozdxb6WCgb7oKX4atFyPy2lg99dKkaH2HsiiB 5K3gFcooy9Sdy5v2zAaSW+v+0W7K+HNlh7QXe27Nx7p96xmCOK9pqxzf7z8PpSZ9W2GPAd 73ehi8nT5HbbcYPxHuXOwnP5/f/M4Rbk8jsu1XYEKGXz4+ue8F1eZpK+OgxYO1wXrTGNA+ NyfOThhnjNQ8cXKrqCrh4uHNWNT7p1+F8rTEeFQfAkJlaUgbgMQnQ6ruo2Y7tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXlLj3wvNz5nd; Tue, 14 Jan 2025 23:14: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 50ENE5TX072653; Tue, 14 Jan 2025 23:14:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ENE57F072650; Tue, 14 Jan 2025 23:14:05 GMT (envelope-from git) Date: Tue, 14 Jan 2025 23:14:05 GMT Message-Id: <202501142314.50ENE57F072650@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: 676be27133fa - main - libpthread_init(): ensure curthread == NULL until set explicitly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 676be27133fa3296f3d9083732d8837a3eaa5ea4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=676be27133fa3296f3d9083732d8837a3eaa5ea4 commit 676be27133fa3296f3d9083732d8837a3eaa5ea4 Author: Konstantin Belousov AuthorDate: 2025-01-14 22:11:48 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 23:14:00 +0000 libpthread_init(): ensure curthread == NULL until set explicitly Otherwise libthr::_get_curthread() returns a garbage kept there from allocate_initial_tls(), until libthr initialization proceeds enough to set initial pcb->pcb_thread. The garbage pcb_thread was dereferenced as struct pthread and some memory read as TID. Since the read might not be consistent between reads, thr_malloc_umtx unlock sometimes returned EPERM instead of clearing the lock word. Reported by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 708c425d69c1..8855491b91cb 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -334,6 +334,8 @@ _libpthread_init(struct pthread *curthread) /* Set the initial thread. */ if (curthread == NULL) { first = 1; + /* Force _get_curthread() return NULL until set. */ + _tcb_get()->tcb_thread = NULL; /* Create and initialize the initial thread. */ curthread = _thr_alloc(NULL); if (curthread == NULL) From nobody Tue Jan 14 23:36:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXlrC11Rpz5kbK8; Tue, 14 Jan 2025 23:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXlrC06z7z3S4r; Tue, 14 Jan 2025 23:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736897771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PHLfCKsCU+39rEEy0Y8vVZyUC+d04oaekZ9k5emcHM=; b=vFhTzdEtMSgmHVsd6rEPpyqPs9ljBPnwznaO+E1gwp5p3+wj+4+eMHvOy7nzR0MHGC5G6r GhdNTCu8iCIeOc0BULgOLHCensN+psths4YSjAHK66Iu2vKzLe9a1ztnxBE/e2RgIGu3Fb Uvqjuh1UKVoz8iBXXxRDFCUgrEByP6pmBNeU76kiR19Rl7Y4jqL2dSwvgzzJH5eaKjVCXh wlskxYkW3obx//e/kMHdiwwl63O44480G/OoVvt8bmvFtO7Z9G+8gtU0TuXqOduXFnmcLH jZ51JJG7aSZomGhwR88TTnfA2LaC+BlGaMVY3JMUiF4QI3NlQPxlulFfP/9Plw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736897771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PHLfCKsCU+39rEEy0Y8vVZyUC+d04oaekZ9k5emcHM=; b=XObbz+4xuZTTsxqlueXOpj+6kV3W4Qikzxt3AgBMiGZLGY1CjBpIlLFhx86S6liqBMKVUr GUzaG822aAZqmYb1gXffa8rolebtjEgDosXSC0V3I7VbkJEe06bfP5mTiJ4fxniS7Lc59l qFMcHkoFqbqmqSuoYy6MHL4i0mE1SRd7rw8HcxpT/pNkv4SZ9r6YPYP3ukAuFCQbhX0Ll+ L1UxUNb9SKmOkrsUBs7GjI1PrfuPHVHkD5P+gd2RQxbxy3VEgg7FoDyIJSFILPeHTTm4cm V1M7AX4m29FrXPaEqBoyL8nNlkHsXyk63BdF5/EhQ4Vj5TbvUSgLeS6xrAi2Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736897771; a=rsa-sha256; cv=none; b=wVlSwZ6rXjKRdc3Tj8P8HPFr/iQ+iO75S/SbG9QavMKAbfsZKmG7USzT4IowuMUhn6uROF GwC90mt0IDUhVUMQfvwMx9usebRvQlIVAroQvYRPNbl2HpTS0pi1F6Tb5dVZOreIZwrofY 60GlzQ7V8yNvatgBJPc/4AWYOLqMVgw0fv1On3TnP21fElTjX44gwO3i94FDdoIc/XlVS0 CfRzHq7dSv9dOAzX+v9rPlLEqsv0D0xxtJCYcWmBn+DIeXXUHivzWEjJqD9C5obXFRh+LU g5ynRyVNamLGzJ9tNJusOlRz51XN7Esbml9A0Z8+k6wllceXQq0LmHnWBJ58VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXlrB6fHqz6Lm; Tue, 14 Jan 2025 23:36: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 50ENaA2x011141; Tue, 14 Jan 2025 23:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50ENaAp2011138; Tue, 14 Jan 2025 23:36:10 GMT (envelope-from git) Date: Tue, 14 Jan 2025 23:36:10 GMT Message-Id: <202501142336.50ENaAp2011138@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: 02703de8bcae - main - pthread_create(): style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02703de8bcae3b45e6d96e8467d5fa512d62cc3d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=02703de8bcae3b45e6d96e8467d5fa512d62cc3d commit 02703de8bcae3b45e6d96e8467d5fa512d62cc3d Author: Konstantin Belousov AuthorDate: 2025-01-14 23:32:06 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-14 23:35:38 +0000 pthread_create(): style Use NULL instead of 0 for null pointer. Use != 0 for non-bool, as in the rest of the function. Remove unneeded (). Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_create.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 4de9bd84ca5b..2ae7cf0cd7b2 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -146,7 +146,7 @@ _pthread_create(pthread_t * __restrict thread, _thr_stack_fix_protection(new_thread); /* Return thread pointer eariler so that new thread can use it. */ - (*thread) = new_thread; + *thread = new_thread; if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { THR_THREAD_LOCK(curthread, new_thread); locked = 1; @@ -226,8 +226,8 @@ _pthread_create(pthread_t * __restrict thread, THR_THREAD_UNLOCK(curthread, new_thread); } out: - if (ret) - (*thread) = 0; + if (ret != 0) + *thread = NULL; return (ret); } From nobody Wed Jan 15 02:26:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqcm5gQPz5klp7; Wed, 15 Jan 2025 02:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqcm4jf6z3dlZ; Wed, 15 Jan 2025 02:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736907992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1YWYzpAF1QoJeRWRWfI85GQ/8uBg/fHxVZkK3JNxI5M=; b=eUgqLvNpO2va64oxXVBGEs+hYZvM+yO+D+WRP7NoAjQLSePca9e9WmieHD25rkBromYby0 erabZQPpJv/3kE9315tFxXJTPJtkVU5wqH351Q4afKRBNN//F4HZjiowq8cIvvS7gY3TXm gNmODJC1+FtBLJ4IXO2fOawLL6SADv5GjaGHtkrja6e7VBXFQzvGrhOV/A6KE3JEslz6+W 1Tz2QWVlkBqkGlekSk4kqpCZa9CGyOwYHrOW2O6+SGQgSx6vtbR4HbZa/NzdSAaZl8yCyb OgZARy2rKfnTzThNW+LuAjaukF7VC6t6pPEKrvPAfNg5K0JsvXS8rqgoUAK5rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736907992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1YWYzpAF1QoJeRWRWfI85GQ/8uBg/fHxVZkK3JNxI5M=; b=kud0czpS0h+Hn9dccEtuQdASG6RjHb9l1apQIgHRmhSGfZgzP2VWb8Ux9iaznPleAQYLyI ofIxK4vOo84jmlbJgkhdaow4v3H/Ds367QI/gAq7EiYjDw+BgSM610KexORzzj3t8+KkWa lDkUR9Wial0XxrD7pl0bWhOcyJ6Qo3qkpA2uVPik6t9tQ6rFRW/f0ZXEXvXJYbdTQwjqwG pbNNLOCkvoPKXvv06BniFo27vUb8HLQCtkpTZx4B59+iKzL+RkocBuKIFKanqolf67fmCu a12lsUJt1E9YsM3FFHggL5Yq+x+OjrL8/y9VQbW7BFJ7w/kSM0Y1RKvD6VNTqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736907992; a=rsa-sha256; cv=none; b=P2sQD6tG2eqjyw0nq0R2qi0SQ9Ju997o1UyuHS+4HA+79EDVRF0tDNfKN0QhGaTh3fTcBT gBquigQIRKSDLtnT+Z1WXmgGjLsBZ86b+LS4N96lQ067DmscLhpYtxtQ8ZKCckY0i3IWEM ETVvw7wtdUH634lJt7/YFtALHyEKT6mGecbMY79iaEUT2UZ+vwYVhZRsV1qMh0X71d2rCl iAqJX1Huo7FT4zaUc2aI5pqtqzVnaAu5ASFMf6e2u2eGOCjr9/kfRw2E2W4cOOfUtQi7ol kARc41JX2uqxLQzGoELCqVb/WGMnBqpDtet3xo+fYyZZXsc7j90He5PYoZGWpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqcm42lczBxj; Wed, 15 Jan 2025 02:26: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 50F2QWYf028336; Wed, 15 Jan 2025 02:26:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2QWvU028333; Wed, 15 Jan 2025 02:26:32 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:26:32 GMT Message-Id: <202501150226.50F2QWvU028333@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: dea3eef94caf - main - uart: Ingore pl011 historic mistakes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dea3eef94cafb3bb1e5f04bc96b5636ffca92ee7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dea3eef94cafb3bb1e5f04bc96b5636ffca92ee7 commit dea3eef94cafb3bb1e5f04bc96b5636ffca92ee7 Author: Warner Losh AuthorDate: 2025-01-15 02:17:46 +0000 Commit: Warner Losh CommitDate: 2025-01-15 02:24:35 +0000 uart: Ingore pl011 historic mistakes Some veresions of EDK-II and QEMU reported the wrong values for the register shift and the region I/O size. Detect those and set it to the correct values. In general, anything other than a shift of 2 and a regio width of 4 (bytes, or 32 bits) is a mistake. However, allow for overrides in the future by only overriding the buggy values. Otherwise, we will fail to boot. PR: 282936 Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47946 --- sys/dev/uart/uart_dev_pl011.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c index 4f946f7c5f36..e7a2ff7a85f1 100644 --- a/sys/dev/uart/uart_dev_pl011.c +++ b/sys/dev/uart/uart_dev_pl011.c @@ -172,6 +172,27 @@ static int uart_pl011_probe(struct uart_bas *bas) { + /* + * Versions of QEMU before 41f7b58b634e (8.3) reported bogus values for + * this tabel. The PL011 IP is always 32-bits wide and should be shifted + * 2 to match the 4-byte size of the data. QEMU reported these values + * incorrectly before that. + * https://github.com/qemu/qemu/commit/41f7b58b634ec3b60ae874375d2bbb61d790971e + * + * In additon, other hardware vendors also reported this value + * incorrectly. It's not tied to what the ACPI device node is, but was a + * misunderstanding coupled with a Linux driver that didn't need the + * right values. Quirks used to be used to ignore the bad values, now we + * detect the historic mistake and override (to allow for a future where + * we may need to override these values). + * + * PL011 Docs: https://developer.arm.com/documentation/ddi0183/latest/ + */ + if (bas->regshft == 0 || bas->regiowidth == 1) { + bas->regshft = 2; + bas->regiowidth = 4; + } + return (0); } @@ -356,7 +377,8 @@ static struct uart_class uart_pl011_class = { .uc_ops = &uart_pl011_ops, .uc_range = 0x48, .uc_rclk = 0, - .uc_rshift = 2 + .uc_rshift = 2, + .uc_riowidth = 4, }; UART_CLASS(uart_pl011_class); From nobody Wed Jan 15 02:26:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqcn68Y7z5klg2; Wed, 15 Jan 2025 02:26:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqcn53Btz3dHr; Wed, 15 Jan 2025 02:26:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736907993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCTsKMw1vKIdRNWTdM+Umr/LhvlamMog3cu5YGmrpu8=; b=G39tO1LpYosKZHNfJ3t+WdKbapNc/LC4DyYJe0xCZAM+JYWBzvmgrwwMUbBeG37IZHJ9Rp 4rnJZjcapgW/ukGKjBIyZVDM7lNeQCKEVbmaztZu9E97sXLuQ7Ign4tqphSzTF5QCUUQ+/ v6h30BaCIdpkuiLUWAb8Kc76NV56lzwBQAZp4FfVeGhHSZlkzh1kmr6Gx1aFoI3/X1x+je SI7JxRBvhZEemCh/UIKgn8bLsEDZVs+zwNfUWC2VaP8PeFttGY2Mq5g/AMf6IUbK1tVqr+ vGWiwYjcLYnT/HcO9X5w4Pb7FXXYLWoCNVEoTxhxKVbnVzDNIyt1oqcr5gijWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736907993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rCTsKMw1vKIdRNWTdM+Umr/LhvlamMog3cu5YGmrpu8=; b=p96uH7Y4+moHcQSGZuOlE7aFaMB1Y/Gp+v56AFpmKffoDFuk2gwsvssuVUeE+Z4VbUl+ng h5r6HZRVBU4ok40OqyinkZ6we9mR1DU+N4UXD4rZ9SZSU52e/zwqCHT3j5spoozsB/XJzi +ixAxz3U3h+POVfyms+cLs8cxdtTqSCEyj40spnbycY4WMpZ2ZX+GNDwdhbWmPqvPE6Rly NYdq/9IZT/XJw6Vs25JDREmVYsD3kDjS+wSpvRgZHOSChqLdYdBw+9SiPt9ritw1Eo0iOa ALzhF0RQDjgvvj29EcVB3oYo0iH6IlFV1oMno/fUBdyOH4IMCq2CXD6zcFlJAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736907993; a=rsa-sha256; cv=none; b=oSseQLWUk25vR211ue4tLEB1LWaWUR6IIqXBMC9rpJSu6ELbsZ4D9vXX33H0+Sv8JNCxeJ lprh/TtwFaSAkb2C9WawdJV9rZSYiA7TI423FoGS2+qPeQ8I9Yby4O2tLdtDKZcgyugtf/ Jj03gHwDZh7ZqO+ZAUrgXLUGgAzCKQyYB6kqYiK1O5c0t3+5AylNAd++uFV6DfJKQl3vFZ kWrFDhGDNkmh7mMX4xG15jA0MNzaBAN3Mtze/QcpWgeP1TVNtP34W+/CLRHdwuqEICJ5D0 cJ/61Jv6i69XUawvY/aDaFNUScaC/QD+aX4H4dUpRd73IdWi3zMYX7QDurvy/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqcn4ZVqzBvM; Wed, 15 Jan 2025 02:26: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 50F2QXZ2028382; Wed, 15 Jan 2025 02:26:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2QX9R028379; Wed, 15 Jan 2025 02:26:33 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:26:33 GMT Message-Id: <202501150226.50F2QX9R028379@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: 5db3699be68f - main - Kill ignore regshft flag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5db3699be68f3a49d96d58c78af6f12e2dc1b38b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5db3699be68f3a49d96d58c78af6f12e2dc1b38b commit 5db3699be68f3a49d96d58c78af6f12e2dc1b38b Author: Warner Losh AuthorDate: 2025-01-15 02:21:26 +0000 Commit: Warner Losh CommitDate: 2025-01-15 02:24:36 +0000 Kill ignore regshft flag This flag was introduced to ignore bad firmware values. These were present in older versions of EDK-II that many devices (both Ampere and Amazon) used. QEMU also used this value, but fixed it. But since it's tied to the firmware bug not the device name ID it doesn't make sense to have it flagged there. Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47947 --- sys/dev/uart/uart_bus.h | 1 - sys/dev/uart/uart_cpu_acpi.c | 12 ------------ sys/dev/uart/uart_dev_pl011.c | 6 +++--- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h index ccf8ad06a8ec..a605e3d20be7 100644 --- a/sys/dev/uart/uart_bus.h +++ b/sys/dev/uart/uart_bus.h @@ -56,7 +56,6 @@ /* UART quirk flags */ #define UART_F_BUSY_DETECT 0x1 -#define UART_F_IGNORE_SPCR_REGSHFT 0x2 /* * UART class & instance (=softc) diff --git a/sys/dev/uart/uart_cpu_acpi.c b/sys/dev/uart/uart_cpu_acpi.c index ce00a09fee33..7382c47a8db6 100644 --- a/sys/dev/uart/uart_cpu_acpi.c +++ b/sys/dev/uart/uart_cpu_acpi.c @@ -221,12 +221,6 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *di) di->pci_info.device = spcr->PciDeviceId; } - /* Apply device tweaks. */ - if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == - UART_F_IGNORE_SPCR_REGSHFT) { - di->bas.regshft = cd->cd_regshft; - } - /* Create a bus space handle. */ error = bus_space_map(di->bas.bst, spcr->SerialPort.Address, uart_getrange(class), 0, &di->bas.bsh); @@ -296,12 +290,6 @@ next: /* XXX: Find the correct value */ di->baudrate = 115200; - /* Apply device tweaks. */ - if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == - UART_F_IGNORE_SPCR_REGSHFT) { - di->bas.regshft = cd->cd_regshft; - } - /* Create a bus space handle. */ error = bus_space_map(di->bas.bst, base_address->Address, uart_getrange(class), 0, &di->bas.bsh); diff --git a/sys/dev/uart/uart_dev_pl011.c b/sys/dev/uart/uart_dev_pl011.c index e7a2ff7a85f1..a0d5a5b1c7e2 100644 --- a/sys/dev/uart/uart_dev_pl011.c +++ b/sys/dev/uart/uart_dev_pl011.c @@ -392,9 +392,9 @@ UART_FDT_CLASS_AND_DEVICE(fdt_compat_data); #ifdef DEV_ACPI static struct acpi_uart_compat_data acpi_compat_data[] = { - {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, - {"ARMHB000", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, - {"ARMHB000", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_32BIT, 2, 0, 0, UART_F_IGNORE_SPCR_REGSHFT, "uart pl011"}, + {"ARMH0011", &uart_pl011_class, ACPI_DBG2_ARM_PL011, 2, 0, 0, 0, "uart pl011"}, + {"ARMHB000", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_GENERIC, 2, 0, 0, 0, "uart pl011"}, + {"ARMHB000", &uart_pl011_class, ACPI_DBG2_ARM_SBSA_32BIT, 2, 0, 0, 0, "uart pl011"}, {NULL, NULL, 0, 0, 0, 0, 0, NULL}, }; UART_ACPI_CLASS_AND_DEVICE(acpi_compat_data); From nobody Wed Jan 15 02:33:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqn246HGz5kmSf; Wed, 15 Jan 2025 02:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqn23C1kz3fkB; Wed, 15 Jan 2025 02:33:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hLrxx6wYvj1OfvC/pA6chO/ITlSIjzOyoYmtZ4i3yPI=; b=PDgzeLQn78PTVVR8yOLcCU+c+hqZPSFXaq547xTh9sDPkheecvWUhbRH7gK2GkN0YJOjP7 QnJ9DpGsH7+XLWxYixCuksdAdfHl3G3gOzY/OqhQ0VM6y47hf/0MV3nmRudvpoDiiIcVFo eNNToK6oS6bj2LuonxXpnTdRLhBjide3Y8s1+F0QlMSNRzH3HzSXqu6aqR4e/OHfhzftMX HN4sDti/eiYOUAinOauWjhNf+ZnNX3PG26CeKZ8O+du/TxMwftOcJKJO4f46km3YOdTvPl CucC+hfMgVWrVJ+pMA/1jCQryEpH5Z2gs0toV4qsitELjRGGBaBNX8XsQ8etmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hLrxx6wYvj1OfvC/pA6chO/ITlSIjzOyoYmtZ4i3yPI=; b=NbMDCUgApeMha6ZE5e044p3II25eNtgWG+EjTcwje9KBaWLwKOh3yUlxIiBfXfadxWuIuP uAvxdls7MK8tPOe5jltclL+zAIls61eCrL+kS6KmlaV/bwQSRHC94KknAiBXtnwtzVcRK5 yLne3IcuaAFcQ31WVLJieT7BX5UiEltWwVlgUg1YGz8xgWOLIYhtdwx8GEaMGKxzAzXodT X11T0n5qxOdAMP9ES1is70+Iutq7ib4H1p+uxa0+57/fysTl/JK8G5zDCxsXVSLm9fS4Cj 5SlKIIoKfjNTMStfYOILTw6amlyHTwunMzk6vVO880tu4uxv9hElBl8NwV0iNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736908422; a=rsa-sha256; cv=none; b=fMxyFiXgg7khYvFNiFc/rCjZezFrdaROCaJ/FFFz25wH189NSVJujtDUE0CVJQJG+8RHkO MMIUPfftDVOPXYenTLJoS0SPAsqSx8Kz+EOlpBuW8PueDNgNsW9SngoY6x4sssGhkjZYo4 hVS5LmnNsFzrEUkm4Q5jdegYm8IkjsDbly/AXhB1wZsRL7m+kjY2TwBjWUJgLGgHvUk7Rs cN8hI43v/RVMrmR52dQidP+qCOR4h5+fH/55j+swNO+MK7f3OSA3o0NLLAVeaC2FgIiB1R 03M4jW/U2vRIZvGicun08rGVA+tyYf9wun6ko17gakYBv8PuwJ9z9JL8SWbMZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqn22Y51zBy7; Wed, 15 Jan 2025 02:33: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 50F2XgBw046453; Wed, 15 Jan 2025 02:33:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2XgsP046450; Wed, 15 Jan 2025 02:33:42 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:33:42 GMT Message-Id: <202501150233.50F2XgsP046450@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 954de313b261 - stable/13 - makefs: Crudely fix a sprintf warning List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 954de313b261f6e631ca1a29106ae47e5621479c Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=954de313b261f6e631ca1a29106ae47e5621479c commit 954de313b261f6e631ca1a29106ae47e5621479c Author: Ed Maste AuthorDate: 2024-12-22 16:00:49 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:33:30 +0000 makefs: Crudely fix a sprintf warning Reviewed by: kevans Obtained from: OpenBSD d95291fdb2dc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48178 (cherry picked from commit 2069f6ecb1b1268deac980176c652ffab264970e) (cherry picked from commit fb0239e69f17400b08421a002a72b9520afd8285) --- usr.sbin/makefs/cd9660.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 7ce9a3b6cbb2..e895f09bef0f 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -142,10 +142,11 @@ static void cd9660_convert_structure(iso9660_disk *, fsnode *, cd9660node *, int static void cd9660_free_structure(cd9660node *); static int cd9660_generate_path_table(iso9660_disk *); static int cd9660_level1_convert_filename(iso9660_disk *, const char *, char *, - int); + size_t, int); static int cd9660_level2_convert_filename(iso9660_disk *, const char *, char *, + size_t, int); +static int cd9660_convert_filename(iso9660_disk *, const char *, char *, size_t, int); -static int cd9660_convert_filename(iso9660_disk *, const char *, char *, int); static void cd9660_populate_dot_records(iso9660_disk *, cd9660node *); static int64_t cd9660_compute_offsets(iso9660_disk *, cd9660node *, int64_t); #if 0 @@ -225,7 +226,8 @@ cd9660_set_defaults(iso9660_disk *diskStructure) memset(diskStructure->primaryDescriptor.abstract_file_id, 0x20,37); memset(diskStructure->primaryDescriptor.bibliographic_file_id, 0x20,37); - strcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD"); + strlcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD", + sizeof(diskStructure->primaryDescriptor.system_id)); /* Boot support: Initially disabled */ diskStructure->has_generic_bootimage = 0; @@ -806,7 +808,7 @@ cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); (void)cd9660_convert_filename(diskStructure, newnode->node->name, - temp, !(S_ISDIR(newnode->node->type))); + temp, sizeof(temp), !(S_ISDIR(newnode->node->type))); flag = ISO_FLAG_CLEAR; if (S_ISDIR(newnode->node->type)) @@ -1109,7 +1111,9 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, while (digits > 0) { digit = (int)(temp / powers); temp = temp - digit * powers; - sprintf(&tmp[numbts] , "%d", digit); + snprintf(&tmp[numbts], + ISO_FILENAME_MAXLENGTH_WITH_PADDING - numbts, + "%d", digit); digits--; numbts++; powers = powers / 10; @@ -1575,7 +1579,7 @@ cd9660_compute_full_filename(cd9660node *node, char *buf) */ static int cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { /* * ISO 9660 : 10.1 @@ -1586,6 +1590,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, int namelen = 0; int extlen = 0; int found_ext = 0; + char *orignewname = newname; while (*oldname != '\0' && extlen < 3) { /* Handle period first, as it is special */ @@ -1627,7 +1632,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, if (!found_ext && !diskStructure->omit_trailing_period) *newname++ = '.'; /* Add version */ - sprintf(newname, ";%i", 1); + snprintf(newname, newnamelen - (newname - orignewname), ";%i", 1); } return namelen + extlen + found_ext; } @@ -1635,7 +1640,7 @@ cd9660_level1_convert_filename(iso9660_disk *diskStructure, const char *oldname, /* XXX bounds checking! */ static int cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { /* * ISO 9660 : 7.5.1 @@ -1649,6 +1654,7 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, int namelen = 0; int extlen = 0; int found_ext = 0; + char *orignewname = newname; while (*oldname != '\0' && namelen + extlen < 30) { /* Handle period first, as it is special */ @@ -1694,7 +1700,7 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, if (!found_ext && !diskStructure->omit_trailing_period) *newname++ = '.'; /* Add version */ - sprintf(newname, ";%i", 1); + snprintf(newname, newnamelen - (newname - orignewname), ";%i", 1); } return namelen + extlen + found_ext; } @@ -1709,15 +1715,15 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, */ static int cd9660_convert_filename(iso9660_disk *diskStructure, const char *oldname, - char *newname, int is_file) + char *newname, size_t newnamelen, int is_file) { assert(1 <= diskStructure->isoLevel && diskStructure->isoLevel <= 2); if (diskStructure->isoLevel == 1) return(cd9660_level1_convert_filename(diskStructure, - oldname, newname, is_file)); + oldname, newname, newnamelen, is_file)); else if (diskStructure->isoLevel == 2) return (cd9660_level2_convert_filename(diskStructure, - oldname, newname, is_file)); + oldname, newname, newnamelen, is_file)); abort(); } @@ -1929,7 +1935,7 @@ cd9660_create_virtual_entry(iso9660_disk *diskStructure, const char *name, temp->isoDirRecord = emalloc(sizeof(*temp->isoDirRecord)); cd9660_convert_filename(diskStructure, tfsnode->name, - temp->isoDirRecord->name, file); + temp->isoDirRecord->name, sizeof(temp->isoDirRecord->name), file); temp->node = tfsnode; temp->parent = parent; From nobody Wed Jan 15 02:33:43 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqn36mRcz5kmN9; Wed, 15 Jan 2025 02:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqn342lfz3fmh; Wed, 15 Jan 2025 02:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQNdj5IMcqmmGrwPGORiq1Pi7hzmt7b97dQ+NMmIMaU=; b=EO/JJFahr6OFCRyYljB0KZ6xqPHUu/QuSizdWoT0ZqS3mjCWMUmo880RT/oMu8Jjl5yTCI kCy7ex1mU3Jk+zn2CkwG60mcC0lYbIltb4iQ0Y4F2/D6Fkk9yvNqaFANUtmeyGeBkjSgd8 +3uQUXGyCS+XXZtjqjwx/EPPLnV7C1EBZjNSVolEN7kXRI3AoS3hv+ovZYQW/s46PZZY3I l5VnGNU1j1MV5y8wgJ41wF2wU9WToKP94mBazL/GP59cJsCmnPj+xYEj5km1d7hNsCHkP7 CfN0esM732w7U3rhjCTAlTiCY3svhWUJ9aPFRnVzNV+BnsEqMUaOyHRYlCdcqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jQNdj5IMcqmmGrwPGORiq1Pi7hzmt7b97dQ+NMmIMaU=; b=T1fqqNtLo/u8pjOGFwIZiumw3Wl/tXcuof5OnzB0fefP3oWFRWgTHhDz7RCjKo4ttdilZ7 64I6BaXlRAaM0mSPx4r9mamQmteABnDOWM686DGLM2pU/z5jhWAzf7dz9f4lv/jvqJcRUh WF8chbTpuT1I5ubplT2TBs+qbVWR0f+Aw35EHnI6ssMD1ujhuydonTDaSAIJxg/ByIlFjE KOoHCvwnXcU3yeYG7gU6jt8kQHPoutQnfulnckzltP1aTSAJ25zORXwKjTOFWwsSw0gxEM 1gLI1xLEnANHb0flXzRrTOlypvW5g9nD6ZeYh2nACJX8T9VD3LcFdbl7UVhruw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736908423; a=rsa-sha256; cv=none; b=SQrXDZXHVht1Qk0wnLV4fZgIEBa9oQTcgu3t+iJ7YkATZ15Nd76Cfuh0UvFLbR90QeR1gG 3pphU2I9UWP93YU1hLEkP6IUnJ4QadwzPSbN6MdBTYVMqm7DD5GuWKv8oRg8J2OKX4hDpq rgESLpPivxWiBMFlbGYjMSrXfuHONhLG5KNhKSKk/m2IRneDOwZBwIHo9tYU1x7qSa3SCg UhsJ4zevtclqFnl6aN0RLRmWW3BvSORXy8WRWEVr9LzGnQOBpvwZ5ny1wCecLK01F0nxUS eD/WgKsSNr2rF2rI2en8lqg/KUIlNA2UHccP5Gz72cDS2sUvdO9E+ex+nYGolw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqn33ZfnzC5W; Wed, 15 Jan 2025 02:33: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 50F2Xh9o046501; Wed, 15 Jan 2025 02:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2XhmS046498; Wed, 15 Jan 2025 02:33:43 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:33:43 GMT Message-Id: <202501150233.50F2XhmS046498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f6a64ab6a2c9 - stable/13 - makefs: Fix cd9660 filename buffer maximum length List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f6a64ab6a2c936a7660ddddce8b8676737b994ed Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f6a64ab6a2c936a7660ddddce8b8676737b994ed commit f6a64ab6a2c936a7660ddddce8b8676737b994ed Author: Ed Maste AuthorDate: 2024-12-24 16:08:10 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:33:30 +0000 makefs: Fix cd9660 filename buffer maximum length The maximum length is 30 characters for name and extension, two separators (. and ;) and 5 characters for file version from 1 to 32767, which is 37 characters. Add one for the null term as we treat these buffers as C strings. This is not an issue in practice, as the file version is always 1 in makefs. While here, drop `_WITH_PADDING` from the macro name and update the previously-unused ISO_FILENAME_MAXLENGTH for the corrected length. A 0x00 padding byte is used by ISO9660 when needed for alignment, which can be the null byte at the end of the string. Use sizeof where appropriate. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48193 (cherry picked from commit 2e09cef8dc6f46faba8bab87c42c3f19ba2ffe87) (cherry picked from commit 999c7a888f4fbe74573bc342052f3146b8d756c9) --- usr.sbin/makefs/cd9660.c | 16 +++++++--------- usr.sbin/makefs/cd9660.h | 9 ++++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index e895f09bef0f..283879df16ae 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -502,7 +502,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, real_root->isoDirRecord = emalloc(sizeof(*real_root->isoDirRecord)); /* Leave filename blank for root */ memset(real_root->isoDirRecord->name, 0, - ISO_FILENAME_MAXLENGTH_WITH_PADDING); + sizeof(real_root->isoDirRecord->name)); real_root->level = 0; diskStructure->rootNode = real_root; @@ -802,10 +802,10 @@ static int cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) { u_char flag; - char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char temp[ISO_FILENAME_MAXLENGTH]; /* Now populate the isoDirRecord structure */ - memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memset(temp, 0, sizeof(temp)); (void)cd9660_convert_filename(diskStructure, newnode->node->name, temp, sizeof(temp), !(S_ISDIR(newnode->node->type))); @@ -1050,7 +1050,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, else maxlength = ISO_FILENAME_MAXLENGTH_BEFORE_VERSION; - tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); + tmp = emalloc(ISO_FILENAME_MAXLENGTH); while (i < num && iter) { powers = 1; @@ -1111,8 +1111,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, while (digits > 0) { digit = (int)(temp / powers); temp = temp - digit * powers; - snprintf(&tmp[numbts], - ISO_FILENAME_MAXLENGTH_WITH_PADDING - numbts, + snprintf(&tmp[numbts], ISO_FILENAME_MAXLENGTH - numbts, "%d", digit); digits--; numbts++; @@ -1159,8 +1158,7 @@ cd9660_copy_filenames(iso9660_disk *diskStructure, cd9660node *node) TAILQ_FOREACH(cn, &node->cn_children, cn_next_child) { cd9660_copy_filenames(diskStructure, cn); - memcpy(cn->o_name, cn->isoDirRecord->name, - ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memcpy(cn->o_name, cn->isoDirRecord->name, sizeof(cn->o_name)); } } @@ -1283,7 +1281,7 @@ cd9660_rrip_move_directory(iso9660_disk *diskStructure, cd9660node *dir) /* TODO: Inherit permissions / ownership (basically the entire inode) */ /* Set the new name */ - memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); + memset(dir->isoDirRecord->name, 0, sizeof(dir->isoDirRecord->name)); strncpy(dir->isoDirRecord->name, newname, 8); dir->isoDirRecord->length[0] = 34 + 8; dir->isoDirRecord->name_len[0] = 8; diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index b7324322d383..2892d6d206c2 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -72,8 +72,7 @@ /*30 for name and extension, as well as version number and padding bit*/ #define ISO_FILENAME_MAXLENGTH_BEFORE_VERSION 30 -#define ISO_FILENAME_MAXLENGTH 36 -#define ISO_FILENAME_MAXLENGTH_WITH_PADDING 37 +#define ISO_FILENAME_MAXLENGTH 38 #define ISO_FLAG_CLEAR 0x00 #define ISO_FLAG_HIDDEN 0x01 @@ -118,7 +117,7 @@ typedef struct _iso_directory_record_cd9660 { u_char interleave [ISODCL (28, 28)]; /* 711 */ u_char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ u_char name_len [ISODCL (33, 33)]; /* 711 */ - char name [ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char name [ISO_FILENAME_MAXLENGTH]; } iso_directory_record_cd9660; /* TODO: Lots of optimization of this structure */ @@ -154,7 +153,7 @@ typedef struct _cd9660node { int fileRecordSize;/*copy of a variable, int for quicker calculations*/ /* Old name, used for renaming - needs to be optimized but low priority */ - char o_name [ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char o_name [ISO_FILENAME_MAXLENGTH]; /***** SPACE RESERVED FOR EXTENSIONS *****/ /* For memory efficiency's sake - we should move this to a separate struct @@ -194,7 +193,7 @@ typedef struct _path_table_entry u_char extended_attribute_length[ISODCL (2, 2)]; u_char first_sector[ISODCL (3, 6)]; u_char parent_number[ISODCL (7, 8)]; - char name[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; + char name[ISO_FILENAME_MAXLENGTH]; } path_table_entry; typedef struct _volume_descriptor From nobody Wed Jan 15 02:33:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqn50BmLz5kmSq; Wed, 15 Jan 2025 02:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqn44mFXz3ffH; Wed, 15 Jan 2025 02:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SlmGoHEYk9BstFuAu/SdWMxPfLpDyz8Mpr9D5dLhQE=; b=V78k3WL0dl+7+tnJtGyOdXLzGb/M+TvSju4sqJU+nAupcHlwxne1/yEjHSe/hBDvv7piN/ S+4O3G4mTDvHFPIDbj2csQIfSqtX9msKAEh5WwlKacY/4QYOWc7N6q44qeJiVnYj/5tSs+ Vpcq/TCi15lBG1LlCQ+g+n0E0Q7UFbpctGW3T62OCfkq88bzP011lqq2dybJ+2a2prZ8UQ jF5qHtDiZP2iQ4WkQXJrvGpVF0noOXcoT1MJ5EyejdOR5KrflwZThCzebBdXUqzlRxgWMw cKGoR6KtltYGvmwBakWfCBlnlBfZ4ueBEv9Bwrcmg2jF1AxZdymoRxkgRx2oRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SlmGoHEYk9BstFuAu/SdWMxPfLpDyz8Mpr9D5dLhQE=; b=MjL06fHeF30qjWJ7go0BbH5NWsUZYQP6cZFuzwxx06PDxm9DKtGwtK0OLseZflqbTkwLL5 8J3Vrn5+eje5gY3XqZApDAJyklaWZjyuPZqUzSnPhp127CrUGHYbEFZr+w3P9b4ccCEG3F u/7YnJKWevRzcBtQ5wfuvX/kfiLNIzbsmKaSDcSBuxjrkpPKuqT+cB0yFOVcpFYTNKRkFu eOS8zcS51Bv8l92JAH8j5o3HCHxOjnrFwpHSp1ARfGalcEaza0PEj1Ho8r0WV7LpLBi23I T9nSN7kP5AtsqjV6GefRpwzkWqJU6tb1GRVyZF5gnQtSF8YZiiKBEvyXdQ7OLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736908424; a=rsa-sha256; cv=none; b=Q3sDU7FfaeQ5+4+dbTFRjKAHNlWuuWp2lS6WgSlRdHiH/Pe9OvN6/G7vxL2BdvRbkgHS6t QRH+G4FW6I8d/f2fEJvc4+JK5bIvgk/rqKTk3mQeOXU6Owscsdxy/feIcCBCtZLghO+jJk hvqOIfwwAqoZNqzygQVjf1LMDTXIgkLT/rMhbvgACClJRZ0yvV2jBtH447YM8YMVQbwSa7 YsVdi3TJPQj8FLGnBUINUrREfsPitWW3sxdKtZ4pc4OB20FFsRaL43degxbdny4fAAcrQC pEV06e1jOYrnEF6y5BLJvzmEuwrd+YO/s0qq5cbhnA/xyml3NYUq0LpC54piwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqn44MRSzBwC; Wed, 15 Jan 2025 02:33:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50F2XiP0046546; Wed, 15 Jan 2025 02:33:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2XiB3046543; Wed, 15 Jan 2025 02:33:44 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:33:44 GMT Message-Id: <202501150233.50F2XiB3046543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 94652c10c07a - stable/13 - makefs: Remove impossible if condition List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 94652c10c07abecb1d799145807cc0e01bad8b36 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=94652c10c07abecb1d799145807cc0e01bad8b36 commit 94652c10c07abecb1d799145807cc0e01bad8b36 Author: Ed Maste AuthorDate: 2024-12-24 01:58:37 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:33:30 +0000 makefs: Remove impossible if condition This test is inside the else block for `if (*oldname == '.')`, so *oldname cannot be '.' here. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48243 (cherry picked from commit 788e1eb7c199297aa438fc5cb6caabc9be01b419) (cherry picked from commit 302be497fc0349979df05b700a7d27ffdac941f4) --- usr.sbin/makefs/cd9660.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 283879df16ae..6c917deaa6a0 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1680,12 +1680,8 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, else if (isupper((unsigned char)*oldname) || isdigit((unsigned char)*oldname)) *newname++ = *oldname; - else if (diskStructure->allow_multidot && - *oldname == '.') { - *newname++ = '.'; - } else { + else *newname++ = '_'; - } if (found_ext) extlen++; From nobody Wed Jan 15 02:33:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqn629Wxz5kmSr; Wed, 15 Jan 2025 02:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqn56QQvz3fQ4; Wed, 15 Jan 2025 02:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IE4qZpRlLVt+oS9pSEqYTrwvmQ3bMiwGv2LIW6xQi50=; b=UkVqHoTPdMGwYyAVkWpLwjhHeNsYnqs/hCCIKnlhcgzMbSQUKbLGzqVtUHrvq9z75GOjuM nUacWdMEwM8/1JT6ZOnupHXwpLRxXtMWrSoEFJtEhAeSJzjNmOf9vWj1QvgOQRu3bZIE12 pAXLRhbIvLOJDUc8R7aW7rwmau89aocNb+IVrF5qlH2EYi7T0TP2c+H0qU5oNj4H47rmb6 m91UDoSUlGaTZy5uakE1G1xmwDvp/GIh+x7KtefYLpZBre0SbOAmaLNNZu+/xoJlIZyOCs yVwIHa+2IZ4mbI1zWIfPIWwwBHhpNnh7DjSIX16SjsUuPNr+PEi/mVLlRU9S1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IE4qZpRlLVt+oS9pSEqYTrwvmQ3bMiwGv2LIW6xQi50=; b=E3pyRC/OG4sok/Cz2ahrblGCByyhEqXPwxsyF22RRs76ryygdLIeAP6IPyg2IFY9oXKAT3 amN7QG9LVDQeXN6439zRfAee4n+70fim+0pcgaoqwY6Q02rHclwLxZLiVGcnki41IBaR5S JwBxhQv2HgACm3u6hCzS1LBKUxSAScb+EFe2jfuI3IXnvkksHqMdWj2TAgggM3nsvRM1cE cO2yuqu54Pf3XyRUBlnojQzownYlOMu36+ub0rdMwrOZC/8TbumGzMgTSbikoEov6lh6V1 jrJLS/9s+MmZy+1Jj3kVDl0++HV5717ETCQgEekdWy6AIL92qRePgqygkraO4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736908425; a=rsa-sha256; cv=none; b=pbHWaf2I1k/3gLXvHCoarJwRefyhacwNROMy6uenk9+7zAP06US88cnNy6jcWdgupQFc+I 8CS5QzCCLDKjhWjrXjEtQ/KfAjF2MlMls3dMq3W3QJ5XSrJuiBbEmNP5QQTCSPPSV0KiVn pbkmoVgHGgn254YijeRIYhj47YtwvHKyPwRgDEP6TI3TsqZ3gUQEn410cDkGNDzdgSIrLY s/v/SR6D/MKFFhrPOAFQlI7Zbav8GWdISz6N5oKggZ04VGrnO0wE1KpzaoVySZtQhgvGtN CUMQWtqCQ5VOmfZHrpXishyvgyHqq49cUCuCx1EDZDjCRcK0cVDuQwqdH5MQYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqn55RDzzBwD; Wed, 15 Jan 2025 02:33: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 50F2Xje6046600; Wed, 15 Jan 2025 02:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2Xjx5046597; Wed, 15 Jan 2025 02:33:45 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:33:45 GMT Message-Id: <202501150233.50F2Xjx5046597@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 79778b7aafc8 - stable/13 - makefs: Fix cd9660 duplicate directory names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 79778b7aafc829e6f67cbf0d50a51836e69dc784 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=79778b7aafc829e6f67cbf0d50a51836e69dc784 commit 79778b7aafc829e6f67cbf0d50a51836e69dc784 Author: Ed Maste AuthorDate: 2024-12-30 15:01:06 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:33:30 +0000 makefs: Fix cd9660 duplicate directory names Previously we could create cd9660 images with duplicate short (level 2) names. cd9660_level2_convert_filename used a 30-character limit (for files and directories), not including the '.' separator. cd9660_rename_filename used a 31-character limit, including the '.'. Directory names 31 characters or longer (without '.') were shortened to 30 characters, and if a collision occurred cd9660_rename_filename uniquified them starting with the 31st character. Unfortunately the directory record's name_len was already set, so the unique part of the name was stripped off. Directories are up to 31 d-characters (i.e., A-Z 0-9 and _); there is no provision for a '.' in a directory name. Increase the name length limit to 31 for directories, and exclude '.'s. This name mapping and deduplication code is still fragile and convoluted and would beenfit from a more holistic effort. PR: 283238, 283112 Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48251 (cherry picked from commit 1f31d437428014e864bcce1223cf7017180e2608) (cherry picked from commit 40b11c1c16d85b3339be4c3c4fde2ef7fa36f3ff) --- usr.sbin/makefs/cd9660.c | 5 ++-- usr.sbin/makefs/tests/makefs_cd9660_tests.sh | 39 ++++++++++++++++++++++++++-- usr.sbin/makefs/tests/makefs_tests_common.sh | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 6c917deaa6a0..654285057378 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1649,14 +1649,15 @@ cd9660_level2_convert_filename(iso9660_disk *diskStructure, const char *oldname, * File version number (5 characters, 1-32767) * 1 <= Sum of File name and File name extension <= 30 */ + int maxlen = is_file ? 30 : 31; int namelen = 0; int extlen = 0; int found_ext = 0; char *orignewname = newname; - while (*oldname != '\0' && namelen + extlen < 30) { + while (*oldname != '\0' && namelen + extlen < maxlen) { /* Handle period first, as it is special */ - if (*oldname == '.') { + if (*oldname == '.' && is_file) { if (found_ext) { if (diskStructure->allow_multidot) { *newname++ = '.'; diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh index 2fdf47f76a4c..066a9d6ec0e0 100644 --- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh +++ b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh @@ -51,8 +51,8 @@ common_cleanup() check_base_iso9660_image_contents() { # Symlinks are treated like files when rockridge support isn't - # specified - check_image_contents "$@" -X c + # specified, and directories cannot contain a '.'. + check_image_contents "$@" -X c -X .g -X _g atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c @@ -374,6 +374,39 @@ o_flag_rockridge_dev_nodes_cleanup() common_cleanup } +atf_test_case duplicate_names cleanup +duplicate_names_head() +{ + atf_set "descr" "Ensure shortened directory names are unique (PR283238)" +} +duplicate_names_body() +{ + check_cd9660_support + create_test_dirs + + # Create three directories which are identical in the first 31 characters. + dir_prefix="this_directory_name_is_31_chars" + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}1 + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}2 + mkdir -p $TEST_INPUTS_DIR/${dir_prefix}3 + + atf_check -e empty -o empty -s exit:0 \ + $MAKEFS -o rockridge $TEST_IMAGE $TEST_INPUTS_DIR + + # Disable Rock Ridge extensions to read the plain ISO Level 2 names. + mount_image -r + + # The specific way the short names are made unique is not important. + # We verify only that there are three unique names and that the unique + # part is at the end of the name. + atf_check_equal $(ls -1 $TEST_MOUNT_DIR | sort | uniq | wc -l) 3 + atf_check_equal $(ls -1 $TEST_MOUNT_DIR | cut -c -29 | sort | uniq | wc -l) 1 +} +duplicate_names_cleanup() +{ + common_cleanup +} + atf_init_test_cases() { atf_add_test_case D_flag @@ -392,4 +425,6 @@ atf_init_test_cases() atf_add_test_case o_flag_publisher atf_add_test_case o_flag_rockridge atf_add_test_case o_flag_rockridge_dev_nodes + + atf_add_test_case duplicate_names } diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh index 12c7c7c84fb7..b418cafc90a6 100644 --- a/usr.sbin/makefs/tests/makefs_tests_common.sh +++ b/usr.sbin/makefs/tests/makefs_tests_common.sh @@ -138,6 +138,6 @@ mount_image() atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ mdconfig -a -f $TEST_IMAGE atf_check -e empty -o empty -s exit:0 \ - $MOUNT /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR + $MOUNT ${1} /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR } From nobody Wed Jan 15 02:35:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXqqH5hXJz5kmJC; Wed, 15 Jan 2025 02:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXqqH4D0tz3gxv; Wed, 15 Jan 2025 02:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSGvd0G71uvEupleuYBeqnZQQLaJGk49CCEW2QnR+0I=; b=xNNmafMDrlQsIT/7a1Wi2uaw7sCDauyqLq1RfFhABAk1Xy3IBrZfuS/v+AU5Wd2ivRxySV HEAj78+tHSiV96HQJ4bA5N0dSBcJbGukzAlG2PK2nQ5KW21KC62dXxSWkXUt/3pjAZluk1 1DJeAvHLc63hkvDGjgSXQMgJ1Q6Hv7NgWWsixSqMgU2c83BFWeORq9rPE9ZSx+tMOImhpJ cRUgU3Nx0TtPs64HZyzXrXl1iTmys8RxrbqQ35IKsNLKjIwdMsOfY4DJ315qMMDZDJFlZq uo7hZIJUxVouuzmpU2vgelHzSCkipfDJJDkxt4aaqK3tEXZrJ0Kh+5EVDvZjQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736908539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iSGvd0G71uvEupleuYBeqnZQQLaJGk49CCEW2QnR+0I=; b=NkjLEdzPW8CV9qi0f6C5DdSDnOdpGbberD/E8e8oCC1x2HyWgt3llud0KaS2YFaDvHX8jJ a8m67IjhVzqkZp862Jts8VaVCf5arrgJKCXu1UVUPs+Q5z8DNhAmNolZIVMHRGiJT3KIBA trP7uPCz0ATk7HSiLIabAAuiu+H4uysKytH79bsgaB76vfPwAufLQVW0yStBcZVcozARg6 jCtigI1XKCV1UpOQbw0sAqXY4qnzAVwmI8qqvFr02dmv3SrYU/gwcwqC8DW7xPU5ai6lsK gi1kyWYnPzcCQsqnTrQfhi3/0uT+cXvuKKqCRvyt0+IDiyL9V2ilUb/qc9sjdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736908539; a=rsa-sha256; cv=none; b=MfcDgSblE5ud9L9OSgr24OjvjTQOUFhdfs9JW4ZRS4cM7AKVA4MnoeEKDWbkV9/eW8gRE0 tr1Fa5/mqlKlqaLqQHTHzzbhYj/e/prYwXBdXHMf2rKjH6n4keZn5ioF64CRquSIfDzhHS nx0AiahgIjPgsHC0R656Yw6iTAyCiFTxfR1xfQzDMGVDUEHr8n8LZ3pW9K/Azq60++N5aM bHCTDj2oUmi+przLYf1ZJuCEtnrwFoJ6/99V4rnICf4+jRt9udjJjJIWsPvgCD6IFZeacL 2B8cmMkzAmzPWD27LzPcAc1uHlepkmqpfHTvHUSa76zkAU/tXSkU5Djqth54Bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXqqH3VppzCCN; Wed, 15 Jan 2025 02:35:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50F2Zdl1047354; Wed, 15 Jan 2025 02:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2Zd1B047351; Wed, 15 Jan 2025 02:35:39 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:35:39 GMT Message-Id: <202501150235.50F2Zd1B047351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f81286d19230 - stable/13 - makefs: Exit with error if writing cd image fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f81286d192304bba45697ec157c73a8e44ff57eb Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f81286d192304bba45697ec157c73a8e44ff57eb commit f81286d192304bba45697ec157c73a8e44ff57eb Author: Ed Maste AuthorDate: 2024-12-23 15:54:32 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:35:28 +0000 makefs: Exit with error if writing cd image fails Obtained from: OpenBSD c8f48d9b1ea9 Sponsored by: The FreeBSD Foundation (cherry picked from commit b45f84cc6213854ead00a4bfc7973332eda65676) (cherry picked from commit afb7a85e52c323aca544f0d235b67123bf87d342) --- usr.sbin/makefs/cd9660.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 654285057378..17fab3a8cfdf 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -467,7 +467,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, fsinfo_t *fsopts) { int64_t startoffset; - int numDirectories; + int ret, numDirectories; uint64_t pathTableSectors; int64_t firstAvailableSector; int64_t totalSpace; @@ -613,7 +613,7 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, if (diskStructure->include_padding_areas) diskStructure->totalSectors += 150; - cd9660_write_image(diskStructure, image); + ret = cd9660_write_image(diskStructure, image); if (diskStructure->verbose_level > 1) { debug_print_volume_descriptor_information(diskStructure); @@ -625,7 +625,10 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root, cd9660_free_structure(real_root); if (diskStructure->verbose_level > 0) - printf("%s: done\n", __func__); + printf("%s: done ret = %d\n", __func__, ret); + + if (ret == 0) /* cd9660_write_image() failed */ + exit(1); } /* Generic function pointer - implement later */ From nobody Wed Jan 15 02:48:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXr6g6HC9z5kmxB; Wed, 15 Jan 2025 02:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXr6g5ZYGz3hQd; Wed, 15 Jan 2025 02:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4pVxIFIKx2Z3BVUbatJOU4q2mMYN5ovMQF3F40tctZk=; b=byqSaLi/nsIJib0+W/nJftcpBZ2KcajZHwLZ4HtsnzYfA9guYgXd81UmM0x0c443VkUmZE PTmrsDDpnxNvx3oDGlkxTIynOv91WRdWCtHOo+gpC6vbl0lKJMChXe3jrPoOKq1Le0/j4P NPX2q2m+4xtqmvivkVj6uP3PkDLNtONL9b5fUoOnFR+s2US7Hs/qDEnz3PsYDZVnoRkk4J GZAdZW3DSEH3UF7EBLNGiCg4lj85QJZ0td/xFtlgNTtgrOhZSVnXzLU0BzvlImIvYcFLeO c+FseMP/Qf2305wwfzQb8MKCNb175TRfcNen9HwYogAaVxBsSHN/d24EUsZeYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909339; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4pVxIFIKx2Z3BVUbatJOU4q2mMYN5ovMQF3F40tctZk=; b=FDUgm+BQrx+araZuu58eVSFQn/WVMO8FsnqfuZiBSWV64Rlgdppd0JrZl/Awc9FY2maBaa Yctr/nUeZs22dlqTrvwCLygScgeKR9XtswlzkiAXfiVPjZgMTdfG/PxOuKkoFJW0qzmVXG sl77/s+mYv/MaMJQZ65Jv2uKOxO1DbqNVwuRagbD6QBSaSIHYhMyQBs/CfSEAX5HwZSSof UolFev8yjaDc2N8gvr8ML9U1IeUAmDRFtc6SMTw5k2AAZ5NR/GAYvqcf4L1iPn0jhnoU5K WL8y1FS/UvdRqIi3JG44HFd3P9WX1JHfPk/cSgbBVVA1aWKmWoTbsg0dTaGbOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736909339; a=rsa-sha256; cv=none; b=ELank1lhhXrp12YiIjdy/sh4MKOxqcv47Gp7sEv5N/mIYzk3Ws2C2LCDzmd9/HqIgJop51 iUU6Cr+y2IT4J7O0MUEiurEER14VNwt097xaslhSMBfK7r31lSD2psTmUw6zxJDY8K/qXi nPJqKv8yzCkzb1bhcNK5XjrHA9l7lwum9c787MnffO2Mf2lP3aQGF9G7nYz4xkGWMSKqEo Z/JBVYGwoikHt/+MI1RRvEQ7qvaHIm+IBW+GcovQ5k3JP0reUdWnpwHueoFeMLDWPHnVv3 8672FXAnIoyGwCYabpHwQz1hDNUh25rumdzyoLXw7gNXPOo7wgtt7MIUG4ua1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXr6g4tc7zCPV; Wed, 15 Jan 2025 02:48: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 50F2mx6q067201; Wed, 15 Jan 2025 02:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2mx1H067198; Wed, 15 Jan 2025 02:48:59 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:48:59 GMT Message-Id: <202501150248.50F2mx1H067198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: ff911710de34 - stable/14 - isp: Fix abort issue introduced by previous commit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff911710de34864cd748141b460c498e9217904d Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ff911710de34864cd748141b460c498e9217904d commit ff911710de34864cd748141b460c498e9217904d Author: Alexander Motin AuthorDate: 2025-01-08 18:23:26 +0000 Commit: Alexander Motin CommitDate: 2025-01-15 02:48:41 +0000 isp: Fix abort issue introduced by previous commit Aborting ATIO while its CTIOs are in progress makes impossible to handle their completions, making them stuck forever. Detect this case by checking ctcnt counter and if so instead of aborting just mark the ATIO as dead to block any new CTIOs. It is not perfect since the task id can not be reused for some more time, but not as bad as the task stuck forever. MFC after: 1 week (cherry picked from commit 2c48a8f161c91bf7020122697d064a25287097a3) --- sys/dev/isp/isp_freebsd.c | 19 +++++++++++++++++-- sys/dev/isp/isp_freebsd.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d5aa7a54142e..b496eae1b466 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,6 +986,16 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } + /* + * Is this command a dead duck? + */ + if (atp->dead) { + isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + continue; + } + /* * Check to make sure we're still in target mode. */ @@ -2503,14 +2513,19 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected CCBs before ACK-ing INOT, + * Target should abort all affected tasks before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. + * We can not do it if some CTIOs are in progress, or we won't + * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (atp->ctcnt == 0 && + isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); + else + atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 5bb3dd43b6de..73390fa14769 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,8 +104,9 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint8_t srr_notify_rcvd : 1, + uint16_t srr_notify_rcvd : 1, sendst : 1, + dead : 1, tattr : 3, state : 3; void * ests; From nobody Wed Jan 15 02:49:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXr7S6yftz5knLp; Wed, 15 Jan 2025 02:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXr7S4d8Sz3j3G; Wed, 15 Jan 2025 02:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzA9U/RmKa//XSQfGU89PAbfX+ocD7zctnK1IxAEuTY=; b=lhOnIDFu4k3Md5evXe02wwzCZ/KTvacBfvSqgWcMOowBrOvDdbWIgoxtQ9oLxEpeHBb8Ib +NhhYO5H4AykiqoLYIyud3t6LPLxe682QleixXcIECw8tOc3CUwyT2Jj3+O03zIpBLKknv w1RGozFaqhWHEkd+VAAFp/HKzBHhEf3ePvzB3uAFZaMDw+4c5c/tjsCwX7qxovQFodJ800 krQqtLQRb6DcbUbU6/MLpIdh0k+MGDXGyp8Wlb5MfWEOdEFu04n6aF1wzE1tYNvQ3wyxzR kIOciScv9ybwIo3WUCR4JR+L0goqmpxLHc8SiR6QCnGKUuT93H9FfcMfxRjMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JzA9U/RmKa//XSQfGU89PAbfX+ocD7zctnK1IxAEuTY=; b=OEy3BiMXsZ03//6t3lJgpxySE6UWMZMc63P66baCf6w8CT7qOo4HR7p1j4d4qQtMzDzXnC 8UFhOdnVE7jUiJ0RJu1SrpCQKtaPpIyE3fsmB2gEPnZfMS9OsmPA4+gZjeh6glTGdhSJ4G jpEU+i4/uXgL/XfHrkcexlCFvlfGhrlWbQFrPXNpyzD3Vp3JPCifRRSxaY/uarQxVK+F5p 1gTE6miCcTQRU1P9mpp/qPgJZ4uznxh6dLBtQhua1p13IThi5qxLqqitKqEEWQokfeHffN J3m1oTnIydBef4JS7JQi0NX7eylJiQSayxv0MtXa2N841aDJuz7T9NwvYHIGMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736909380; a=rsa-sha256; cv=none; b=HNoQciSAZHmfaKb9UfZu+gjjs2yZgk7JcMEQ2jb6fCMts17uWgIa6GFVDawJ43Nc63cscE RHSaSK1PK++JaOUCYZjrlzGX2iXjJn29KObUEwlIBOqdMx7SCdD/ELY6Gdt53v21qZhBiY sLyOAMAtcRSVziWr8jMPsJKXFmAFj3fNNR+FN4AfgmUWCoyfUG59MJ2j6TcG4U8uVSVZcA te1KLMmvXBwIi7iJVDYt+/jRdPbZe+y3eOi64KvVDLZfy2XekE3ZYaXiaVjYgiif8IEprQ MhwrZy/+cc/xoW1ChA76Hlcxe6q+QTdwcSmdXRYszpYIm6U+EKnXPrpFhSlMbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXr7S3tqRzBS8; Wed, 15 Jan 2025 02:49: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 50F2neOi067581; Wed, 15 Jan 2025 02:49:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2ne0v067578; Wed, 15 Jan 2025 02:49:40 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:49:40 GMT Message-Id: <202501150249.50F2ne0v067578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 519121f5ea03 - stable/13 - isp: Fix abort issue introduced by previous commit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 519121f5ea03c93da8f0600555c138df4a1c5e0a Auto-Submitted: auto-generated The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=519121f5ea03c93da8f0600555c138df4a1c5e0a commit 519121f5ea03c93da8f0600555c138df4a1c5e0a Author: Alexander Motin AuthorDate: 2025-01-08 18:23:26 +0000 Commit: Alexander Motin CommitDate: 2025-01-15 02:49:23 +0000 isp: Fix abort issue introduced by previous commit Aborting ATIO while its CTIOs are in progress makes impossible to handle their completions, making them stuck forever. Detect this case by checking ctcnt counter and if so instead of aborting just mark the ATIO as dead to block any new CTIOs. It is not perfect since the task id can not be reused for some more time, but not as bad as the task stuck forever. MFC after: 1 week (cherry picked from commit 2c48a8f161c91bf7020122697d064a25287097a3) --- sys/dev/isp/isp_freebsd.c | 19 +++++++++++++++++-- sys/dev/isp/isp_freebsd.h | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index d5aa7a54142e..b496eae1b466 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -986,6 +986,16 @@ isp_target_start_ctio(ispsoftc_t *isp, union ccb *ccb, enum Start_Ctio_How how) continue; } + /* + * Is this command a dead duck? + */ + if (atp->dead) { + isp_prt(isp, ISP_LOGERR, "%s: [0x%x] not sending a CTIO for a dead command", __func__, cso->tag_id); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + continue; + } + /* * Check to make sure we're still in target mode. */ @@ -2503,14 +2513,19 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } /* - * Target should abort all affected CCBs before ACK-ing INOT, + * Target should abort all affected tasks before ACK-ing INOT, * but if/since it doesn't, add this hack to allow tag reuse. + * We can not do it if some CTIOs are in progress, or we won't + * handle the completions. In such case just block new ones. */ uint32_t rsp = (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0; if (ntp->nt.nt_ncode == NT_ABORT_TASK && (rsp & 0xff) == 0 && (atp = isp_find_atpd(isp, XS_CHANNEL(ccb), ccb->cna2.seq_id)) != NULL) { - if (isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) + if (atp->ctcnt == 0 && + isp_abort_atpd(isp, XS_CHANNEL(ccb), atp) == 0) isp_put_atpd(isp, XS_CHANNEL(ccb), atp); + else + atp->dead = 1; } if (isp_handle_platform_target_notify_ack(isp, &ntp->nt, rsp)) { diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 5bb3dd43b6de..73390fa14769 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -104,8 +104,9 @@ typedef struct atio_private_data { uint16_t ctcnt; /* number of CTIOs currently active */ uint8_t seqno; /* CTIO sequence number */ uint8_t cdb0; - uint8_t srr_notify_rcvd : 1, + uint16_t srr_notify_rcvd : 1, sendst : 1, + dead : 1, tattr : 3, state : 3; void * ests; From nobody Wed Jan 15 02:54:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXrFC5V5yz5knSG; Wed, 15 Jan 2025 02:54:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXrFC3JsTz3jgc; Wed, 15 Jan 2025 02:54:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRTcE+K3VamXbfoDApelp0zztcORh9/EXsk7/Gi5eQE=; b=M3B4FtTcpK5md65ZFejEO4qGp2w+IYTjNe/ldbjVqSimRtM03gllv2BrBmoHw6xGgdRTya 3nZedorY0iLW3WHEIJ8qUZLSIPrvs1dnvNpsELtgy+k8qteAZ8TqHDmZLRncCBdLUt+PE3 iUeq2818vmUhnuxH86MkI/gkuMRDp8A4AfHNNGJqzhJyCy8uuyqbxd7q8Pb2wymC+y1mr5 SKFSotix/3n1+7cZ6dTwaUbtxpBWkJAlPOOuP0TLcgDhwn/DUSvLHpaSco8mlvt2XdKQl3 FCrS9+4Vm3jIh9KwrlxH9+4ezpR+TfP8EmwN1mytrEUsQzqL5q2m889fKqigDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736909679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jRTcE+K3VamXbfoDApelp0zztcORh9/EXsk7/Gi5eQE=; b=bUiKnVSnhseZz1g9VfFX4Ql2aIHsQuO0wffxpm+liCRZgHElcj8nTQXaErRZlzpsHpnKjd jOcHsT41X8/ez1vpv7N3Pz96/LFCmQ9M9zMuHjOwkRRiqRf/DUmaj9+pFtNnVLzcReGlRM IWSA3+22WmztehI0y2ZRZJJcs5RoP8bC13yMn+gYEEIlAVgby3X6AkmQBLM+Fc5LNwTLEs Z2n7IV32nnoehIEL2ySY3L9YylELoZ1z+c70S14Kpd/obItF7OQd3xRMl8YnogJzZ+AycO f/gX2I3wyLTsVRgyw+DOJyzEAgeuBzPPDVyD1Rh62173TKgQiIb9qNWGw+KkAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736909679; a=rsa-sha256; cv=none; b=ZrtpidVVRZDnzu3a2FOVCcOiP5mit60klH9H43IvE0eZHjFMAERnY5f/1MsxmnEq5uQfad t7x2b9sHw1NFBykZ1rLIUI2yMvcLNZ3edvq3makCdRhTpAMwMZgKpvfSfKO4UehCT8wc9c xHcHBGJ0PW8josnMgzrmAxW8N2YIABxFvWhFB/+y/7etibya7o6rBOyUsVYCd81FnszrWO Ohnb/GCG8k07R9wsbe8jbKJXr3c+VrUCwiANwVdIxy3QG3Ru7EVJCJCRL9Z8pDZ9glV8KZ lJRr+9yapq3HQU1eSkM2l5XjkEE/le+ZVsuBxzzFvlI5Iigq4U4qML2i4uKhNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXrFC2n96zCVh; Wed, 15 Jan 2025 02:54: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 50F2sdYw084188; Wed, 15 Jan 2025 02:54:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F2sdsn084185; Wed, 15 Jan 2025 02:54:39 GMT (envelope-from git) Date: Wed, 15 Jan 2025 02:54:39 GMT Message-Id: <202501150254.50F2sdsn084185@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 316aa4de2c4f - main - mfc-candidates: Retire shell wrapper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 316aa4de2c4f8e3ecba987ce038af0c484821be3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=316aa4de2c4f8e3ecba987ce038af0c484821be3 commit 316aa4de2c4f8e3ecba987ce038af0c484821be3 Author: Ed Maste AuthorDate: 2025-01-15 02:53:50 +0000 Commit: Ed Maste CommitDate: 2025-01-15 02:54:12 +0000 mfc-candidates: Retire shell wrapper In commit 48f3fcabea80 I replaced the shell implementation of mfc-candidates with one in Lua, but left the .sh as a wrapper in case users had an alias or script that called it. Enough time has now passed that we can remove the wrapper. Sponsored by: The FreeBSD Foundation --- tools/tools/git/mfc-candidates.sh | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh deleted file mode 100644 index 53fad909c91f..000000000000 --- a/tools/tools/git/mfc-candidates.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -#- -# SPDX-License-Identifier: BSD-2-Clause -# -# Copyright 2022 The FreeBSD Foundation -# -# This software was developed by Ed Maste -# under sponsorship from the FreeBSD Foundation. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted providing that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -# Backwards compatibility wrapper -/usr/libexec/flua $(dirname $0)/mfc-candidates.lua "$@" From nobody Wed Jan 15 04:34:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXtRy0zJrz5ktM0; Wed, 15 Jan 2025 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXtRy0PVlz3qZt; Wed, 15 Jan 2025 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736915646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oe3FJrslK1SIs2LMevWM609QT6pTlsIB3gO4Uh/yXFE=; b=dpUx0vHd+Gh4K03qVXVt2gEke5qm6mBcLcHnIug5lFulyUx8amgtSzVIzuk2RVk5f7GrhM QQfPlS9prSDd3/ucFCfApFmsiLyDzaE86nTmCN1FZ/2GwL1rZ65yojcZbr2AL1dTgQSd8/ XI+GRj0mys0NEw7lufC0oWX60aInxjwZVHelXCumlsmXpMS+hgDM1VDSdEKqj0ow3ihICp oDXzrKJPf+Xt4cqm8TXrkDlLgNHoERYPuus5nJ/iv647lJbr7DD5/5m3k+5IFjd79XnLrP 2WpWhg7wM16sNP6sYgOLNDHksN2p9z4z2coU4Yh3cf9fm3HFivmWDTvq3KnVEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736915646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oe3FJrslK1SIs2LMevWM609QT6pTlsIB3gO4Uh/yXFE=; b=LTGRP/c6+DEFwNFfLaJL9zJIjpP0SS3h7jZZ3yJ0kaM4QmMHHu3HIdPWsXhgOfbQbsGpQZ yF21D6FeGOeWftO/E8PbLai5ynoYJK2bzkQMjp9l/3n81XNIWuEfdrLsShO62k3X2z4LM/ gxVtx3zeKtUzJPRYgkqDlPwRSdxcNCzCfQTAUmgTLCPpX7s6IGPnb66LPMAKiBAf3X7CTy 77JAnAo8tW34F5BzZ0Qw/MX01u4nQ3l514vGKptQDbiodfP/jm9Ul1rojRm+J1icKRSLuZ j27+Tr3iGggug2/H4FllY0UiByPh/Znff8qgUHbZbFL0Ry3oBWjoJEoiAfo7qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736915646; a=rsa-sha256; cv=none; b=FvKhedz2hC0rJBDdmbmusc+x10YDINHWwEMSf4GWR3kiuNy3UmSbeW9UFfJLP9+8axnorA Sfekf/dhCz//zWP7e/12NpB2gRue5c/te3yh7fd0C3gmmt8bPLeaGTHYLmsmwbo4x7EhyL 2UP6BUtUBOjt5vry0CDLz9uCqZYxrTewn3YWaFvufXQ1jGeK4XTXCt47b2khQp7hG5HFF1 Zr5Jvr+/2skiuLCFw+DNwf0AtwOU0phXM+kcFcOYf9lb0ETUBkYpkVD7/zWkSvIsH4udPc LCeQXhRXYrEJgObYBtFCqbScEvmBC8b/aCRoG+s163PsaHa1PGGS1ZKqGM3zVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXtRx75W5zVbK; Wed, 15 Jan 2025 04:34: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 50F4Y5o9073148; Wed, 15 Jan 2025 04:34:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F4Y5VY073145; Wed, 15 Jan 2025 04:34:05 GMT (envelope-from git) Date: Wed, 15 Jan 2025 04:34:05 GMT Message-Id: <202501150434.50F4Y5VY073145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 7befd68335a0 - main - pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7befd68335a0b34405b6293f30cc47cabc46ab06 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7befd68335a0b34405b6293f30cc47cabc46ab06 commit 7befd68335a0b34405b6293f30cc47cabc46ab06 Author: Zhenlei Huang AuthorDate: 2025-01-15 04:32:31 +0000 Commit: Zhenlei Huang CommitDate: 2025-01-15 04:32:31 +0000 pvscsi: Explicitly mask out CTS_SAS_VALID_SPEED bit This driver prefers connection speed over sas port speed. On stable/13 branch the stack-allocated CCB is not cleared thus the cam layer may report weird speed on boot. ``` da0: Fixed Direct Access SPC-4 SCSI device da0: 4294967.295MB/s transfers ``` -current and stable/14 have the change [1] which clears stack-allocated CCB thus are not affected, but I want -current and stable/14 to have this fix in to reduce drift between branches. 1. ec5325dbca62 cam: make sure to clear even more CCBs allocated on the stack Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48438 --- sys/dev/vmware/pvscsi/pvscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/vmware/pvscsi/pvscsi.c b/sys/dev/vmware/pvscsi/pvscsi.c index 111330e4f17f..08bdb8c3f108 100644 --- a/sys/dev/vmware/pvscsi/pvscsi.c +++ b/sys/dev/vmware/pvscsi/pvscsi.c @@ -1444,6 +1444,10 @@ finish_ccb: cts->proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB; cts->proto_specific.scsi.valid = CTS_SCSI_VALID_TQ; + /* Prefer connection speed over sas port speed */ + cts->xport_specific.sas.valid &= ~CTS_SAS_VALID_SPEED; + cts->xport_specific.sas.bitrate = 0; + ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); } break; From nobody Wed Jan 15 08:21:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXzVK4Wnkz5l66t; Wed, 15 Jan 2025 08:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXzVK3nsZz47Np; Wed, 15 Jan 2025 08:21:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736929289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=023GpNoTSlmHXDDXOQWvrXqvoOZE3RT9blHo6SlFqkM=; b=rcY7hsbr/lB6uTWVtY7nHR02MClPW/LEmxViB/tzgr3mX6ya5LbPak+CJstbjaN904sbX4 56Z0dhauHFdlpouFs0EzBuxLHo12k4bj8iruxZ3gUGEErv62DuRx5yLM2V1eHhGAGpWbsN KZENJWFbDcXqcvOUrFDr4igRL2EBnaX+if08BxJRf03QytcXeOnHX7K1xYLZCOhelRhnK+ T+BVG/bFzU0NXN142Er4PKZJOts+SY8cXLPy48QV3ehemmp0gtc5HOzGVpuKnMm+MXpTUX wx8559TUd23YOrYuw3tvHv/w9zz0gYBI8KIpowew4EA6YNG5fchyuKlKoxBAjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736929289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=023GpNoTSlmHXDDXOQWvrXqvoOZE3RT9blHo6SlFqkM=; b=I3HNigSkKISippl9q73NG1ZRvvjCQs6IrZ8zxadqa9vfsr1ZnaZxrTz7zgtpRiDEv8NTKW bFK8tnaz7NcSKShAzE8vazhRfMVdA7Y0ucJUmG9ddxe1XM5m7kxngfkURFZMqb8uz3cu0Q 89LeMbl2vTXeUqNTljfJU4AXRxMtnsy0RJpJy2seTKlLlVoAseKFNlZMmiKPZtE3PDdeqm f7Kf9MBYv6zFoYO6fWsV9YLEFsM9i8kH0ZxJDJs4Z9qeTsNhLUAQjmGscAmqz2X8j2dbyX ri/U4WhvjEzh2Fi+zy/1LkFsp7ZWa08dShtt/0bNdopJj/GrfV5/tiBghw1G9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736929289; a=rsa-sha256; cv=none; b=EldJkCKzBUOpJQ9wo4JhV8ivD59QUSthwuk/y+Z2GgiMqhPvy4qXW9qg8fur1WXaOf8fsk ytslEUKcqdgUWt+ciLDmIO63WbewxmwenbOHWMb31ijHkg4eam+LGkUWrH715sbCW1mUKN 8u8NM3MkanaENbT4HkRQ+hR5Ax422lSFa+4Tdhn1oK+UMUEOd8Ny7ejaeBcX1g9CLIXcht Dvocz+vgRpIrOj9virlq6lVkNuaEu4xfs1ZIM4Rl+CqvwM4kj4ec/XsM/h14iGJTnh7VZq l1Ime7JCfUSyWFOVr7y9Ol2NbL4diJRvHYOCpg29NXJ6brLgqldD6x8VTAbISw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXzVK3Nm6zdsG; Wed, 15 Jan 2025 08:21: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 50F8LT8L096332; Wed, 15 Jan 2025 08:21:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F8LTBR096329; Wed, 15 Jan 2025 08:21:29 GMT (envelope-from git) Date: Wed, 15 Jan 2025 08:21:29 GMT Message-Id: <202501150821.50F8LTBR096329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: eccf736c3ce6 - main - pkg: make sure the repositories have at least an url List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eccf736c3ce6e9566fa9923080b4c24ee7f9ae2a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=eccf736c3ce6e9566fa9923080b4c24ee7f9ae2a commit eccf736c3ce6e9566fa9923080b4c24ee7f9ae2a Author: Baptiste Daroussin AuthorDate: 2025-01-15 08:06:55 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 08:21:19 +0000 pkg: make sure the repositories have at least an url While here, factorize code to free the repository structure --- usr.sbin/pkg/config.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index fe1599f42c2c..3aaa7a7815e8 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -1,9 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2014 Baptiste Daroussin + * Copyright (c) 2014-2025 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -332,6 +331,16 @@ parse_mirror_type(struct repository *r, const char *mt) r->mirror_type = MIRROR_NONE; } +static void +repo_free(struct repository *r) +{ + free(r->name); + free(r->url); + free(r->fingerprints); + free(r->pubkey); + free(r); +} + static bool parse_signature_type(struct repository *repo, const char *st) { @@ -344,11 +353,7 @@ parse_signature_type(struct repository *repo, const char *st) else { warnx("Signature type %s is not supported for bootstrapping," " ignoring repository %s", st, repo->name); - free(repo->url); - free(repo->name); - free(repo->fingerprints); - free(repo->pubkey); - free(repo); + repo_free(repo); return false; } return (true); @@ -392,13 +397,16 @@ parse_repo(const ucl_object_t *o) } else if (strcasecmp(key, "enabled") == 0) { if ((cur->type != UCL_BOOLEAN) || !ucl_object_toboolean(cur)) { - free(repo->url); - free(repo->name); - free(repo); + repo_free(repo); return; } } } + /* At least we need an url */ + if (repo->url == NULL) { + repo_free(repo); + return; + } STAILQ_INSERT_TAIL(&repositories, repo, next); return; } From nobody Wed Jan 15 08:21:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YXzVL6VJZz5l6N1; Wed, 15 Jan 2025 08:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YXzVL4kN9z47TV; Wed, 15 Jan 2025 08:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736929290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JoaWyjS+zvJRtZoK2f8Fmam2ZIYZsBJi2zeoXXDir/s=; b=DLSczWqFgW6L9+QarbvJznUa5J1LIASkeFt8T4HUDMZVMoExkieVrlN51aq+vPnaBpNXxz r2B5XEMIgjoaZPkHX4wuH3esy7YJs4u+3dVKXmA9zXw0QBkAMjvjaQ5WM8S6axpDvBEh7q OmWEQF53+uaeSwyYpm8pL+A6ahGsToJxY5h47AAbtijFXFnpXL96KpRQT4HKtIg5fI0e5u v443JnTBkbDn2gEdJ6Mz+27ehqsDOSnIyIx3C3RgsviCYMgtdvaUBK8px+k0OLu3DoVshN TflGZWtkHzCI9i8wbY/boGHavEEpeZqxVXwFepkVecXzEolOLjTS4tvTnHwmDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736929290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JoaWyjS+zvJRtZoK2f8Fmam2ZIYZsBJi2zeoXXDir/s=; b=UO1bUXe2Kw7aN4tuXYYfPr5lyrAsuh3toj65r2S8FTzk7TNO7QmYooFA+H6Ut3WdhY/WC5 iCoUVb+U1TyZ8cW9jO45GAvz8kiEzt1xz2E343sqWUZryGBbnI66BpjZme+Y8ElTvAFHhQ 10w8BWUkOUYt6UYORiwxVJ/c4HCgrF/YWgUgcIgsE1+R/aMh003f1wTt7yui0HoaUqfw7c 1MdiclUIFWw9XxWXLB90buXKMlVOHBlu6oZPPVwy0O/gmrHti2VtZy4p0+eY5rYWTnz8b3 l807LE/afsZCQDVsuAG88gmXwvUTTTYQ/aMgkH/gsPRhjFovbKtPRxGFv2jBmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736929290; a=rsa-sha256; cv=none; b=hf4E9QJ7lmZnPpa5SLHJyA/eGox1iSJQso6RYS9emimY+4pX6vPhff27+jj5/L3OFjlw7D dWWZjnTb/bIfW7IjfQWSmFewgSosxsnXk3RlcYk8Fw8IkE2E4s8MBMAydAzD5VQv1N94rv imfitG6KDBVdIkhbp8b4d5vvDPs8WjuUxriwHxzUglqFJJqd2wYlZ3q9+BawXW2gW4STcm x2vgInHuB963Gj9K7+B4Ci5iZEqQ6sCU+POcdhqHotWclYsqPzPwmiAcUeuBRehgDfqSX6 GwFETAyGD199cd6SArKN4KYIBJB2q5sJ5aG3vS0+mvVWU9LLSx4Eem6mBFXXgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YXzVL4BJHzdk8; Wed, 15 Jan 2025 08:21: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 50F8LU9B096692; Wed, 15 Jan 2025 08:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F8LU4B096678; Wed, 15 Jan 2025 08:21:30 GMT (envelope-from git) Date: Wed, 15 Jan 2025 08:21:30 GMT Message-Id: <202501150821.50F8LU4B096678@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 5c341fe5123d - main - pkg(7): support configuration overwrite like pkg(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c341fe5123d4aa6961066542de63dd4431d004d Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5c341fe5123d4aa6961066542de63dd4431d004d commit 5c341fe5123d4aa6961066542de63dd4431d004d Author: Baptiste Daroussin AuthorDate: 2025-01-15 08:18:46 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 08:21:19 +0000 pkg(7): support configuration overwrite like pkg(8) with pkg(8) it is possible to overwrite a configuration like adding FreeBSD { enabled: false } in /usr/local/etc/pkg/repo/overwrite.conf which allows to change any value which can have been reviously configured in anything in /etc/pkg/*.conf now the bootstrap supports the same MFC After: 3 weeks --- usr.sbin/pkg/config.c | 55 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 3aaa7a7815e8..2ad6c8a93756 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -353,51 +353,79 @@ parse_signature_type(struct repository *repo, const char *st) else { warnx("Signature type %s is not supported for bootstrapping," " ignoring repository %s", st, repo->name); - repo_free(repo); - return false; + return (false); } return (true); } +static struct repository * +find_repository(const char *name) +{ + struct repository *repo; + STAILQ_FOREACH(repo, &repositories, next) { + if (strcmp(repo->name, name) == 0) + return (repo); + } + return (NULL); +} + static void parse_repo(const ucl_object_t *o) { const ucl_object_t *cur; - const char *key; + const char *key, *reponame; ucl_object_iter_t it = NULL; + bool newrepo = false; + struct repository *repo; + + reponame = ucl_object_key(o); + repo = find_repository(reponame); + if (repo == NULL) { + repo = calloc(1, sizeof(struct repository)); + if (repo == NULL) + err(EXIT_FAILURE, "calloc"); - struct repository *repo = calloc(1, sizeof(struct repository)); - if (repo == NULL) - err(EXIT_FAILURE, "calloc"); - - repo->name = strdup(ucl_object_key(o)); - if (repo->name == NULL) - err(EXIT_FAILURE, "strdup"); + repo->name = strdup(reponame); + if (repo->name == NULL) + err(EXIT_FAILURE, "strdup"); + newrepo = true; + } while ((cur = ucl_iterate_object(o, &it, true))) { key = ucl_object_key(cur); if (key == NULL) continue; if (strcasecmp(key, "url") == 0) { + free(repo->url); repo->url = strdup(ucl_object_tostring(cur)); if (repo->url == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "mirror_type") == 0) { parse_mirror_type(repo, ucl_object_tostring(cur)); } else if (strcasecmp(key, "signature_type") == 0) { - if (!parse_signature_type(repo, ucl_object_tostring(cur))) + if (!parse_signature_type(repo, ucl_object_tostring(cur))) { + if (newrepo) + repo_free(repo); + else + STAILQ_REMOVE(&repositories, repo, repository, next); return; + } } else if (strcasecmp(key, "fingerprints") == 0) { + free(repo->fingerprints); repo->fingerprints = strdup(ucl_object_tostring(cur)); if (repo->fingerprints == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "pubkey") == 0) { + free(repo->pubkey); repo->pubkey = strdup(ucl_object_tostring(cur)); if (repo->pubkey == NULL) err(EXIT_FAILURE, "strdup"); } else if (strcasecmp(key, "enabled") == 0) { if ((cur->type != UCL_BOOLEAN) || !ucl_object_toboolean(cur)) { - repo_free(repo); + if (newrepo) + repo_free(repo); + else + STAILQ_REMOVE(&repositories, repo, repository, next); return; } } @@ -407,7 +435,8 @@ parse_repo(const ucl_object_t *o) repo_free(repo); return; } - STAILQ_INSERT_TAIL(&repositories, repo, next); + if (newrepo) + STAILQ_INSERT_TAIL(&repositories, repo, next); return; } From nobody Wed Jan 15 09:51:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY1VG3tntz5lC6D; Wed, 15 Jan 2025 09:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY1VG3Pgqz3H3g; Wed, 15 Jan 2025 09:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4EzwbhAPrBwXeM2q1gtK2+TJDiDAcu9jtvSyH/WPm1o=; b=IZ+v2rUr4tHysKJHH9kD/ZeH3N559Ho1ln8hF2JmmMYCkaoNhK2OUvuey3Ua/NSimuE27A ZrH0ylKPXw0+aFqoRl+NkTQwSTULPG0CFchjT5ZYiRWtjhP9O86gzRhwDt0KoMTh8vH72G uIpbU+A04ynV5U18kkv8TdC8p1L09z4nwOG6xkD0zGurDqX3MF/fv2RWcjH8F4eMGlfHhh ujnoqeEeFu+WzxS88t8qyrVjqxJUcE81vzn5D8WEQBn8GkaS3mQeEWQLutbNZCOzgnClBF v6n0ur6ozUiyIT9IcdyJNKkMkskDHmkQJdWgjyxWYPlOZ6RW5gHdFHSoYUICzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4EzwbhAPrBwXeM2q1gtK2+TJDiDAcu9jtvSyH/WPm1o=; b=tMR9k/NvoPOEjdLfdhwruo3id2b+X+fEWmhfKfh2shqjxBqUSurIR8HU8jnNZqUKnVCkQf NF9D7CoiUo/G02F0h6PMGsEbxRlJJ3JNB5um+0VrhvhdyhnBG9qRC010JywWLI+d+vyx5v kaaBO7WGaJUUD8RTBrM31spbdDt1VtseeH1330uqJt0s0evegTzxcGkZyp3f5R1Lqcgewx lildCpmdj+wqXI3+on7wlKcr96hTlkzrNC6AvOlpf+NfCK4vHoFqV2lcKPW1gVCWBriKTV wzQBYQ0vNVBuoSbaUGofERhNpvuKkXO9ENsYGKbMfZmqSSkqR5fZo3AXYstKXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736934694; a=rsa-sha256; cv=none; b=f5NxbOAPuAcGU07uJb1ODK/i2nyP/y3Q6m1imW6PvSGarOz0ebpZO4RUYioZeeGTa+eZv0 i4blpgZdYucEuJKhUr9TiNU8gRsjsSJONHfbB11hz5skYrdPp5NNrpAYo9chdlYJG6oxKg Wlau78uXU+NUCHfDFhCFjZpzHDp54hhxuKtjy5+j1yuFwZWRPmH7mCuz3wG0qdNZ+EIVVK 3znZLhnjAXv9MBtuI/yKNlwm/MiVvhiLTWjmRkGRfX90XGV04GM7VQA/5B0McF5s9Fcrz2 1KbJ3crTlvo68cig5AHrSG3W7/xqDBv3GhFuu8d86KF5bVKcTl306uxWWhvmcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY1VG2zdqzhlf; Wed, 15 Jan 2025 09:51: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 50F9pY5k065424; Wed, 15 Jan 2025 09:51:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F9pYFr065421; Wed, 15 Jan 2025 09:51:34 GMT (envelope-from git) Date: Wed, 15 Jan 2025 09:51:34 GMT Message-Id: <202501150951.50F9pYFr065421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 707a34afe16b - stable/14 - nuageinit: remove redundant mkdirs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 707a34afe16bffa0f9ab1ae936faa5c3ee7f47c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=707a34afe16bffa0f9ab1ae936faa5c3ee7f47c4 commit 707a34afe16bffa0f9ab1ae936faa5c3ee7f47c4 Author: Baptiste Daroussin AuthorDate: 2024-11-27 09:03:06 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 09:51:27 +0000 nuageinit: remove redundant mkdirs (cherry picked from commit f3b371f4d938c09c4cdc8fd95b4b52e1d8dd41dd) --- libexec/nuageinit/nuageinit | 2 -- 1 file changed, 2 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 5249c09eb5f1..88e8b6c4c2cd 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -95,7 +95,6 @@ local function config2_network(p) mylinks[v["id"]] = ifaces[s] end - nuage.mkdir_p(root .. "/etc/rc.conf.d") local network = open_config("network") local routing = open_config("routing") local ipv6 = {} @@ -308,7 +307,6 @@ if line == "#cloud-config" then end if obj.network then local ifaces = get_ifaces() - nuage.mkdir_p(root .. "/etc/rc.conf.d") local network = open_config("network") local routing = open_config("routing") local ipv6 = {} From nobody Wed Jan 15 09:53:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY1Xv18yLz5lBrK; Wed, 15 Jan 2025 09:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY1Xv0JlKz3HSd; Wed, 15 Jan 2025 09:53:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gsZoi9o4ep2UJUPkHrP4FlRcSTvoq/KDfmxvyTUp0aw=; b=qAEtKX1bxx+iFn+Hy1dMsCBPfMZWkpFJspaFsvn5TuOkgrsyHtWEBbmbGLZdJg7zd92kb6 N8JQvZQLr9JYdI3IL8Y2s7WC93KoJUzswydZfidGoPiiviytVLnGaM04iKFFrHU/c5GLY2 JvfxPGSm11A6L8oO5n/MKO5KAKcG8yK4oh9tx8xgH2KgKVScoLX861cbKUf67aOYuJ49fG /rxPhgXwj1l6glY+3K5bb80vXqgA0ir4tB137kDi9TfPC8ETJiW3QHe/sr86cXXkPy8jgz dZXkqyDtfq7rkZIHApbK01FQb+bieUgikGOmmx7SEpPvIdO/meU0AQD+RtD70A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gsZoi9o4ep2UJUPkHrP4FlRcSTvoq/KDfmxvyTUp0aw=; b=t85aZSuPmAXFg2JdROr5nq0MjiUCXJbyj8dJZCQpSQu1ctZ9gOtbi7ip3rGNo9iVB4a8QS UdvPv2T83QrNBBS+GfsSenmeR3j4uKhZw9KhF8wDePpMqq4b3MaBaLfDNUfXvRhPCDeYOP LetJsJe7IoC0QiqFqrdOmn6L0v7775q3JnbNrd3k5d9Z29dLiicFr0VdCAvmuurdEoQwzW FexngD7xe9J9C1jgvLgTIIg1louW+jSBfI0HtPLBbp9zWRQs1vxC5YYquHRdWZv/uTA5LK GoA3RpChkmdcRe1Elsg32oyeW9GPQAhOzyWP0Vpv3wZikBZEEGaLBNZdXMmn5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736934831; a=rsa-sha256; cv=none; b=vcfFKByUGYNqkzyEAl2irvhtSuumnOlR3eBi6F/YfpYBBUmdjy05YB2YAUQ8RdfHl1kj+u Y5EbRxgh0phhpb7hZtlJjI1Ol+7t1Pt0WZOLjHDfFPm4MPuAaFmwLp6Vt5bPV9YW5cQEBs qB4x9x8GXRIdmtnR0LSdLtjdHCnrDa5yd9RH7ti3qhwylYoQ3HX7znLHspIgR8a3h3+Jpd j/YrCX+itZDVzD3cndTwgcs5KadxXew50BWXgBkbVYQi84T2sZd1lVQIqXnisuFxrym163 v624+C1bwIV0TAhTrG7vwOfoFB28zMbMotBbCL3v5AzpcclwQKQXRmO8ZeRSmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY1Xt6mR1zhq8; Wed, 15 Jan 2025 09:53: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 50F9ro3A070724; Wed, 15 Jan 2025 09:53:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F9roQc070721; Wed, 15 Jan 2025 09:53:50 GMT (envelope-from git) Date: Wed, 15 Jan 2025 09:53:50 GMT Message-Id: <202501150953.50F9roQc070721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 68f025feeb11 - stable/14 - nuageinit: use io.popen instead of pipes in shell for password List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 68f025feeb11e05382e9a9feb5105b23ffe7c30c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=68f025feeb11e05382e9a9feb5105b23ffe7c30c commit 68f025feeb11e05382e9a9feb5105b23ffe7c30c Author: Baptiste Daroussin AuthorDate: 2024-11-20 09:39:50 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 09:53:39 +0000 nuageinit: use io.popen instead of pipes in shell for password using echo in a sh(1) command line, requires many escaping to be done right, using io.popen we don't need to do this escaping anymore. (cherry picked from commit 3e502866073f8d922eecb9016920a56b90c35e38) --- libexec/nuageinit/nuage.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 4e21405a443b..978de02a63fc 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -119,11 +119,12 @@ local function adduser(pwd) end local precmd = "" local postcmd = "" + local input = nil if pwd.passwd then - precmd = "echo '" .. pwd.passwd .. "' | " + input = pwd.passwd postcmd = " -H 0" elseif pwd.plain_text_passwd then - precmd = "echo '" .. pwd.plain_text_passwd .. "' | " + input = pwd.plain_text_passwd postcmd = " -h 0" end cmd = precmd .. "pw " @@ -134,7 +135,11 @@ local function adduser(pwd) cmd = cmd .. extraargs .. " -c '" .. pwd.gecos cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s " .. pwd.shell .. postcmd - local r = os.execute(cmd) + local f = io.popen(cmd, "w") + if input then + f:write(input) + end + local r = f:close(cmd) if not r then warnmsg("fail to add user " .. pwd.name) warnmsg(cmd) From nobody Wed Jan 15 09:55:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY1ZM5PXlz5lBrV; Wed, 15 Jan 2025 09:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY1ZM4hvFz3Hlc; Wed, 15 Jan 2025 09:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7u2kXTHsmvorHbH8lPBGyQ6JM1U2zITdK/kOeNNsdiU=; b=RwNA/C7cyQ707ye9DrBivpV8TWyWArghf7EzQRL7TcyS/sfR1iAB3sye4GwPhFs9Wy5d28 XTC13Y+v4iTfuWgLyW3gm1GLSQ++6czZwZSD17ypOLMFHl1UYR/cqpbpjA0m8ECGFDkxhk FScEXR0s47VrSdXkklF8Zc2lcNwRmh698r64t1NJy0RBPkCal/zHF1v+EkWX63MMG3j3RM /gX/pM77vU2mTwU7b8IgwgW3jKUsQtfHwYD1Bpl0MH8Zi+pcE8u192seJwE6AiauNSvikw yASNrP/Gh34P6/Fivjr8oGKpI82OcnRDA3iJO5lWoRlKiTFzOJm91w0fwFbAnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7u2kXTHsmvorHbH8lPBGyQ6JM1U2zITdK/kOeNNsdiU=; b=c8bHz9IYS/IJRcMZ03vRxyc+5gWszMrI5gXEm+gZVMz3nYgJVaq/U+uBl2AvJyXpAmfL0m O0v41VmfJuznzxuLbOngy+UoncjtyMxDLaD+3os4MRlF14qjV9hw+4Ztw/DClc6dy6vTkk cFzgnm//yjZrBWX2fxJ9WvVqMODcoWNzC4uwGncvePWbgzkEjdKQr3GAkLvOaY/cE4afI9 MNUxRHILaRaMZBXJklnhA0C+PRuzveDHlHkfaI3RneyyPKleZS4R8ZrBdljtB70yizCi8S q0To+dRBKs3PEPKqJ2tPJj7jstGpL5vVi6/WCoOGaUf54MQ/Y79PElf9gJqJOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736934907; a=rsa-sha256; cv=none; b=jV4Q1tMSVZgFAs/NOTPpEeIUy9GSUPkvdJI9e7w0uJvzpXN8CIfIzYbpzi8l2C4AhxcmGU 5NOTPpSIQP2DirddxRJRVxaTCnKXEFKlBZFaA8B/EpwT6kWhalLxao6bJU2dmyv/7PKEzs CiTc6f5esuUtvuGjb27vpA89nUAjkngxsdAeiFQdwXml/nAJRzL5cI9pzMMK7gdJ4JLZs6 AIc2nYX4kixigT45EXVfbv0EOHzWD+K+Vj4d4+PTvaCxGOSrS+I9RuXviQOkoDb+PEq0a+ 0TSeBL0VdDTYTtpash2Nw6ulQf8HNVcZDRsni9gtiBeOpoIae1ol7/VKYEs9hQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY1ZM448Czhlw; Wed, 15 Jan 2025 09:55:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50F9t7MV071243; Wed, 15 Jan 2025 09:55:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F9t7s2071240; Wed, 15 Jan 2025 09:55:07 GMT (envelope-from git) Date: Wed, 15 Jan 2025 09:55:07 GMT Message-Id: <202501150955.50F9t7s2071240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 88f55c3150e9 - stable/14 - nvi: import version 2.2.1-52c07e8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88f55c3150e94285197623b6d9608f966e7efa12 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=88f55c3150e94285197623b6d9608f966e7efa12 commit 88f55c3150e94285197623b6d9608f966e7efa12 Author: Baptiste Daroussin AuthorDate: 2025-01-02 08:56:55 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 09:55:01 +0000 nvi: import version 2.2.1-52c07e8 (cherry picked from commit 4087ffdbce725367566bc3fc60a959292daac99d) --- contrib/nvi/CMakeLists.txt | 1 - contrib/nvi/common/common.h | 1 + contrib/nvi/common/log.c | 1 - contrib/nvi/common/options.c | 4 +++- contrib/nvi/man/vi.1 | 51 ++++++++++++++++++++++++-------------------- contrib/nvi/vi/vs_refresh.c | 15 +++++++++---- usr.bin/vi/options_def.h | 51 ++++++++++++++++++++++---------------------- 7 files changed, 69 insertions(+), 55 deletions(-) diff --git a/contrib/nvi/CMakeLists.txt b/contrib/nvi/CMakeLists.txt index 0c935b3c2a19..9451eaa89799 100644 --- a/contrib/nvi/CMakeLists.txt +++ b/contrib/nvi/CMakeLists.txt @@ -37,7 +37,6 @@ if (NOT APPLE) endif() add_compile_options($<$:-Wuninitialized>) add_compile_options($<$:-Wno-dangling-else>) -add_compile_options(-Wno-string-compare) add_compile_options(-Wstack-protector -fstack-protector) add_compile_options(-Wstrict-aliasing -fstrict-aliasing) diff --git a/contrib/nvi/common/common.h b/contrib/nvi/common/common.h index 45f22fb49d1b..fd97a4655cf5 100644 --- a/contrib/nvi/common/common.h +++ b/contrib/nvi/common/common.h @@ -17,6 +17,7 @@ #include #endif #include /* May refer to the bundled regex. */ +#include /* * Forward structure declarations. Not pretty, but the include files diff --git a/contrib/nvi/common/log.c b/contrib/nvi/common/log.c index d1a1bc6f704a..7aad94d7e74a 100644 --- a/contrib/nvi/common/log.c +++ b/contrib/nvi/common/log.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/contrib/nvi/common/options.c b/contrib/nvi/common/options.c index c3d1f7343f9a..87d5c5a88521 100644 --- a/contrib/nvi/common/options.c +++ b/contrib/nvi/common/options.c @@ -181,6 +181,8 @@ OPTLIST const optlist[] = { {L("shellmeta"), NULL, OPT_STR, 0}, /* O_SHIFTWIDTH 4BSD */ {L("shiftwidth"), NULL, OPT_NUM, OPT_NOZERO}, +/* O_SHOWFILENAME */ + {L("showfilename"), NULL, OPT_0BOOL, 0}, /* O_SHOWMATCH 4BSD */ {L("showmatch"), NULL, OPT_0BOOL, 0}, /* O_SHOWMODE 4.4BSD */ @@ -317,7 +319,7 @@ opts_init(SCR *sp, int *oargs) /* Set numeric and string default values. */ #define OI(indx, str) do { \ a.len = STRLEN(str); \ - if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ + if (STRCMP((CHAR_T*)str, b2) != 0) \ (void)MEMCPY(b2, str, a.len+1); \ if (opts_set(sp, argv, NULL)) { \ optindx = indx; \ diff --git a/contrib/nvi/man/vi.1 b/contrib/nvi/man/vi.1 index f1893040ceb7..596657319eee 100644 --- a/contrib/nvi/man/vi.1 +++ b/contrib/nvi/man/vi.1 @@ -12,11 +12,13 @@ .\" that you would have purchased it, or if any company wishes to .\" redistribute it, contributions to the authors would be appreciated. .\" -.Dd September 25, 2020 +.Dd April 18, 2024 .Dt VI 1 .Os .Sh NAME -.Nm ex , vi , view +.Nm ex , +.Nm vi , +.Nm view .Nd text editors .Sh SYNOPSIS .Nm ex @@ -302,7 +304,7 @@ Quit editing and leave (if you've modified the file, but not saved your changes, .Nm vi will refuse to quit). -.It Cm :q! +.It Cm :q\&! Quit, discarding any modifications that you may have made. .El .Pp @@ -706,7 +708,7 @@ Execute the .Nm ex command being entered, or cancel it if it is only partial. .Pp -.It Aq Cm control-] +.It Aq Cm control-\(rB Push a tag reference onto the tag stack. .Pp .It Aq Cm control-\(ha @@ -830,7 +832,7 @@ or to the position of the cursor before the last of the following commands: .Aq Cm control-A , .Aq Cm control-T , -.Aq Cm control-] , +.Aq Cm control-\(rB , .Cm % , .Cm \(aq , .Cm \` , @@ -1809,8 +1811,8 @@ Display buffers, Cscope connections, screens or tags. .Op Ar +cmd .Op Ar file .Xc -Edit a different file. The capitalized command opens a new screen below the -current screen. +Edit a different file. +The capitalized command opens a new screen below the current screen. .Pp .It Xo .Cm exu Ns Op Cm sage @@ -1833,8 +1835,8 @@ Display and optionally change the file name. .Xc .Nm vi mode only. -Foreground the specified screen. The capitalized command opens a new screen -below the current screen. +Foreground the specified screen. +The capitalized command opens a new screen below the current screen. .Pp .It Xo .Op Ar range @@ -1921,8 +1923,8 @@ Write the abbreviations, editor options and maps to the specified .Op Cm !\& .Op Ar .Xc -Edit the next file from the argument list. The capitalized command opens a -new screen below the current screen. +Edit the next file from the argument list. +The capitalized command opens a new screen below the current screen. .\" .Pp .\" .It Xo .\" .Op Ar line @@ -1943,8 +1945,8 @@ option. .Cm rev Ns Op Cm ious Ns .Op Cm !\& .Xc -Edit the previous file from the argument list. The capitalized command opens -a new screen below the current screen. +Edit the previous file from the argument list. +The capitalized command opens a new screen below the current screen. .Pp .It Xo .Op Ar range @@ -2107,8 +2109,8 @@ character is usually .Op Cm !\& .Ar tagstring .Xc -Edit the file containing the specified tag. The capitalized command opens a -new screen below the current screen. +Edit the file containing the specified tag. +The capitalized command opens a new screen below the current screen. .Pp .It Xo .Cm tagn Ns Op Cm ext Ns @@ -2178,8 +2180,8 @@ Enter .Op Ar file .Xc .Nm vi -mode only. Edit a different file by opening a new screen below the current -screen. +mode only. +Edit a different file by opening a new screen below the current screen. .Pp .It Xo .Cm viu Ns Op Cm sage @@ -2226,7 +2228,8 @@ Write the entire file, or .Sq !\& overwrites a different, preexisting file. .Sq >> -appends to a file that may preexist. Whitespace followed by +appends to a file that may preexist. +Whitespace followed by .Sq !\& pipes the file to .Ar shell-command . @@ -2479,7 +2482,7 @@ Set the number of lines about which the editor reports changes or yanks. .It Cm ruler Bq off .Nm vi only. -Display a row/column ruler on the colon command line. +Display a row/column/percentage ruler on the colon command line. .It Cm scroll , scr Bq "window size / 2" Set the number of lines scrolled. .It Cm searchincr Bq off @@ -2505,6 +2508,10 @@ Set the meta characters checked to determine if file name expansion is necessary. .It Cm shiftwidth , sw Bq 8 Set the autoindent and shift command indentation width. +.It Cm showfilename Bq off +.Nm vi +only. +Display the file name on the colon command line. .It Cm showmatch , sm Bq off .Nm vi only. @@ -2773,10 +2780,8 @@ and \*(Gt0 if an error occurs. .Xr ctags 1 , .Xr iconv 1 , .Xr re_format 7 -.Rs -.%T vi/ex reference manual -.%U https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf -.Re +.Pp +.Lk https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf "Vi/Ex Reference Manual" .Sh STANDARDS .Nm nex Ns / Ns Nm nvi is close to diff --git a/contrib/nvi/vi/vs_refresh.c b/contrib/nvi/vi/vs_refresh.c index b64ec7392cbb..406a89ad7d9d 100644 --- a/contrib/nvi/vi/vs_refresh.c +++ b/contrib/nvi/vi/vs_refresh.c @@ -774,7 +774,8 @@ vs_modeline(SCR *sp) size_t cols, curcol, curlen, endpoint, len, midpoint; const char *t = NULL; int ellipsis; - char buf[20]; + char buf[30]; + recno_t last; gp = sp->gp; @@ -795,7 +796,7 @@ vs_modeline(SCR *sp) /* If more than one screen in the display, show the file name. */ curlen = 0; - if (IS_SPLIT(sp)) { + if (IS_SPLIT(sp) || O_ISSET(sp, O_SHOWFILENAME)) { CHAR_T *wp, *p; size_t l; @@ -846,8 +847,14 @@ vs_modeline(SCR *sp) cols = sp->cols - 1; if (O_ISSET(sp, O_RULER)) { vs_column(sp, &curcol); - len = snprintf(buf, sizeof(buf), "%lu,%lu", - (u_long)sp->lno, (u_long)(curcol + 1)); + + if (db_last(sp, &last) || last == 0) + len = snprintf(buf, sizeof(buf), "%lu,%zu", + (u_long)sp->lno, curcol + 1); + else + len = snprintf(buf, sizeof(buf), "%lu,%zu %lu%%", + (u_long)sp->lno, curcol + 1, + (u_long)(sp->lno * 100) / last); midpoint = (cols - ((len + 1) / 2)) / 2; if (curlen < midpoint) { diff --git a/usr.bin/vi/options_def.h b/usr.bin/vi/options_def.h index cd6f5ba3eb26..15104845c380 100644 --- a/usr.bin/vi/options_def.h +++ b/usr.bin/vi/options_def.h @@ -58,28 +58,29 @@ #define O_SHELL 57 #define O_SHELLMETA 58 #define O_SHIFTWIDTH 59 -#define O_SHOWMATCH 60 -#define O_SHOWMODE 61 -#define O_SIDESCROLL 62 -#define O_SLOWOPEN 63 -#define O_SOURCEANY 64 -#define O_TABSTOP 65 -#define O_TAGLENGTH 66 -#define O_TAGS 67 -#define O_TERM 68 -#define O_TERSE 69 -#define O_TILDEOP 70 -#define O_TIMEOUT 71 -#define O_TTYWERASE 72 -#define O_VERBOSE 73 -#define O_W1200 74 -#define O_W300 75 -#define O_W9600 76 -#define O_WARN 77 -#define O_WINDOW 78 -#define O_WINDOWNAME 79 -#define O_WRAPLEN 80 -#define O_WRAPMARGIN 81 -#define O_WRAPSCAN 82 -#define O_WRITEANY 83 -#define O_OPTIONCOUNT 84 +#define O_SHOWFILENAME 60 +#define O_SHOWMATCH 61 +#define O_SHOWMODE 62 +#define O_SIDESCROLL 63 +#define O_SLOWOPEN 64 +#define O_SOURCEANY 65 +#define O_TABSTOP 66 +#define O_TAGLENGTH 67 +#define O_TAGS 68 +#define O_TERM 69 +#define O_TERSE 70 +#define O_TILDEOP 71 +#define O_TIMEOUT 72 +#define O_TTYWERASE 73 +#define O_VERBOSE 74 +#define O_W1200 75 +#define O_W300 76 +#define O_W9600 77 +#define O_WARN 78 +#define O_WINDOW 79 +#define O_WINDOWNAME 80 +#define O_WRAPLEN 81 +#define O_WRAPMARGIN 82 +#define O_WRAPSCAN 83 +#define O_WRITEANY 84 +#define O_OPTIONCOUNT 85 From nobody Wed Jan 15 09:55:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY1bG1yLqz5lBby; Wed, 15 Jan 2025 09:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY1bG1MVXz3Hs2; Wed, 15 Jan 2025 09:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yVW8ckYWt0ERJQTxA5xJSB5iFIjahs9E2I51ujLerAo=; b=HUr7/1HUv6stXs3I804SGbSDo5WExaW4NJOkegkB1XkbRZKNzPArhckiCQxhtODGVO+aRr fn9q/vtBYkDP0aoAcNC3qQB4koAJW+C07ll74+qVIr72RKYKNA9Hn6180B9Ll+3moOzEiC F3YQmXRH/MA0IkrcFvabk3T4xsbRNdMXwySo2h9gKGKHr30+Yok/9pWdc2twb7FTKFlgMa di/3Df2c42PZbguamZvoL+H2BTlp+iZfoiKjI4tdYvU1D3/ZFwwFg49UkhLcbWIReO73o1 Eibtlqnp+IwReYA7hGbwsBjzdYHiN11ck12cMvHcOpEAcy9i7fum9zmghtVLSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yVW8ckYWt0ERJQTxA5xJSB5iFIjahs9E2I51ujLerAo=; b=r2IRNNelWPVa09WdGphVes3/DBqYVv2JptsZjiqk88Dv8CFtjW+CDFxBcMV7aRORPDTG6R jwRV9OJueghFyP038p9iGEB9CsHGDdufJZLfidKS4XCXK35oe5SGUef0Ui9lPFji5AG3MH 0jfYhzi3YtvDi5Ppco77oga4tvhZnzawRLqs9XZmTgjxGv9Ym8vrjoKbOTPnloSZq75Oln iQ7kbDqwNe+Uzj75C8xuAvbf6d8hcIKZOwCnoBByuqhoEMbRyx6PYUw7EB/mkPBu+V7o+C uS07GFY1otE3zgjWu2T03+Hu2eaOwNdwLk3GeDxwjbS3FaFOVwCv3wO8uus36A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736934954; a=rsa-sha256; cv=none; b=cuaMtxaaUAYJnZoSH1GKUEDrcwsUnv/TASAItUQKzF4wEX1T2xxK/yelydR6uhNJh8tM7n fi9EJpJrzWz4in2T0Q9/nA4gpnKpAqMUIY4hmM2W6lVclLweDQlWJXbVEt93XYeVairrdr +XrTwK2m2fkTKab4sbdo3+hz+qBBbKGT9dCUhweMNk6BY5GEBgiQZ8tXj9kJg0eUVLiIIf AzPjEQ9TvyuPJFzIXL9B0hgt1wWuRKrn4MgaaDT/HFnnxYNu4HvYsM+BJG8BOnrnpzdSY3 afhjxZVeSg9AkZbvhOsU0f/GeviUMXpCuMTcdFCq6rOKN7d5dUwolFZOEcvnBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY1bG0lF9zhR7; Wed, 15 Jan 2025 09:55: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 50F9tsOr071601; Wed, 15 Jan 2025 09:55:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F9trnS071598; Wed, 15 Jan 2025 09:55:53 GMT (envelope-from git) Date: Wed, 15 Jan 2025 09:55:53 GMT Message-Id: <202501150955.50F9trnS071598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 73121d8c7d0f - stable/14 - usb_vendors: update to 2024.12.04 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 73121d8c7d0f312379f9a18e11a6cc8f61a77361 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=73121d8c7d0f312379f9a18e11a6cc8f61a77361 commit 73121d8c7d0f312379f9a18e11a6cc8f61a77361 Author: Baptiste Daroussin AuthorDate: 2025-01-09 09:47:22 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 09:55:47 +0000 usb_vendors: update to 2024.12.04 (cherry picked from commit 4413d9f3775118c4d8c082a404dd7eb04fe9636a) --- share/misc/usb_vendors | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/misc/usb_vendors b/share/misc/usb_vendors index 41b367d1a0d6..3304de282c18 100644 --- a/share/misc/usb_vendors +++ b/share/misc/usb_vendors @@ -9,8 +9,8 @@ # The latest version can be obtained from # http://www.linux-usb.org/usb.ids # -# Version: 2024.07.04 -# Date: 2024-07-04 20:34:02 +# Version: 2024.12.04 +# Date: 2024-12-04 20:34:02 # # Vendors, devices and interfaces. Please keep sorted. @@ -16876,7 +16876,7 @@ 0256 Schwalm & Tate LLC pISO Raspberry Pi Hat 053a Hackerspace San Salvador HSSV SAMR21-Mote 0cbd Andrzej Szombierski kuku.eu.org keyboard - 0d32 ODrive Robotics ODrive v3 + 0d32 ODrive Robotics ODrive 1001 InterBiometrics Hub 1002 InterBiometrics Relais 1003 InterBiometrics IBSecureCam-P From nobody Wed Jan 15 09:55:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY1bH2mPHz5lBhn; Wed, 15 Jan 2025 09:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY1bH2V61z3Hk0; Wed, 15 Jan 2025 09:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=du0SQN1zq0ne7yLOs3H2JttuqEyHF3TidpA7bv1AnAU=; b=o0CsfXs/H8zcS/AvWOXiYgeYIkXKUjatHqmng5H83bi6KVZukKiZnRQdo9GGlR2X2Ffru4 FT1ggKBB2AimE1Ab2J8jBr857K2AnT4bsHPkRP7HXxzUaYAitBspm4/xmFYOhUo96KZGY5 iXxmvwU8r/QsPyzoMJ3JYJwQBA+MQcV70K0y401Kyoh1b+iMqjAwVv4De/5hkENfKeEzoN m+njnXDACF8YCGBpnGKf1S4L+DpNDJryvTYkyPV6bAqFMxIFRH2cuhZwNWEoUpal9s1tpG fVrDa2cRMP2UUevtbuUkJUrH4Z7cKXdrCiveFsN+aZ3LBkoTOb0IHAQGNHt9Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736934955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=du0SQN1zq0ne7yLOs3H2JttuqEyHF3TidpA7bv1AnAU=; b=Tk8cbpWEuEnfBjx20dmLRXRs2AiDY8aGb6bPaOEDDvgklN+uutJBztGda8CldWYd3+e0jL mvp2ugw8Bknz/PNetiAFPEpjfDGsJwMMJllCYodnm23jjWY+dES0jqdewdU+1v8cS7mOlL JctVzxLTfPyOq+mwk00Yr8/uzBniHng/wbjgy5UcdT6PHZbVTa1rflxlsDNJp/XeEGK0yk vG617eZh2aInBs6YGN7bxEnrncj3Wz57AJRMenvCquFfr3cttoyUng8219nCgdRcR79Nrm mVzxLHais61EJl3+BfstHM/+aj400E20ojrDJpgd3aBhuzAhODhNVYO4jvjWaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736934955; a=rsa-sha256; cv=none; b=dT1jcG+QgkP5dtpA0K98GeJzz1VdcFwHwcgPks1McBr/gDeSZKHZpcs1f3VYYCr+GbMVeS nyNcm8ldlfNUdsTyeGNVEacmmmFex1zHvY7k89pNZQDmGX7Y0h/75etxxKZzZKb9uqShW8 m5Geg8YA0wd2kkbz6oUy8Mfk+q5NDEyLsn2Z3HOg+65LzsSsxOe5z0eDtVKSeR9zbK46bY Gbbd9DHzLQQjU15otlBlYlOBZDGDzEYbjXU9GQ9p5BMsl7PnkK3vP2G3ykROR0TpuUH3Bg Rbyg12r2TuV0t+CXAC+F1qDO/L6pnJz440CHJt4YiTgLLNOjupMQ3IHaiUiKQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY1bH1qtqzhlx; Wed, 15 Jan 2025 09:55: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 50F9ttrG071640; Wed, 15 Jan 2025 09:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50F9ttlD071637; Wed, 15 Jan 2025 09:55:55 GMT (envelope-from git) Date: Wed, 15 Jan 2025 09:55:55 GMT Message-Id: <202501150955.50F9ttlD071637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 7e56062fdf9a - stable/14 - pci_vendors: update to 2024.11.25 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7e56062fdf9a14f7e5e5d90f3bc2cdfef47c91e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7e56062fdf9a14f7e5e5d90f3bc2cdfef47c91e0 commit 7e56062fdf9a14f7e5e5d90f3bc2cdfef47c91e0 Author: Baptiste Daroussin AuthorDate: 2025-01-09 09:47:59 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-15 09:55:47 +0000 pci_vendors: update to 2024.11.25 (cherry picked from commit 2f82bf3521f955c0ef9cc0019b7f86c13020660c) --- share/misc/pci_vendors | 602 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 509 insertions(+), 93 deletions(-) diff --git a/share/misc/pci_vendors b/share/misc/pci_vendors index 968338dd1099..0eebacf92d41 100644 --- a/share/misc/pci_vendors +++ b/share/misc/pci_vendors @@ -1,8 +1,8 @@ # # List of PCI ID's # -# Version: 2024.09.20 -# Date: 2024-09-20 03:15:02 +# Version: 2024.11.25 +# Date: 2024-11-25 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at https://pci-ids.ucw.cz/. @@ -46,13 +46,20 @@ 7a10 Hyper Transport Bridge Controller 7a14 EHCI USB Controller 7a15 Vivante GPU (Graphics Processing Unit) + 7a18 SATA 3 AHCI Controller 7a19 PCI-to-PCI Bridge + 7a1b SPI Controller 7a24 OHCI USB Controller # Found on 7A2000 PCH 7a25 LG100 GPU 7a29 PCI-to-PCI Bridge + 7a34 xHCI USB Controller # Found on 7A2000 PCH 7a36 Display Controller + 7a39 PCIe x1 Root Port + 7a49 PCIe x4 Root Port + 7a59 PCIe x8 Root Port + 7a69 PCIe x16 Root Port 0018 Fn-Link Technology Limited 6252 6252CPUB 802.11ax PCIe Wireless Network Adapter 001c PEAK-System Technik GmbH @@ -3992,6 +3999,7 @@ # Reference 1002 0e3a Radeon RX 6950 XT 1849 5230 Navi 21 [ASRock OC Forumla Radeon RX 6950XT] + 1849 5238 Navi 21 [ASRock Radeon RX 6950 XT Phantom Gaming OC] 1da2 441d Navi 21 [Sapphire Nitro+ Radeon RX 6950 XT] 1eae 6950 Navi 21 [XFX Speedster MERC319 Radeon RX 6950 XT] 73ab Navi 21 Pro-XLA [Radeon Pro W6800X/Radeon Pro W6800X Duo] @@ -4055,11 +4063,13 @@ 744c Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] 1002 0e3b RX 7900 XTX / RX 7900 GRE [XFX] 1043 0506 TUF Gaming Radeon RX 7900 XTX OC + 148c 2425 HELLHOUND RX 7900 GRE 1849 5304 Radeon RX 7900 XTX 1da2 471e PULSE RX 7900 XTX 1da2 475e PULSE RX 7900 GRE 1da2 e471 NITRO+ RX 7900 XTX Vapor-X 1eae 7901 RX-79XMERCB9 [SPEEDSTER MERC 310 RX 7900 XTX] + 1eae 790a RX-79GMERCBR [XFX RX 7900 GRE] 745e Navi 31 [Radeon Pro W7800] 7460 Navi32 GL-XL [AMD Radeon PRO V710] 7461 Navi 32 [AMD Radeon PRO V710] @@ -4075,7 +4085,11 @@ 7499 Navi 33 [Radeon RX 7400/7300/Pro W7400] 74a0 Aqua Vanjaram [Instinct MI300A] 74a1 Aqua Vanjaram [Instinct MI300X] + 74a2 Aqua Vanjaram [Instinct MI308X] + 74a5 Aqua Vanjaram [Instinct MI325X] + 74a9 Aqua Vanjaram [Instinct MI300X HF] 74b5 Aqua Vanjaram [Instinct MI300X VF] + 74bd Aqua Vanjaram [Instinct MI300X HF] 7833 RS350 Host Bridge 7834 RS350 [Radeon 9100 PRO/XT IGP] 7835 RS350M [Mobility Radeon 9000 IGP] @@ -4434,7 +4448,6 @@ 99a2 Trinity 2 [Radeon HD 7420G] 99a4 Trinity 2 [Radeon HD 7400G] aa00 R600 HDMI Audio [Radeon HD 2900 GT/PRO/XT] - aa01 RV635 HDMI Audio [Radeon HD 3650/3730/3750] aa08 RV630 HDMI Audio [Radeon HD 2600 PRO/XT / HD 3610] aa10 RV610 HDMI Audio [Radeon HD 2350 PRO / 2400 PRO/XT / HD 3410] 174b aa10 Radeon HD 2400 PRO @@ -5007,6 +5020,14 @@ 1202 Family 10h Processor DRAM Controller 1203 Family 10h Processor Miscellaneous Control 1204 Family 10h Processor Link Control + 12c0 Turin Data Fabric; Function 0 + 12c1 Turin Data Fabric; Function 1 + 12c2 Turin Data Fabric; Function 2 + 12c3 Turin Data Fabric; Function 3 + 12c4 Turin Data Fabric; Function 4 + 12c5 Turin Data Fabric; Function 5 + 12c6 Turin Data Fabric; Function 6 + 12c7 Turin Data Fabric; Function 7 1300 Family 11h Processor HyperTransport Configuration 1301 Family 11h Processor Address Map 1302 Family 11h Processor DRAM Controller @@ -5130,6 +5151,7 @@ 1480 Starship/Matisse Root Complex 1462 7c37 X570-A PRO motherboard 15d9 1b95 H12SSL-i + 1849 1480 ROME2D32LM3 1481 Starship/Matisse IOMMU 1482 Starship/Matisse PCIe Dummy Host Bridge 1483 Starship/Matisse GPP Bridge @@ -5163,18 +5185,72 @@ 149c Matisse USB 3.0 Host Controller 1462 7c37 X570-A PRO motherboard 149d Vangogh CVIP + 149e Genoa/Bergamo IOMMU + 149f Genoa/Bergamo Dummy Host Bridge + 14a4 Genoa/Bergamo Root Complex + 14a5 Genoa/Bergamo GPP Bridge + 14a6 Genoa/Bergamo RCEC + 14a7 Genoa/Bergamo Internal PCIe GPP Bridge to Bus [D:B] + 14aa Genoa/Bergamo GPP Bridge + 14ab Genoa/Bergamo GPP Bridge + 14ac Genoa/Bergamo Dummy Function + 14ad Genoa/Bergamo Data Fabric; Function 0 + 14ae Genoa/Bergamo Data Fabric; Function 1 + 14af Genoa/Bergamo Data Fabric; Function 2 + 14b0 Genoa/Bergamo Data Fabric; Function 3 + 14b1 Genoa/Bergamo Data Fabric; Function 4 + 14b2 Genoa/Bergamo Data Fabric; Function 5 + 14b3 Genoa/Bergamo Data Fabric; Function 6 + 14b4 Genoa/Bergamo Data Fabric; Function 7 14b5 Family 17h-19h PCIe Root Complex 14b6 Family 17h-19h IOMMU 14b7 Family 17h-19h PCIe Dummy Host Bridge 14b8 Family 17h-19h PCIe GPP Bridge 14b9 Family 17h-19h Internal PCIe GPP Bridge 14ba Family 17h-19h PCIe GPP Bridge + 14c1 Secondary vNTB # Server device 14ca Genoa CCP/PSP 4.0 Device 14cd Family 19h USB4/Thunderbolt PCIe tunnel - 14de Phoenix PCIe Dummy Function + 14d8 Raphael/Granite Ridge Root Complex + 14d9 Raphael/Granite Ridge IOMMU + 14da Raphael/Granite Ridge Dummy Host Bridge + 14db Raphael/Granite Ridge GPP Bridge + 14dc SDXI + 14dd Raphael/Granite Ridge Internal GPP Bridge to Bus [C:A] + 14de Raphael/Granite Ridge PCIe Dummy Function + 14e0 Raphael/Granite Ridge Data Fabric; Function 0 + 14e1 Raphael/Granite Ridge Data Fabric; Function 1 + 14e2 Raphael/Granite Ridge Data Fabric; Function 2 + 14e3 Raphael/Granite Ridge Data Fabric; Function 3 + 14e4 Raphael/Granite Ridge Data Fabric; Function 4 + 14e5 Raphael/Granite Ridge Data Fabric; Function 5 + 14e6 Raphael/Granite Ridge Data Fabric; Function 6 + 14e7 Raphael/Granite Ridge Data Fabric; Function 7 + 14e8 Phoenix Root Complex + 14e9 Phoenix IOMMU + 14ea Phoenix Dummy Host Bridge + 14eb Phoenix Internal GPP Bridge to Bus [C:A] + 14ec Phoenix Dummy Function + 14ed Phoenix GPP Bridge + 14ee Phoenix GPP Bridge 14ef Family 19h USB4/Thunderbolt PCIe tunnel + 14f0 Phoenix Data Fabric; Function 0 + 14f1 Phoenix Data Fabric; Function 1 + 14f2 Phoenix Data Fabric; Function 2 + 14f3 Phoenix Data Fabric; Function 3 + 14f4 Phoenix Data Fabric; Function 4 + 14f5 Phoenix Data Fabric; Function 5 + 14f6 Phoenix Data Fabric; Function 6 + 14f7 Phoenix Data Fabric; Function 7 1502 AMD IPU Device + 1507 Strix Root Complex + 1508 Strix IOMMU + 1509 Strix Dummy Host Bridge + 150a Strix PCIe USB4 Bridge + 150b Strix GPP Bridge + 150c Strix Internal GPP Bridge to Bus [C:A] + 150d Strix PCIe Dummy function 1510 Family 14h Processor Root Complex 174b 1001 PURE Fusion Mini 1512 Family 14h Processor Root Port @@ -5194,12 +5270,11 @@ 1537 Kabini/Mullins PSP-Platform Security Processor 1538 Family 16h Processor Function 0 1539 Kabini P2P Bridge for PCIe Ports[4:0] -# AMD EPYC Turin CPU - 153a Family 1Ah (Models 00h-0Fh) Root Complex -# AMD EPYC Turin CPU - 153b Family 1Ah (Models 00h-0Fh) IOMMU -# AMD EPYC Turin CPU - 153d Family 1Ah (Models 00h-0Fh) PCIe Dummy Host Bridge + 153a Turin Root Complex + 153b Turin IOMMU + 153c Turin RCEC + 153d Turin PCIe Dummy Host Bridge + 153e Turin GPP Bridge 1540 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky HT Configuration 1541 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky Address Maps 1542 Kryptos/Cato/Garfield/Garfield+/Arlene/Pooky DRAM Configuration @@ -5216,10 +5291,10 @@ 154f Anubis Audio Processor 1550 Garfield+/Arlene/Pooky/Anubis SPLL Configuration 1553 Arlene/Pooky P2P Bridge for PCIE (3:0) -# AMD EPYC Turin CPU - 1555 Family 1Ah (Models 00h-0Fh) Internal PCIe GPP Bridge -# AMD EPYC Turin CPU - 1556 Family 1Ah (Models 00h-0Fh) PCIe Dummy Function + 1554 Turin GPP Bridge + 1555 Turin Internal PCIe GPP Bridge to Bus [D:C] + 1556 Turin PCIe Dummy Function + 1557 Turin USB 3.1 xHCI 155b Anubis Root Complex 155c Anubis IOMMU 155d Anubis UMI PCIe Dummy Bridge @@ -5228,6 +5303,7 @@ 1566 Family 16h (Models 30h-3fh) Processor Root Complex 1567 Mullins IOMMU 156b Family 16h (Models 30h-3fh) Host Bridge + 156e Turin CCP/ASP 1570 Family 15h (Models 60h-6fh) Processor Function 0 1571 Family 15h (Models 60h-6fh) Processor Function 1 1572 Family 15h (Models 60h-6fh) Processor Function 2 @@ -5266,11 +5342,13 @@ 15b3 Stoney Miscellaneous Configuration 15b4 Stoney PM Configuration 15b5 Stoney NB Performance Monitor + 15b6 Raphael/Granite Ridge USB 3.1 xHCI + 15b7 Raphael/Granite Ridge USB 3.1 xHCI 15bc Stoney PCIe [GFX,GPP] Bridge [4:0] 15be Stoney Audio Processor 15c4 Phoenix USB4/Thunderbolt NHI controller #1 15c5 Phoenix USB4/Thunderbolt NHI controller #2 - 15c7 Family 19h (Model 74h) CCP/PSP 3.0 Device + 15c7 Phoenix CCP/PSP 3.0 Device 15d0 Raven/Raven2 Root Complex 103c 8615 Pavilion Laptop 15-cw1xxx 1043 876b PRIME B450M-A Motherboard @@ -5309,7 +5387,7 @@ 15e2 ACP/ACP3X/ACP6x Audio Coprocessor 17aa 5124 ThinkPad E595 ea50 ce19 mCOM10-L1900 - 15e3 Family 17h/19h HD Audio Controller + 15e3 Family 17h/19h/1ah HD Audio Controller 103c 8615 Pavilion Laptop 15-cw1xxx 103c 8b17 ProBook 445 G9/455 G9 1043 86c7 PRIME B450M-A Motherboard @@ -5402,6 +5480,8 @@ 1647 VanGogh PCIe GPP Bridge 1648 VanGogh Internal PCIe GPP Bridge to Bus 1649 Family 19h PSP/CCP + 164a Sensor Fusion Hub + 164b Non-Sensor Fusion Hub 164f Milan IOMMU 1650 Milan Data Fabric; Function 0 1651 Milan Data Fabric; Function 1 @@ -5437,6 +5517,14 @@ 167e Rembrandt Data Fabric: Device 18h; Function 5 167f Rembrandt Data Fabric: Device 18h; Function 6 1680 Rembrandt Data Fabric: Device 18h; Function 7 + 16f8 Strix Data Fabric; Function 0 + 16f9 Strix Data Fabric; Function 1 + 16fa Strix Data Fabric; Function 2 + 16fb Strix Data Fabric; Function 3 + 16fc Strix Data Fabric; Function 4 + 16fd Strix Data Fabric; Function 5 + 16fe Strix Data Fabric; Function 6 + 16ff Strix Data Fabric; Function 7 1700 Family 12h/14h Processor Function 0 1701 Family 12h/14h Processor Function 1 1702 Family 12h/14h Processor Function 2 @@ -5454,6 +5542,8 @@ 1716 Family 12h/14h Processor Function 5 1718 Family 12h/14h Processor Function 6 1719 Family 12h/14h Processor Function 7 + 17e0 Strix CCP/ASP + 17f0 Strix Neural Processing Unit 2000 79C97x [PCnet32 LANCE] 1014 2000 NetFinity 10/100 Fast Ethernet 1022 2000 PCnet - Fast 79C971 @@ -5808,7 +5898,8 @@ 5225 M5225 5229 M5229 5235 M5235 - 5237 M5237 PCI USB Host Controller + 5237 OHCI USB Controller + 5239 EHCI USB Controller 5240 EIDE Controller 5241 PCMCIA Bridge 5242 General Purpose Controller @@ -6731,28 +6822,28 @@ c066 3010S Ultra3 Dual Channel 1045 OPTi Inc. a0f8 82C750 [Vendetta] USB Controller - c101 92C264 + c101 82C264 GUI Accelerator c178 92C178 c556 82X556 [Viper] c557 82C557 [Viper-M] c558 82C558 [Viper-M ISA+IDE] - c567 82C750 [Vendetta], device 0 - c568 82C750 [Vendetta], device 1 + c567 82C750 [Vendetta] Host Bridge + c568 82C750 [Vendetta] ISA Bridge c569 82C579 [Viper XPress+ Chipset] - c621 82C621 [Viper-M/N+] + c621 82C621A PCI IDE Contoller c700 82C700 [FireStar] - c701 82C701 [FireStar Plus] - c814 82C814 [Firebridge 1] + c701 82C700 [FireStar] Host Bridge + c814 82C814 [FireBridge II] Docking Stration Controller c822 82C822 - c824 82C824 - c825 82C825 [Firebridge 2] + c824 82C824 [FireFox] 32-Bit PC Card Controller + c825 82C825 [FireBridge II] Docking Stration Controller c832 82C832 - c861 82C861 OHCI USB Host + c861 82C861/2/3 [FireLink] PCI-USB Host Bridge c881 82C881 [FireLink] 1394 OHCI Link Controller c895 82C895 - c935 EV1935 ECTIVA MachOne PCIAudio - d568 82C825 [Firebridge 2] - d721 IDE [FireStar] + c935 82С935 [MachOne] Integrated PCI Audio Processor + d568 82C700 [FireStar] PCI IDE Controller + d721 82C700 [FireStar] PCI IDE Controller 1046 IPC Corporation, Ltd. 1047 Genoa Systems Corp 1048 Elsa AG @@ -7151,12 +7242,13 @@ 0001 W83769F 0033 W89C33D 802.11 a/b/g BB/MAC 0105 W82C105 + 0628 W83628F/W83629D PCI to ISA Bridge Set 0840 W89C840 1050 0001 W89C840 Ethernet Adapter 1050 0840 W89C840 Ethernet Adapter 0940 W89C940 - 5a5a W89C940F - 6692 W6692 + 5a5a W89C940 Twisted-pair Ether-LAN Controller With PCI Interface [ELANC-PCI] + 6692 W6692 PCI ISDN S/T-Controller 1043 1702 ISDN Adapter (PCI Bus, D, W) 1043 1703 ISDN Adapter (PCI Bus, DV, W) 1043 1707 ISDN Adapter (PCI Bus, DV, W) @@ -7165,6 +7257,7 @@ 144f 1707 ISDN Adapter (PCI Bus, DV, W) 9921 W99200F MPEG-1 Video Encoder 9922 W99200F/W9922PF MPEG-1/2 Video Encoder + 9960 W9960CF Video Codec 9970 W9970CF 1051 Anigma, Inc. 1052 ?Young Micro Systems @@ -9163,13 +9256,13 @@ 5842 2051 ISA bridge 10ab Digicom 10ac Honeywell IAC -10ad Symphony Labs +10ad Winbond Electronics Corp / Symphony Labs 0001 W83769F 0003 SL82C103 0005 SL82C105 0103 SL82c103 - 0105 SL82c105 - 0565 W83C553F/W83C554F + 0105 SL82C105/W83C55xF Bus Master IDE + 0565 W83C553F/554F ISA bridge 10ae Cornerstone Technology 10af Micro Computer Systems Inc 10b0 CardExpert Technology @@ -13009,7 +13102,7 @@ 2182 TU116 [GeForce GTX 1660 Ti] 2183 TU116 2184 TU116 [GeForce GTX 1660] - 2187 TU116 [GeForce GTX 1660 SUPER] + 2187 TU116 [GeForce GTX 1650 SUPER] 2188 TU116 [GeForce GTX 1650] 2189 TU116 [CMP 30HX] 2191 TU116M [GeForce GTX 1660 Ti Mobile] @@ -13047,6 +13140,7 @@ 223f GA102GL 228b GA104 High Definition Audio Controller 228e GA106 High Definition Audio Controller + 2291 GA107 High Definition Audio Controller 2296 Tegra PCIe Endpoint Virtual Network 22a3 GH100 [H100 NVSwitch] 22ba AD102 High Definition Audio Controller @@ -13059,6 +13153,7 @@ 2322 GH100 [H800 PCIe] 2324 GH100 [H800] 2329 GH100 [H20] + 232c GH100 [H20 HBM3e] 2330 GH100 [H100 SXM5 80GB] 2331 GH100 [H100 PCIe] 2335 GH100 [H200 SXM 141GB] @@ -13072,6 +13167,7 @@ 2342 GH100 [GH200 120GB / 480GB] 2343 GH100 2345 GH100 [GH100-88K-A1] + 2348 GH100 [GH200 144G HBM3e] 237f GH100 [Skinny Joe] 23b0 GH100 23f0 GH100 @@ -13150,7 +13246,7 @@ 25a9 GA107M [GeForce RTX 2050] 25aa GA107M [GeForce MX570 A] 25ab GA107M [GeForce RTX 3050 4GB Laptop GPU] - 25ac GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] + 25ac GA107BM / GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ad GA107 [GeForce RTX 2050] 25af GA107 [GeForce RTX 3050 Engineering Sample] 25b0 GA107GL [RTX A1000] @@ -13167,7 +13263,7 @@ 25e0 GA107BM [GeForce RTX 3050 Ti Mobile] 25e2 GA107BM [GeForce RTX 3050 Mobile] 25e5 GA107BM [GeForce RTX 3050 Mobile] - 25ec GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] + 25ec GA107BM / GN20-P0-R-K2 [GeForce RTX 3050 6GB Laptop GPU] 25ed GA107 [GeForce RTX 2050] 25f9 GA107 [RTX A1000 Embedded GPU ] 25fa GA107 [RTX A2000 Embedded GPU] @@ -13190,9 +13286,9 @@ 2704 AD103 [GeForce RTX 4080] 2705 AD103 [GeForce RTX 4070 Ti SUPER] 2709 AD103 [GeForce RTX 4070] - 2717 GN21-X11 [GeForce RTX 4090 Laptop GPU] + 2717 AD103M / GN21-X11 [GeForce RTX 4090 Laptop GPU] 2730 AD103GLM [RTX 5000 Ada Generation Laptop GPU] - 2757 GN21-X11 [GeForce RTX 4090 Laptop GPU] + 2757 AD103M / GN21-X11 [GeForce RTX 4090 Laptop GPU] 2770 AD103GLM [RTX 5000 Ada Generation Embedded GPU] 2782 AD104 [GeForce RTX 4070 Ti] 2783 AD104 [GeForce RTX 4070 SUPER] @@ -13230,8 +13326,24 @@ 28e0 AD107M [GeForce RTX 4060 Max-Q / Mobile] 28e1 AD107M [GeForce RTX 4050 Max-Q / Mobile] 28f8 AD107GLM [RTX 2000 Ada Generation Embedded GPU] - 2900 GB100 - 2940 GB100 + 2900 GB100 [Reserved Dev ID A] + 2940 GB100 [Reserved Dev ID B] + 2941 GB100 [GB200 SKU] + 2980 GB102 + 29c0 GB102 + 2c18 GB203M / GN22 [GeForce RTX 5090 Max-Q / Mobile] + 2c19 GB203M / GN22 [GeForce RTX 5080 Max-Q / Mobile] + 2c2c GB6-256(N22W-ES-A1) + 2c58 GB203M / GN22-X11 [GeForce RTX 5090 Max-Q / Mobile] + 2c59 GB203M / GN22-X9 [GeForce RTX 5080 Max-Q / Mobile] + 2d18 AD108M [GeForce RTX 5070 Max-Q / Mobile] + 2d19 AD108M [GeForce RTX 5060 Max-Q / Mobile] + 2d58 AD108M [GeForce RTX 5070 Max-Q / Mobile] + 2d59 AD108M [GeForce RTX 5060 Max-Q / Mobile] + 2d98 AD108M [GeForce RTX 5050 Max-Q / Mobile] + 2dd8 AD108M [GeForce RTX 5050 Max-Q / Mobile] + 2f18 AD108M [GeForce RTX 5070 Ti Max-Q / Mobile] + 2f58 AD108M [GeForce RTX 5070 Ti Max-Q / Mobile] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -13333,6 +13445,7 @@ f500 LPe37000/LPe38000 Series 32Gb/64Gb Fibre Channel Adapter 1014 06c1 PCIe4 4-Port 32Gb Fibre Channel Adapter for POWER (FC EN1L/EN1M; CCIN 2CFC) 1014 06c2 PCIe4 2-Port 64Gb Fibre Channel Adapter for POWER (FC EN1N/EN1P; CCIN 2CFD) + f600 LPe37100S/LPe38100S Series 32Gb/64Gb Fibre Channel Adapter f700 LP7000 Fibre Channel Host Adapter f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter @@ -13671,6 +13784,7 @@ 8813 RTL8813AE 802.11ac PCIe Wireless Network Adapter 8821 RTL8821AE 802.11ac PCIe Wireless Network Adapter 8852 RTL8852AE 802.11ax PCIe Wireless Network Adapter + 8922 RTL8922AE 802.11be PCIe Wireless Network Adapter a85a RTL8852AE WiFi 6 802.11ax PCIe Adapter b520 RTL8852BE-VT PCIe 802.11ax Wireless Network Controller b723 RTL8723BE PCIe Wireless Network Adapter @@ -14046,6 +14160,7 @@ 0410 VX900 Series Host Bridge: Host Control 0415 VT6415 PATA IDE Host Controller 1043 838f Motherboard + 0419 VN1000 Host Bridge 0501 VT8501 [Apollo MVP4] 0505 VT82C505 # Shares chip with :0576. The VT82C576M has :1571 instead of :0561. @@ -14137,6 +14252,7 @@ 1364 CN896/VN896/P4M900 Host Bridge 1409 VX855/VX875 Error Reporting 1410 VX900 Series Error Reporting + 1419 VN1000 Host Bridge 1571 VT82C576M/VT82C586 1595 VT82C595/97 [Apollo VP2/97] 1732 VT1732 [Envy24 II] PCI Multi-Channel Audio Controller @@ -14162,11 +14278,12 @@ 2364 CN896/VN896/P4M900 Host Bridge 2409 VX855/VX875 Host Bus Control 2410 VX900 Series CPU Bus Controller + 2419 VN1000 Host Bridge 287a VT8251 PCI to PCI Bridge 287b VT8251 Host Bridge 287c VT8251 PCIE Root Port 287d VT8251 PCIE Root Port - 287e VT8237/8251 Ultra VLINK Controller + 287e VT8237/8251/8261 Ultra VLINK Controller 3022 CLE266 3038 VT82xx/62xx/VX700/8x0/900 UHCI USB 1.1 Controller 0925 1234 onboard UHCI USB 1.1 Controller @@ -14331,7 +14448,7 @@ 3116 VT8375 [KM266/KL266] Host Bridge 1297 f641 FX41 motherboard 3118 CN400/PM800/PM880/PN800/PN880 [S3 UniChrome Pro] - 3119 VT6120/VT6121/VT6122 Gigabit Ethernet Adapter + 3119 VT6120/VT6121/VT6122/VT6130 Gigabit Ethernet Adapter 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics 3123 VT8623 [Apollo CLE266] 3128 VT8753 [P4X266 AGP] @@ -14432,12 +14549,14 @@ 3372 VT8237S PCI to ISA Bridge 337a VT8237A PCI to PCI Bridge 337b VT8237A Host Bridge + 3402 VT8261 PCI to ISA Bridge 3403 VT6315 Series Firewire Controller 1043 8374 M5A88-V EVO 1043 8384 P8P67 Deluxe Motherboard 3409 VX855/VX875 DRAM Bus Control 3410 VX900 Series DRAM Bus Control 19da a179 ZBOX nano VD01 + 3419 VN1000 Host Bridge 3432 VL800/801 xHCI USB 3.0 Controller 3456 VX11 Standard Host Bridge 345b VX11 Miscellaneous Bus @@ -14466,6 +14585,7 @@ 4409 VX855/VX875 Power Management Control 4410 VX900 Series Power Management and Chip Testing Control 19da a179 ZBOX nano VD01 + 4419 VN1000 Host Bridge 5030 VT82C596 ACPI [Apollo PRO] 5122 VX855/VX875 Chrome 9 HCM Integrated Graphics 5208 PT890 I/O APIC Interrupt Controller @@ -14483,6 +14603,7 @@ 5372 VT8237/8251 Serial ATA Controller 5409 VX855/VX875 APIC and Central Traffic Control 5410 VX900 Series APIC and Central Traffic Control + 5419 VN1000 I/O APIC Interrupt Controller 6100 VT85C100A [Rhine II] 6122 VN1000 Graphics [Chrome 520 IGP] 6287 SATA RAID Controller @@ -14493,6 +14614,7 @@ 6409 VX855/VX875 Scratch Registers 6410 VX900 Series Scratch Registers 19da a179 ZBOX nano VD01 + 6419 VN1000 Host Bridge 7122 VX900 Graphics [Chrome9 HD] 7204 K8M800 Host Bridge 7205 KM400/KN400/P4M800 [S3 UniChrome] @@ -14519,6 +14641,7 @@ 7409 VX855/VX875 North-South Module Interface Control 7410 VX900 Series North-South Module Interface Control 19da a179 ZBOX nano VD01 + 7419 VN1000 Host Bridge 8231 VT8231 [PCI-to-ISA Bridge] 8235 VT8235 ACPI 8305 VT8363/8365 [KT133/KM133 AGP] @@ -14543,12 +14666,14 @@ 8a26 KL133/KL133A/KM133/KM133A [S3 ProSavage] 8d01 PN133/PN133T [S3 Twister] 8d04 KM266/P4M266/P4M266A/P4N266 [S3 ProSavageDDR] + 9000 VT8261 IDE Controller [StorX IDE Controller - 9000] 9001 VX900 Series Serial-ATA Controller + 9040 VT8261 SATA Controller [StorX RAID Controller - 9040] 9082 Standard AHCI 1.0 SATA Controller 9140 HDMI Audio Device 9201 USB3.0 Controller 9380 Ncore Coprocessor for Centaur CNS - 9530 VX800/820/900 Series Secure Digital Memory Card Controller + 9530 VX800/820/900/VT8261 Series Secure Digital Memory Card Controller 95d0 VX800/820/900 Series SDIO Host Controller a208 PT890 PCI to PCI Bridge Controller a238 K8T890 PCI to PCI Bridge Controller @@ -14557,6 +14682,7 @@ a364 CN896/VN896/P4M900 PCI to PCI Bridge Controller a409 VX855/VX875/VX900 Series USB Device Controller a410 VX900 Series PCI Express Root Port 0 + a419 VN1000 PCI to PCI Bridge b091 VT8633 [Apollo Pro266 AGP] b099 VT8366/A/7 [Apollo KT266/A/333 AGP] b101 VT8653 AGP Bridge @@ -14572,6 +14698,7 @@ b213 VPX/VPX2 I/O APIC Interrupt Controller b353 VX855/VX875/VX900 PCI to PCI Bridge b410 VX900 Series PCI Express Root Port 1 + b419 VN1000 Host Bridge b999 [K8T890 North / VT8237 South] PCI Bridge c208 PT890 PCI to PCI Bridge Controller c238 K8T890 PCI to PCI Bridge Controller @@ -14581,22 +14708,26 @@ c364 CN896/VN896/P4M900 PCI to PCI Bridge Controller c409 VX855/VX875 EIDE Controller c410 VX900 Series PCI Express Root Port 2 + c419 VN1000 PCI to PCI Bridge d104 VT8237R USB UDCI Controller d208 PT890 PCI to PCI Bridge Controller d213 VPX/VPX2 PCI to PCI Bridge Controller d238 K8T890 PCI to PCI Bridge Controller d340 PT900 PCI to PCI Bridge Controller d410 VX900 Series PCI Express Root Port 3 + d419 VN1000 PCI to PCI Bridge e208 PT890 PCI to PCI Bridge Controller e238 K8T890 PCI to PCI Bridge Controller e340 PT900 PCI to PCI Bridge Controller e353 VX800/820-Series PCI-Express Root Port 0 e410 VX900 Series PCI Express Physical Layer Electrical Sub-block + e419 VN1000 PCI to PCI Bridge f208 PT890 PCI to PCI Bridge Controller f238 K8T890 PCI to PCI Bridge Controller f340 PT900 PCI to PCI Bridge Controller f353 VX800/820-Series PCI-Express Root Port 1 f410 VX900 Series PCI UART Port 0-3 + f419 VN1000 PCI to PCI Bridge 1107 Stratus Computers 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!) 1108 Proteon, Inc. @@ -17016,9 +17147,7 @@ 123b Seeq Technology, Inc. 123c Century Systems, Inc. 123d Engineering Design Team, Inc. - 0000 EasyConnect 8/32 - 0002 EasyConnect 8/64 - 0003 EasyIO + 0000 PCI 11W 0047 PCIe4 CDa 004b PCIe4 CDa 16 009d VisionLink F1 @@ -17132,7 +17261,9 @@ 1028 0085 ES1968 Maestro-2 PCI 1033 8051 ES1968 Maestro-2 Audiodrive 1969 ES1938/ES1946/ES1969 Solo-1 Audiodrive + 1014 0162 16 Bit PCI Audio Adapter (37L4457) 1014 0166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard + 121f 8800 eDio Hi-Live SC1938 125d 8888 Solo-1 Audio Adapter 125d 8898 ES1938S TTSOLO1-SL [TerraTec 128i PCI] 153b 111b Terratec 128i PCI @@ -18379,6 +18510,8 @@ 0207 GLN180PEX GPS/GLONASS receiver (PCI Express) 0208 GPS180AMC GPS Receiver (PCI Express / MicroTCA / AdvancedMC) 0209 GNS181PEX GPS/Galileo/GLONASS/BEIDOU receiver (PCI Express) + 020a GPS183PEX GPS Receiver (PCI Express) + 020b GNS183PEX GPS/Galileo/GLONASS/BEIDOU receiver (PCI Express) 0301 TCR510PCI IRIG Timecode Reader 0302 TCR167PCI IRIG Timecode Reader 0303 TCR511PCI IRIG Timecode Reader @@ -20018,6 +20151,7 @@ 1028 215a DC NVMe PM9A3 RI U.2 960GB 1028 215b DC NVMe PM9A3 RI U.2 1.92TB 1028 215c DC NVMe PM9A3 RI U.2 3.84TB + 1028 215d Dell DC NVMe PM9A3 RI U.2 7.68TB 1028 2166 DC NVMe PM9A3 RI 110M.2 960GB 1028 2167 DC NVMe PM9A3 RI 110M.2 1.92TB 1028 2168 DC NVMe PM9A3 RI 80M.2 480GB @@ -20154,6 +20288,45 @@ 1028 225e NVMe FIPS PM1745 MU U.2 12.8TB 1028 225f NVMe PM1745 MU U.2 12.8TB a900 NVMe SSD Controller PM9DXa + 1028 230f DC NVMe PM9D3a RI 80M.2 480GB ISE + 1028 2310 DC NVMe PM9D3a RI 80M.2 960GB ISE + 1028 2311 DC NVMe PM9D3a RI 80M.2 1.92TB ISE + 1028 2341 DC NVMe PM9D3a RI U.2 960GB  + 1028 2342 DC NVMe PM9D3a RI U.2 1.92TB + 1028 2343 DC NVMe PM9D3a RI U.2 3.84TB + 1028 2344 DC NVMe PM9D3a RI U.2 7.68GTB + 1028 2345 DC NVMe PM9D3a RI U.2 15.36TB + 1028 2346 DC NVMe FIPS PM9D3a RI U.2 960GB + 1028 2347 DC NVMe FIPS PM9D3a RI U.2 1.92TB + 1028 2348 DC NVMe FIPS PM9D3a RI U.2 3.84TB + 1028 2349 DC NVMe FIPS PM9D3a RI U.2 7.68TB + 1028 234a DC NVMe FIPS PM9D3a RI U.2 15.36TB  + 1028 234d DC NVMe PM9D3a RI E3s 1.92TB + 1028 234e DC NVMe PM9D3a RI E3s 3.84TB  + 1028 234f DC NVMe PM9D3a RI E3s 7.68GTB + 1028 2350 DC NVMe PM9D3a RI E3s 15.36TB + 1028 2351 DC NVMe FIPS PM9D3a RI E3s 1.92TB + 1028 2352 DC NVMe FIPS PM9D3a RI E3s 3.84TB + 1028 2353 DC NVMe FIPS PM9D3a RI E3s 7.68TB + 1028 2354 DC NVMe FIPS PM9D3a RI E3s 15.36TB + 1028 2355 DC NVMe PM9D5a MU U.2 800GB + 1028 2356 DC NVMe PM9D5a MU U.2 1.6TB + 1028 2357 DC NVMe PM9D5a MU U.2 3.2TB + 1028 2358 DC NVMe PM9D5a MU U.2 6.4TB + 1028 2359 DC NVMe PM9D5a MU E3.s 1.6TB + 1028 235a DC NVMe PM9D5a MU E3.s 3.2TB + 1028 235b DC NVMe PM9D5a MU E3.s 6.4TB + aa00 NVMe SSD Controller BM1743 + 1028 2312 NVMe FIPS BM1743 QLC U.2 15.36TB + 1028 2313 NVMe FIPS BM1743 QLC U.2 30.72TB + 1028 2314 NVMe FIPS BM1743 QLC U.2 61.44TB + 1028 2315 NVMe BM1743 QLC U.2 15.36TB + 1028 2316 NVMe BM1743 QLC U.2 30.72TB + 1028 2317 NVMe BM1743 QLC U.2 61.44TB + 1028 2364 NVMe BM1743 QLC U.2 122.88TB + 1028 2366 MZ3MO15THCLCAD3 + 1028 2367 MZ3MO30THCLFAD3 + ac00 NVMe SSD Controller PM175x ecec Exynos 8895 PCIe Root Complex 144e OLITEC 144f Askey Computer Corp. @@ -20353,6 +20526,7 @@ 14c3 MEDIATEK Corp. 0608 MT7921K (RZ608) Wi-Fi 6E 80MHz 0616 MT7922 802.11ax PCI Express Wireless Network Adapter + 4d75 T700 5G Modem [5G Solution 5000] 7603 MT7603E 802.11bgn PCI Express Wireless Network Adapter 7612 MT7612E 802.11acbgn PCI Express Wireless Network Adapter 7615 MT7615E 802.11ac PCI Express Wireless Network Adapter @@ -20360,12 +20534,16 @@ 7650 MT7650 802.11ac # MT7612E too? 7662 MT7662E 802.11ac PCI Express Wireless Network Adapter + 7663 MT7663 802.11ac PCI Express Wireless Network Adapter 7915 MT7915E 802.11ax PCI Express Wireless Network Adapter 7916 MT7905D/MT7975 # WiFi 6E capable 7922 MT7922 802.11ax PCI Express Wireless Network Adapter 1a3b 5300 ASUS PCE-AXE59BT 7961 MT7921 802.11ax PCI Express Wireless Network Adapter + 7988 MT7988 PCIe Host Bridge [Filogic 880] + 7990 MT7996 802.11be PCI Express Wireless Network Adapter (Port 0) + 7991 MT7996 802.11be PCI Express Wireless Network Adapter (Port 1) 8650 MT7650 Bluetooth 14c4 IWASAKI Information Systems Co Ltd 14c5 Automation Products AB @@ -20992,7 +21170,20 @@ 14e4 d142 NetXtreme-E P425D BCM57504 4x25G SFP28 PCIE 1590 0420 HPE Ethernet 25/50Gb 2-port 6310C Adapter 1752 BCM57502 NetXtreme-E 10Gb/25Gb/40Gb/50Gb Ethernet - 1760 BCM57608 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 1760 BCM57608 25Gb/50Gb/100Gb/200Gb/400Gb Ethernet + 14e4 9110 BCM57608 1x400G PCIe Ethernet NIC + 14e4 9120 BCM57608 2x200G PCIe Ethernet NIC + 14e4 9121 BCM57608 2x100G PCIe Ethernet NIC + 14e4 9125 BCM57608 2x200G PCIe Ethernet NIC + 14e4 9126 BCM57608 2x100G PCIe Ethernet NIC + 14e4 9140 BCM57608 1x400G QSFP-DD PCIe Ethernet NIC + 14e4 9310 BCM57608 1x400G QSFP-DD OCP Ethernet NIC + 14e4 9311 BCM57608 1x400G OCP Ethernet NIC + 14e4 9312 BCM57608 1x200G OCP Ethernet NIC + 14e4 9320 BCM57608 2x200G OCP Ethernet NIC + 14e4 9325 BCM57608 2x200G OCP Ethernet NIC + 14e4 9326 BCM57608 2x100G OCP Ethernet NIC + 14e4 9340 BCM57608 4x100G OCP Ethernet NIC 14e4 d125 BCM57608 2x200G PCIe Ethernet NIC 1800 BCM57502 NetXtreme-E Ethernet Partition 1801 BCM57504 NetXtreme-E Ethernet Partition @@ -21010,6 +21201,7 @@ 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz Ethernet Virtual Function 1809 BCM5750X NetXtreme-E RDMA Virtual Function 14e4 df24 BCM57508 NetXtreme-E NGM2100D 2x100G KR Mezz RDMA Virtual Function + 1819 BCM5760X Ethernet Virtual Function 2711 BCM2711 PCIe Bridge 2712 BCM2712 PCIe Bridge 3352 BCM3352 @@ -21983,6 +22175,7 @@ 6893 3U OpenVPX Multi-function I/O Board [Model 68C3] 15ad VMware 0405 SVGA II Adapter + 0406 SVGA II Adapter (Fusion) 0710 SVGA Adapter 0720 VMXNET Ethernet Controller 0740 Virtual Machine Communication Interface @@ -22061,7 +22254,7 @@ 0271 Spectrum-5 RMA 0274 Spectrum-6 in Flash Recovery Mode 0275 Spectrum-6 RMA - 0277 Spectrum-4TOR RMA + 0277 Spectrum-6 Tile 0278 Quantum-4 in Flash Recovery Mode 0279 Quantum-4 RMA 027a Eros Chiplet @@ -22075,6 +22268,7 @@ # Flash recovery 0288 Arcus2 0289 Arcus2 RMA + 0290 SagittaZ 1002 MT25400 Family [ConnectX-2 Virtual Function] 1003 MT27500 Family [ConnectX-3] 1014 04b5 PCIe3 40GbE RoCE Converged Host Bus Adapter for Power @@ -22151,6 +22345,7 @@ 193d 1083 NIC-ETH640F-3S-2P # NIC-ETH540F-3S-2P OCP3.0 2x10G Card 193d 1084 NIC-ETH540F-3S-2P + 1e81 0c10 25GbE dual-port SFP28, PCIe3.0 x8 [3SC10] 1016 MT27710 Family [ConnectX-4 Lx Virtual Function] 1017 MT27800 Family [ConnectX-5] 15b3 0006 ConnectX-5 EN network interface card, 100GbE single-port QSFP28, PCIe3.0 x16, tall bracket; MCX515A-CCAT @@ -22169,9 +22364,14 @@ 101b MT28908 Family [ConnectX-6] 101c MT28908 Family [ConnectX-6 Virtual Function] 101d MT2892 Family [ConnectX-6 Dx] + 193d 1055 NIC-ETH1040F-LP-2P QSFP56 2x100GbE PCIe Network Adapter 101e ConnectX Family mlx5Gen Virtual Function 101f MT2894 Family [ConnectX-6 Lx] 193d 1035 NIC-ETH641F-LP-2P SFP28 2x25GbE PCIe Network Adapter + 1bd4 00ac O252MCX6Lx + 1bd4 00ae S252MCX6Lx + 1ff9 00ad ENFM6251-SP2 + 1ff9 00af ENPM6251-SP2 1020 MT28860 1021 MT2910 Family [ConnectX-7] 1023 CX8 Family [ConnectX-8] @@ -22316,7 +22516,7 @@ 5006 SanDisk Extreme Pro / WD Black SN750 / PC SN730 / Red SN700 NVMe SSD 5007 IX SN530 NVMe SSD (DRAM-less) 5008 PC SN530 NVMe SSD (DRAM-less) - 5009 SanDisk Ultra 3D / WD Blue SN550 NVMe SSD + 5009 SanDisk Ultra 3D / WD PC SN530, IX SN530, Blue SN550 NVMe SSD (DRAM-less) 15b7 5009 WD Blue SN550 NVMe SSD 500b PC SN530 NVMe SSD 1414 500b Xbox Series X @@ -22339,6 +22539,7 @@ 5036 WD PC SN5000S M.2 2280 NVMe SSD (DRAM-less) 5041 WD Blue SN580 NVMe SSD (DRAM-less) 5042 WD Black SN770M NVMe SSD (DRAM-less) + 5046 SanDisk Extreme NVMe SSD (DRAM-less) 15b8 ADDI-DATA GmbH 1001 APCI1516 SP controller (16 digi outputs) 1003 APCI1032 SP controller (32 digi inputs w/ opto coupler) @@ -23436,6 +23637,7 @@ 8084 GL880 USB 2.0 EHCI controller 9750 GL9750 SD Host Controller 9755 GL9755 SD Host Controller + 9767 GL9767 SD Host Controller e763 GL9763E eMMC Controller 17aa Lenovo 0003 LENSE20256GMSP34MEAT2TA @@ -23930,6 +24132,8 @@ # Sitecom HFC-S based ISDN controller card DC-105v2 3069 DC-105v2 ISDN controller 18d4 Celestica +# OCP-TAP + 1007 Time Card 18d8 Dialogue Technology Corp. 18dd Artimi Inc 4c6f Artimi RTMI-100 UWB adapter @@ -24676,6 +24880,7 @@ 1a03 ASPEED Technology, Inc. 1150 AST1150 PCI-to-PCI Bridge 2000 ASPEED Graphics Family + 15d9 0821 X10DRW-i 15d9 0832 X10SRL-F 15d9 1b95 H12SSL-i 1a05 deltaww @@ -24826,6 +25031,7 @@ 1ad7 Spectracom Corporation 8000 TSync-PCIe Time Code Processor 9100 TPRO-PCI-66U Timecode Reader/Generator + a000 OCP-TAP [ARTCard] 1ade Spin Master Ltd. 1501 Swipetech barcode scanner 3038 PCIe Video Bridge @@ -25457,6 +25663,7 @@ 0022 FD788 0023 FD722-M2 0024 FD722 with bypass + 0025 FD922 1c28 Lite-On IT Corp. / Plextor 0122 M6e PCI Express SSD [Marvell 88SS9183] # previously Fiberblaze @@ -25656,6 +25863,12 @@ 1c5f 5437 NVMe SSD PBlaze6 6647 3200G 2.5" U.2(dual port) 1c5f 5441 NVMe SSD PBlaze6 6547 6400G 2.5" U.2 1c5f 5447 NVMe SSD PBlaze6 6647 6400G 2.5" U.2(dual port) + 0027 PBlaze7 7A40/7A46 NVMe SSD + 1c5f 1421 NVMe SSD PBlaze7 7A40 1920G 2.5" U.2 + 1c5f 1431 NVMe SSD PBlaze7 7A40 3840G 2.5" U.2 + 1c5f 1441 NVMe SSD PBlaze7 7A40 7680G 2.5" U.2 + 1c5f 5431 NVMe SSD PBlaze7 7A46 3200G 2.5" U.2 + 1c5f 5441 NVMe SSD PBlaze7 7A46 6400G 2.5" U.2 003d PBlaze5 920/926 1c5f 0a30 NVMe SSD PBlaze5 920 3840G AIC 1c5f 0a31 NVMe SSD PBlaze5 920 3840G 2.5" U.2 @@ -25679,9 +25892,12 @@ 1c5f 4b61 NVMe SSD PBlaze6 6936 25600GB 2.5" U.3 003f PBlaze7 7940/7946 NVMe SSD 1c5f 0431 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 + 1c5f 0441 NVMe SSD PBlaze7 7940 7680G 2.5" U.2 + 1c5f 0451 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 1c5f 0c31 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 1c5f 0c41 NVMe SSD PBlaze7 7940 7680G 2.5" U.2 1c5f 0c51 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 + 1c5f 0c61 NVMe SSD PBlaze7 7940 30720G 2.5" U.2 1c5f 1430 NVMe SSD PBlaze7 7940 3840G AIC 1c5f 1431 NVMe SSD PBlaze7 7940 3840G 2.5" U.2 1c5f 1435 NVMe SSD PBlaze7 7940 3840G E1.S @@ -25690,6 +25906,9 @@ 1c5f 1445 NVMe SSD PBlaze7 7940 7680G E1.S 1c5f 1450 NVMe SSD PBlaze7 7940 15360G AIC 1c5f 1451 NVMe SSD PBlaze7 7940 15360G 2.5" U.2 + 1c5f 4431 NVMe SSD PBlaze7 7946 3200G 2.5" U.2 + 1c5f 4441 NVMe SSD PBlaze7 7946 6400G 2.5" U.2 + 1c5f 4451 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 1c5f 4c31 NVMe SSD PBlaze7 7946 3200G 2.5" U.2 1c5f 4c41 NVMe SSD PBlaze7 7946 6400G 2.5" U.2 1c5f 4c51 NVMe SSD PBlaze7 7946 12800G 2.5" U.2 @@ -25775,6 +25994,7 @@ 627a LEGEND 800 NVMe SSD (DRAM-less) # 500GB 628a LEGEND 800 NVMe SSD (DRAM-less) + 642a XPG GAMMIX S50 CORE NVMe SSD (DRAM-less) 8201 XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive 1cc4 Shenzhen Unionmemory Information System Ltd. 1203 NVMe SSD Controller UHXXXa series @@ -25808,6 +26028,8 @@ 6a03 RPETJ512MKP1QDQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a13 RPJYJ512MKN1QWQ PCIe 4.0 NVMe SSD 512GB (DRAM-less) 6a14 RPEYJ1T24MKN2QWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) + 6b13 RPJYJ512MLR1QWY PCIe 4.0 NVMe SSD 512GB (DRAM-less) + 6b14 RPJYJ1T24MLR1HWY PCIe 4.0 NVMe SSD 1024GB (DRAM-less) 8030 NVMe SSD Controller UH8X2X/UH7X2X series 1cc4 1122 NVMe SSD UH812a U.2 1.92TB 1cc4 1123 NVMe SSD UH812a U.2 3.84TB @@ -25894,6 +26116,7 @@ efa0 Elastic Fabric Adapter (EFA) efa1 Elastic Fabric Adapter (EFA) efa2 Elastic Fabric Adapter (EFA) + efa3 Elastic Fabric Adapter (EFA) 1d17 Zhaoxin 070f ZX-100 PCI Express Root Port 0710 ZX-100/ZX-200 PCI Express Root Port @@ -26106,6 +26329,8 @@ 1028 AR-P2P-ATR [P2P Actor Function] 1029 AR-P2P-UTL [P2P Utility Function] 102a AR-TK242-FX2 [4x100GbE Gen5 Packet Capture-Replay Device] + 102b AR-ARKV-FX1 [Arkville 128B DPDK Data Mover for Versal/CPM5] + 102c AR-TK242-V80 [Gen5 PCAP Processor] 4200 A5PL-E1-10GETI [10 GbE Ethernet Traffic Instrument] 1d72 Xiaomi 1d78 DERA Storage @@ -26255,6 +26480,7 @@ 0010 Networking DOM Engine 0011 IO Bridge 0013 Host Network Interface + 0400 Time Card 1da1 Teko Telecom S.r.l. 1da2 Sapphire Technology Limited 475d Radeon RX 7800 XT [PULSE] @@ -26270,6 +26496,7 @@ 1010 HL-2000 AI Training Accelerator [Gaudi secured] # PCIe accelerator card for Deep Learning training tasks 1020 Gaudi2 AI Training Accelerator + 1060 Gaudi3 AI Training Accelerator 1da8 Corigine, Inc. 3800 Network Flow Processor 3800 3803 Network Flow Processor 3800 Virtual Function @@ -26333,6 +26560,7 @@ 1dbe 5007 Dongting-N3 DC SSD U.2 12800GB 1dbe 5008 Dongting-N3 DC SSD U.2 15360GB 1dbe 5009 Dongting-N3 DC SSD U.2 25600GB + 1dbe 5010 Dongting-N3 DC SSD U.2 30720GB 5669 NVMe SSD Controller IG5669 [Tacoma] 1dbf Guizhou Huaxintong Semiconductor Technology Co., Ltd 0401 StarDragon4800 PCI Express Root Port @@ -26793,6 +27021,7 @@ 1028 223d Ent NVMe CM7 U.2 MU 3.2TB 1028 223e Ent NVMe CM7 U.2 MU 1.6TB 002a Exceria Plus G3 NVMe SSD (DRAM-less) + 002b NVMe SSD Controller CD8P 002c NVMe SSD Controller CD8P EDSFF 1028 22bf DC NVMe CD8P E3.S 15.36TB 1028 22c0 DC NVMe CD8P E3.S 7.68TB @@ -26848,8 +27077,14 @@ 1e3b DapuStor Corporation 0600 NVMe SSD Controller DP600 1e3b 0006 Enterprise NVMe SSD U.2 7.68TB (J5000) + 1e3b 000c Enterprise NVMe SSD U.2 30.72TB (J5060) + 1e3b 000d Enterprise NVMe SSD U.2 61.44TB (J5060) *** 708 LINES SKIPPED *** From nobody Wed Jan 15 15:03:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YY8QS2jT0z5kFD3; Wed, 15 Jan 2025 15:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YY8QS1bBjz3h2G; Wed, 15 Jan 2025 15:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736953424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vd2Kd0s0y1BZXp9NCtsIn31so4tbZyB8be91w9EFv7g=; b=GMiKNqAqdxFCTSq97r/vhQGWqfXLFZKeZv8u2AZLbfnUVfU2wUyHAsjT+Hj3eTftaYDHI7 2Da/s+zChRnkV8LobzlHK6SI7ZI2rcjW5ROhTN8JxxwAm5CEnWK1i0Zukq2vYFqiMpb8n8 MIq6ewR1UZnyRNwTLHujFNIDGeikB/hgF043RyWrG+XhZxdRbDY0oSjvblEWYt4laNXsgV HFl4Y+4A2TT/gtqHWXo88YIZRQaT/uZHEHaEtb4N0NpG/b+gqB78kg7HKqJzL/gljIWQ0C DrjgCk0Dyc0z8u6cOD7meUhiX2GNxFvV2YIiW7jUtJjEyWrmKmagS82zRQORrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736953424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vd2Kd0s0y1BZXp9NCtsIn31so4tbZyB8be91w9EFv7g=; b=a6dpSeaZ8XTFYr9LZM2bYXcU1yzQo8oHUNG6PbSnS07YU6SORHDTKt/LRjnpr5unmW/t00 669hQCeOpqzEFo8M1sQG1WAHo1phelVWmnxoaHq+QXGmjSLO+2kpSmiaDaezDTe+R84+sS fCWRHIuP75lIj9DLFljGV/vRs76TZssbM/OOtdnKrNkKLC3M9YEJZFTIuzv569mWrSxHIk 1gb+tTzM5iyqVvPa04k7KQMZWtUUEGM+WFnxnD4z3UypU6gwYFvDS0UQyAEFHRunRuZhts dAv94HbkjgejK05Z+ADvuyUAELzG2sfLDtigo9Sx6igeIYMHhBph72l3/zWvag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736953424; a=rsa-sha256; cv=none; b=MKFtojNYQMgV9hVP9w2+4wWQ8ea9SXCkNeoe2OkXdoTGpnBo5b9BFrwfTpvq/Ik7S/U+VQ z+AveLKnH+9hOV509JnjuwwQjwi7AlYKbh9KIxTwaXHm+SjU35FISFBH1bIUu2UHbohgvJ fqnT+eAL5tq3uyMKMAZJSjkqaUsgBPUQ5/XZhmWQnhN0BMdoqOXPaP+5PrVgph14siEth4 46+wN5vord2e8s68dyOwxopCQ5YRfZ1A/efgUZld3bIAfyZyN4vT6zdliWVHldpXUn29dx A3klMpOhH1aqH9uj48lO7S5SQnJcMUB4otLD5bmR47+IYmcW6Oo+LhDcWshDVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YY8QS1BDRzrSc; Wed, 15 Jan 2025 15:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50FF3iFa052631; Wed, 15 Jan 2025 15:03:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FF3iP9052628; Wed, 15 Jan 2025 15:03:44 GMT (envelope-from git) Date: Wed, 15 Jan 2025 15:03:44 GMT Message-Id: <202501151503.50FF3iP9052628@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: 101e825e551a - main - arm64: Refine comment about size of struct pmap_large_md_page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 101e825e551afc69a7cebb78fa6b676d38d93d2d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=101e825e551afc69a7cebb78fa6b676d38d93d2d commit 101e825e551afc69a7cebb78fa6b676d38d93d2d Author: John Baldwin AuthorDate: 2025-01-15 15:03:12 +0000 Commit: John Baldwin CommitDate: 2025-01-15 15:03:12 +0000 arm64: Refine comment about size of struct pmap_large_md_page pmap_init_pv_table does not assume a specific size of 64. It does assume a size that evenly divides the size of a page since it inserts pages from different domains into the kva backing the global pv_table array. Reviewed by: imp, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D48455 --- sys/arm64/arm64/pmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index fd6798668626..23eedff2e7cd 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1547,11 +1547,11 @@ pmap_init_pv_table(void) int domain, i, j, pages; /* - * We strongly depend on the size being a power of two, so the assert - * is overzealous. However, should the struct be resized to a - * different power of two, the code below needs to be revisited. + * We depend on the size being evenly divisible into a page so + * that the pv_table array can be indexed directly while + * safely spanning multiple pages from different domains. */ - CTASSERT((sizeof(*pvd) == 64)); + CTASSERT(PAGE_SIZE % sizeof(*pvd) == 0); /* * Calculate the size of the array. From nobody Wed Jan 15 17:11:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYCGN39Fvz5kP0F; Wed, 15 Jan 2025 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYCGN2DvDz42sb; Wed, 15 Jan 2025 17:11:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736961116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JZuvhdcZrwekYkA8Dfp8b1rmZHIQ3fWVcPnKEMVbmE0=; b=LgW35tE5yhldAsuJV3FxgxbMN9ueRjAkSBXXoW6FWPmlQK9tyl+iZWIXyXRhHV8j1NxDoO RlX9ID2S8vFUYOTZeKqy660GZsZZ0E2DhgXmQyOnPQbg5OcDKpXvva/RcQ/mxawQtULOh0 pR9u+5PFKv95vHsWQJwrOO8lbY3ZfDiYknZi4J1Pp2+MI9jDrfp01Nn3soshnAlO9fA9bb rcWryQnKQrqD9XTTl6Hw0ubihP+ZOPA72icb8IyBvJgud9+JvRFLgH/6icwAlRm3myDju3 kKmeuDu6NUJrc/I5Ey49/9zO9rHJPNdkz4f9GEYF2VwdmBDYvo8HeJTV+5n/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736961116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JZuvhdcZrwekYkA8Dfp8b1rmZHIQ3fWVcPnKEMVbmE0=; b=uDNYN5Vae+n5D4vB4+w7pphr6MwnCCbDOzYxyXbCJoSzptxO/i3reybDP3dG6ZZmMmNAnL d5fM14OafHVpIG9c/vBuTVq1TmbksrNUHenC5QWqi84vbqTgyoDv25ZVrN16WNNUP/08kG 7j/QXJBCXfanWunTp+OZ3tbEeV6qFSMhw18nMJIInm3M2IbYB/plUbDaArgAZU0BRo8Vm9 KQSSVpJFhcNFZ/2usk9dgKd/TCxEZKC8xwv3kGTVe4diTpRiG1n1LcsXWrklHXq64e15dU eQlqdIXzK6/LF3aAemXq/Ki3ttyUegR86leJIV9hNuy7FSp9TttB0IiNI+bSwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736961116; a=rsa-sha256; cv=none; b=p3x+K3+5rBA39YwqX8xm70xijByIldwzCaH76GtVMLsPHcwCSAWAMIVCNue8oxQVGn6VCc QAGSTOMrp5P2gJovFLC1H0zRYgZr7lLF297gZo5TTcxZ0ZjVlE9MORCIYtXjB5nPfAmq3q JC0r5oYuDb0nPPpUV/ghWD37nFLt+XCdJVPKjzo5Si4qJgooE6Rqr/xKYLDlTHEFzouZW3 3x6nqIukcbZuccDWTnFECDOpdrYH+sAQV5NUy/i5ceHdqefgGSwpeGE8ZoxIUc1nHWBw9M jWHNRmJsSLwX1SgKNaG2ulGp6GpQ6ZZBRS7LwL4rVOCuN7tn2x/3T5rYskjb5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYCGN1lKzzvyv; Wed, 15 Jan 2025 17:11: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 50FHBu6J094958; Wed, 15 Jan 2025 17:11:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FHBugo094955; Wed, 15 Jan 2025 17:11:56 GMT (envelope-from git) Date: Wed, 15 Jan 2025 17:11:56 GMT Message-Id: <202501151711.50FHBugo094955@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: 1132466b56bc - main - git-arc: Properly quote .nm arg List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1132466b56bc87dbdcc32bdf84b93d2fabe67776 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1132466b56bc87dbdcc32bdf84b93d2fabe67776 commit 1132466b56bc87dbdcc32bdf84b93d2fabe67776 Author: Warner Losh AuthorDate: 2025-01-15 17:02:53 +0000 Commit: Warner Losh CommitDate: 2025-01-15 17:09:43 +0000 git-arc: Properly quote .nm arg .Nm git arc has 2 args, despite the mdoc reference saying there's only one arg when in the preamble and NAME sections, but not noting that restriction later. Quote the arg and bump the date. This doesn't affect man git-arc, but does affect the rendering of the man page on at least one website. Date bumped since it is a semantic change and not just a typo or other trivial correction. Reviewed by: jhb Sponsored by: Netflix --- tools/tools/git/git-arc.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index f2f7ee38e140..1f1bc2fca130 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -24,11 +24,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2023 +.Dd Janurary 15, 2025 .Dt GIT-ARC 1 .Os .Sh NAME -.Nm git arc +.Nm "git arc" .Nd a wrapper to improve integration between git and arcanist .Sh SYNOPSIS .Nm From nobody Wed Jan 15 17:23:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYCWW4pzMz5kPNv; Wed, 15 Jan 2025 17:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYCWW3RZlz44r5; Wed, 15 Jan 2025 17:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736961799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=986lJUKl3jocmWG3NB9uY1OUanIOIVLykbnO9RjIiLA=; b=qQLdyhYl7Yjo/FdhAiany/ubCjH7DpHYsHzLWMPsXCs3TuyUcvllT7tlKLucfoDaUabElY xEzHALqgZ2+jMlmMMgpzvThUuJlaLLgVxmRbOpaCa1bMtIYl9UBe2FJMH19wD8Cxaw3wzU sAYe0FUHVDOSsgS87kVpbpw8jDobhpWH3zMCsFj5nYi4X7Z+2UpRBpcbjBb36LGZGPHXfs 3Hh5h18JTEfzlhgfUcoXiIbIO/Z0NnObAcL+pP927zQX7wTlS37nXUfAnKt7mZSxBEZOI7 j/U7TwlRxmMxLKB7IzBuQL93dtQ31YJ4Tngn60LhWcpaM6fvdxFkTZR9pj+/wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736961799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=986lJUKl3jocmWG3NB9uY1OUanIOIVLykbnO9RjIiLA=; b=A1RCYPdD8nD2j9xgJvXJspixZS5a+GWg0QNELkvZFmiET5ebRZEicbIyA6cZnSWXt1vBDt sWDuhrZpZh+jQNP5g0kgpHk/FXKybUPPKXYtH8V0crChDjPL+HalDGJwFVwys9VIslxB18 M0vjNMzSPgnAEOHvvS66e7vSVTdIPCBa672H0TnZdLsepbJJp4BOgBOTcZLj5uN1FT3lNT CO0ZQRefkzdvxEno7TwQj51UU9b0npgqDOHlwlHCn8DzjlxzfJ3PyrEv61nmrQohYigMjp p/vVuhkaJEhxTqassL7TgaLv6063KI3M/2rYtq0Wap1KAP3Uk/UX5sSMZrKA6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736961799; a=rsa-sha256; cv=none; b=UokdSimyYvNB2Z1aVyg58wVMEGkWlsmeq4k0choVYI/v/+8mFFciolm3zCnIZnH47Wu7na uiHKnP9xRoyJf0lidAqPhzwggTmjxu1Exzo7vLaOsel7RwmpOlQN9lcOCmz0W9WjKKwKHi XSQn6Z+ozQjlFyuaWfbx/A6gQcyYwnYU0JSC5p6mT3oCD7kqLP1HMKowXp0sl8XQ6BPcge BtGXjejm18G60mWOwARNAeJpNMxOWKhky7HfpL6YonaKKigUqOCDMzty75KK9rFknsKHwe hluAPXH3daUS99LESbYryfRI+Sp3f2LPvRWwR9iBPVptjMG10h/1XkTJ9JvAPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYCWW2zPGzwLF; Wed, 15 Jan 2025 17:23: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 50FHNJFV014745; Wed, 15 Jan 2025 17:23:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FHNJB1014742; Wed, 15 Jan 2025 17:23:19 GMT (envelope-from git) Date: Wed, 15 Jan 2025 17:23:19 GMT Message-Id: <202501151723.50FHNJB1014742@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: cf9070746742 - main - Introduce the UMA_ZONE_NOTRIM uma zone type List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf907074674206b1825f79c6864c4c4a32089ecc Auto-Submitted: auto-generated The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=cf907074674206b1825f79c6864c4c4a32089ecc commit cf907074674206b1825f79c6864c4c4a32089ecc Author: Andrew Gallatin AuthorDate: 2025-01-15 17:11:51 +0000 Commit: Andrew Gallatin CommitDate: 2025-01-15 17:23:00 +0000 Introduce the UMA_ZONE_NOTRIM uma zone type The ktls buffer zone allocates 16k contiguous buffers, and often needs to call vm_page_reclaim_contig_domain_ext() to free up contiguous memory, which can be expensive. Web servers which have a daily pattern of peaks and troughs end up having UMA trim the ktls_buffer_zone when they are in their trough, and end up re-building it on the way to their peak. Rather than calling vm_page_reclaim_contig_domain_ext() multiple times on a daily basis, lets mark the ktls_buffer_zone with a new UMA flag, UMA_ZONE_NOTRIM. This disables UMA_RECLAIM_TRIM on the zone, but allows UMA_RECLAIM_DRAIN* operations, so that if we become extremely short of memory (vm_page_count_severe()), the uma reclaim worker can still free up memory. Note that UMA_ZONE_UNMANAGED already exists, but can never be drained or trimmed, so it may hold on to memory during times of severe memory pressure. Using UMA_ZONE_NOTRIM rather than UMA_ZONE_UNMANAGED is an attempt to keep this zone more reactive in the face of severe memory pressure. Sponsored by: Netflix Reviewed by: jhb, kib, markj (via slack) Differential Revision: https://reviews.freebsd.org/D48451 --- sys/kern/uipc_ktls.c | 2 +- sys/vm/uma.h | 1 + sys/vm/uma_core.c | 11 ++++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 881825bf1d9f..6815667594a4 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -495,7 +495,7 @@ ktls_init(void) ktls_buffer_zone = uma_zcache_create("ktls_buffers", roundup2(ktls_maxlen, PAGE_SIZE), NULL, NULL, NULL, NULL, ktls_buffer_import, ktls_buffer_release, NULL, - UMA_ZONE_FIRSTTOUCH); + UMA_ZONE_FIRSTTOUCH | UMA_ZONE_NOTRIM); } /* diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 38865df7ae02..4f2b143a2fae 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -252,6 +252,7 @@ uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, #define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ #define UMA_ZONE_NOBUCKET 0x0400 /* Do not use buckets. */ #define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets. */ +#define UMA_ZONE_NOTRIM 0x1000 /* Don't trim this zone */ #define UMA_ZONE_CACHESPREAD 0x2000 /* * Spread memory start locations across * all possible cache lines. May diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index e93c561d759a..4de850afcb66 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1222,7 +1222,7 @@ zone_timeout(uma_zone_t zone, void *unused) trim: /* Trim caches not used for a long time. */ - if ((zone->uz_flags & UMA_ZONE_UNMANAGED) == 0) { + if ((zone->uz_flags & (UMA_ZONE_UNMANAGED | UMA_ZONE_NOTRIM)) == 0) { for (int i = 0; i < vm_ndomains; i++) { if (bucket_cache_reclaim_domain(zone, false, false, i) && (zone->uz_flags & UMA_ZFLAG_CACHE) == 0) @@ -5306,8 +5306,13 @@ uma_reclaim_domain_cb(uma_zone_t zone, void *arg) struct uma_reclaim_args *args; args = arg; - if ((zone->uz_flags & UMA_ZONE_UNMANAGED) == 0) - uma_zone_reclaim_domain(zone, args->req, args->domain); + if ((zone->uz_flags & UMA_ZONE_UNMANAGED) != 0) + return; + if ((args->req == UMA_RECLAIM_TRIM) && + (zone->uz_flags & UMA_ZONE_NOTRIM) !=0) + return; + + uma_zone_reclaim_domain(zone, args->req, args->domain); } /* See uma.h */ From nobody Wed Jan 15 17:26:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYCbk0Q39z5kPy7; Wed, 15 Jan 2025 17:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYCbj72Ncz469W; Wed, 15 Jan 2025 17:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736962018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3BTqho66k5UvZ6kGUjCIF+u3h8KjhahqiVrhgUDguR8=; b=tbqIoPUrx58jq7A/vErye8WmmxlxB4u/MjCVxyie9jK1IyPW56DrbwdzM7KwbvwPNcPQcN IjW9avs7wEof6K0PmHmY9cvSde3UdUNUoG/4Z4kstpfy0B8iuuyAfhHhgCMhD0e1/oxpg/ vfvihvWZGKl+lhLJhiwSOl7eGJAawOZJFe8QOxoC6y2bmKyolAXM2vLr/iVDEfvim0xdp1 S1KGeeoyjisGUVfcY5oId/tgyMBtOpXmaXrC3vaUg4FIBXQ8m4I4oPU+KCaojLH9wf+mFm ppWULlV9RL4hDliNeS7NTycfkOrJDhqXvu5bPNq2v5EwgwN8H0Q9UeiBQRanOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736962018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3BTqho66k5UvZ6kGUjCIF+u3h8KjhahqiVrhgUDguR8=; b=A14/ZGDLzdSB6KG2MlpHiJ1dBZ8IXryUcmND1lkcC2YRFaz0gbneEolH/fIUPfMjfWCF5A 7vnP4CGPuebZUQamaGmrh9duQxJCSUDhla4PXrbLbJM3dUawy/VMz60lfblS4XVJjpaJSH UW0OO5fSaalyNIuURQsWeva2c2mMduhRPBGT5dwiT2VExpOTL+rvS+xbKwP9whcSd4Iv1H cc7b8fcX1d/gnTG4mxX1FrAGZUhZGp7KmOfxhhUKUtY+MoI4dUyV3AVIKG5O6nlMnkYBAe LKc7/Uy9b62Na7Dw+/IoTLwjSD1tAELLPOegkVs7i10rpr4bFwjTq+0cIc2d+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736962018; a=rsa-sha256; cv=none; b=cftiZEia1RRujaa98QsYNXc1aV8S4nmkEijyiHBsipQbF1IMp52kNOL7H8EdLJc7KnxqQ3 TGz7tzdU+wQnzENDECdwjfA1EJLXqB12Mw1eOHuvLZzotH3WUGUhePpZfWNVgkR997Epda XByc0/b7PyQkFISjWGcT2pP6E6AcQkucrhdS41mU55ZMtrlV9hTh3ClnB/oCSw7ht8ts5m JEUu2GC0+brFXKhMUsW0oYp3Kf8bqWAKIQh0A/nXLzVxlw0WR4T6jL8E4byTD9A7dJLMv5 KB8DfywW7CVJWIx/1IYIW+s8sR8EUO7jvWAPYKcIeidcdd6PmszQwY/S6vfvWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYCbj6DJpzwYK; Wed, 15 Jan 2025 17:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50FHQvHH015955; Wed, 15 Jan 2025 17:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FHQvb0015952; Wed, 15 Jan 2025 17:26:57 GMT (envelope-from git) Date: Wed, 15 Jan 2025 17:26:57 GMT Message-Id: <202501151726.50FHQvb0015952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 2c5fbcff0717 - stable/14 - libdtrace: Be less strict when comparing pointer types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c5fbcff0717ab7586a5862a76b8692503662efa Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2c5fbcff0717ab7586a5862a76b8692503662efa commit 2c5fbcff0717ab7586a5862a76b8692503662efa Author: Mark Johnston AuthorDate: 2024-12-31 19:25:52 +0000 Commit: Mark Johnston CommitDate: 2025-01-15 17:10:57 +0000 libdtrace: Be less strict when comparing pointer types If one of two pointers refers to a forward declaration, let the pointers be compatible so long as the referred types have the same name. Otherwise we can get spurious errors. To give a specific example, this can happen when ipfw_nat.ko is loaded before ipfw.ko and /usr/lib/dtrace/ipfw.d is processed. Currently, ipfw_nat.ko does not have a definition for struct inpcb (i.e., none of its files include in_pcb.h), so in the CTF type graph, struct ip_fw_args' "inp" member refers to a forward declaration, represented in CTF with CTF_K_FORWARD. Then, when libdtrace processes the ipfw_match_info_t translator in ipfw.d, it decides that the "inp" field assignment is incorrect because the two pointers are incompatible. However, there's no harm in allowing this assignment. Add some logic to dt_node_is_ptrcompat() to detect this case and declare the pointers as compatible so long as the name of the thing they refer to is the same, similar to how any pointer is compatible with a void *. Reported by: marck Reviewed by: Domagoj Stolfa MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48254 (cherry picked from commit 4196f227aa84448ef3cae9e99678fbe787726cf7) --- .../opensolaris/lib/libdtrace/common/dt_parser.c | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c index 2b85dd2b26b6..d1ebaa8791da 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c @@ -1130,6 +1130,29 @@ dt_node_is_ptrcompat(const dt_node_t *lp, const dt_node_t *rp, lp_is_void = ctf_type_encoding(lfp, lref, &e) == 0 && IS_VOID(e); rp_is_void = ctf_type_encoding(rfp, rref, &e) == 0 && IS_VOID(e); + /* + * Let a pointer to a forward declaration be compatible with a pointer + * to a struct or union of the same name. + */ + if (lkind == CTF_K_POINTER && rkind == CTF_K_POINTER) { + int lrkind, rrkind; + + lrkind = ctf_type_kind(lfp, lref); + rrkind = ctf_type_kind(rfp, rref); + if (lrkind == CTF_K_FORWARD || rrkind == CTF_K_FORWARD) { + const char *lname, *rname; + char ln[DT_TYPE_NAMELEN], rn[DT_TYPE_NAMELEN]; + + lname = ctf_type_name(lfp, lref, ln, sizeof (ln)); + rname = ctf_type_name(rfp, rref, rn, sizeof (rn)); + if (lname != NULL && rname != NULL && + strcmp(lname, rname) == 0) { + lp_is_void = lrkind == CTF_K_FORWARD; + rp_is_void = rrkind == CTF_K_FORWARD; + } + } + } + /* * The types are compatible if both are pointers to the same type, or * if either pointer is a void pointer. If they are compatible, set From nobody Wed Jan 15 18:10:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYDYm5fFfz5kSDq; Wed, 15 Jan 2025 18:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYDYm4ccpz3D0C; Wed, 15 Jan 2025 18:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736964620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jg+GuHQzjJeoP5DLfMx2QEVpqVzWVvxI71Jt9fkUvSY=; b=aSVrlYoyxWx1IUdlvOGDkillaTLYjEGFrf8mbixYKJLsk3uUipWGUT1AIKLGCJWH4NtSUc yZ/kAXaf+Y+sreHpyZee1lFUx+CaHW/X9R1cOVPhYEze1awLWNKfEEPS+nDoECWvmbvOem Vk8C9bfEcVqwolazAGlikHC6rKoXUAzAv8Uir8bSntA0aRq2LB7CI+nZ7fKfJ2T4P5aMu3 SgwAo8491s4NO7Gv0Q9UCSWtcC7+Sq62CCK6cDXVH4LBGqnh6yybPrAYLzwFC02ZFJNzwE Gv8Egj2tx7IUfOsj8G8ekt6t/8zNxhVpSxwPN4BOHEPDeIX0Ncejt17zcRjB4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736964620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jg+GuHQzjJeoP5DLfMx2QEVpqVzWVvxI71Jt9fkUvSY=; b=sdNMnS1i5srquD/2UTI74vxcLX8Rar5uRLPVuNe8aGBOPPyxoFEohLUs9WCcB+iOrpEpZA pkfOZhrQJoleX1KIXbzXAWnZANSQCQ+r4ZwPsPusmyy4TQJMWNN02q2LMPwV90ofbLEz3J RA/P8fOYLW6qKWs/F/aLifM8bJmPhajBLL8hz2p1Z0KLys+VWw5ku+qDH9ODP56HBAUcQf V3U+8iis4lfnjul4o8L1ecoUVfDJGsKRnX22EwvlGmYIrk4y7EEtAChW6W3lBBfIbADFYj bHJ9B318muMEhh9/4K0iC8lCPl2x12Xb5leJR7x0FpZsfNYxzREx5CZDrrpaog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736964620; a=rsa-sha256; cv=none; b=JxxOdlcm0acYPlaphNQWL58pBJlCAbg4b9p8ilxFNim9zwOfWbAT83xD/IGBWAtZlXjhuk 1g8BJPoNStHNUBuNComJReu5A3EWCvMy7DYaUgp+ou5Je4JTEQhtcY7J0ATlCgbAxk6oYt tUhEXePH1o2TlFA0IP6bNDut/7Xn5+o0iGDibOZztCpM8Q4WbvZlCpA8+R146tHxA54E3X rGFX3F+M34KLG6wGPpw3Yq7vF+fAzp83e3GuPFMjnaIng1NN4yh/+iKd5/p/U96tBqH/Gh qJVlae9wnBynKUe7l/5OB+88Ky3jC6gZBzVTkIOSUDh31tUGuXXAO5VVqEce8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYDYm3xMXzxXX; Wed, 15 Jan 2025 18:10: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 50FIAKCu000954; Wed, 15 Jan 2025 18:10:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FIAKsL000951; Wed, 15 Jan 2025 18:10:20 GMT (envelope-from git) Date: Wed, 15 Jan 2025 18:10:20 GMT Message-Id: <202501151810.50FIAKsL000951@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9e36aaf0c24c - main - munmap.2: Unaligned addresses do not return error List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9e36aaf0c24cf158e83c69c1d2312c000c3c36f3 commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3 Author: Ed Maste AuthorDate: 2025-01-15 16:52:58 +0000 Commit: Ed Maste CommitDate: 2025-01-15 18:09:37 +0000 munmap.2: Unaligned addresses do not return error We previously claimed that non-page-aligned addresses would return EINVAL, but the address is in fact rounded down to the page boundary. Reported by: Harald Eilertsen Reviewed by: brooks Sponsored by: The FreeBSD Foundation Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()") Differential Revision: https://reviews.freebsd.org/D48465 --- lib/libsys/munmap.2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/libsys/munmap.2 b/lib/libsys/munmap.2 index dce76d355c1f..560ed0056260 100644 --- a/lib/libsys/munmap.2 +++ b/lib/libsys/munmap.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 22, 2017 +.Dd January 15, 2025 .Dt MUNMAP 2 .Os .Sh NAME @@ -54,8 +54,6 @@ will fail if: .Bl -tag -width Er .It Bq Er EINVAL The -.Fa addr -argument was not page aligned, the .Fa len argument was zero or negative, or some part of the region being unmapped is outside the From nobody Wed Jan 15 18:26:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYDwp1hGPz5kT5x; Wed, 15 Jan 2025 18:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYDwn5vJWz3HnM; Wed, 15 Jan 2025 18:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736965609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fa5U5IVGfg1SL+riqh4bCI1c6xYVljB7YZI0MfMknk=; b=XHm/sT9uHfhalhEykMHOz2fyAIZLtHdbjzhDxcXcNFhsEm410kBlmHT00tOpJ6sKfUP9zM f8WKbucFL8uOMjuwESJw1c3C2xsLbbF3BoeEjkOJ+wdYI3Upy7If7YHoNnfZHPgEO9iVZC VvjJShpJYVJUTUb7BK6RT/lLa2J7dizd9jMpq4qNur1Fw4IUecJUA+2CNKZFJbnfUz7G3A 3sse/9HDkFCA37epaWpkWfhBkoPsd+RSyETaMMQCTaXeAWnsm+Bb15SbgxsEpv9MDiXQHm tU1gYAKOkeRK1nsBpZKUtpOApY0PorSG3qB2v4rmFTRwUB0Z0klA/EbNDCwxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736965609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7fa5U5IVGfg1SL+riqh4bCI1c6xYVljB7YZI0MfMknk=; b=RZrK+B6AZGJ7eKGvXPs5ZIqAqrZHgRUPmFxnGfd+zosuEMT2VOgyvuBomC6HkcClB/42JC 3kNYj+Ga1TCJZ6XOFGAQVhFpzx2XI80YQpBllHoc9Ib1rEKSvrn0ud7GScy2ZD1Ukc3oU5 2X122PlqoScyASNsh1t7nXOn688Wh/rX7Fy28XZsDP3uQTAZpnDKKwxrYvuGM2s47GAiLa 3t9XUtRl1NWM64NfqZAowdI2YxySAx8YpL+Rg716VGTOl3n5MEc41Xc7StanTq512YklaB rrpMy0Wv3o8RrKSBHlpME1pe+lec7xk+/6QFl9iPfC65R6m54Q9UwTj5m7kbAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736965609; a=rsa-sha256; cv=none; b=X5x1heBO+dQZoH4epiwyfBHLmynakUoo7gJgbV88+d9Wlxo+yWHkBYpvXxBHIhFJjWNXzV TuuQDITBYFnyIVeZ32kGkwaW2bSIfmfMCNKnXyR97zeWo1ASSgSI/RFf1utjrErL3tJUeY 7JZCJ+FmJ2LNhvNvp9jEMO0lGaWqvoo00/IkAmm1WLpErfB4yCoActpt5RkKwz7odVqRfP YzJ23ohKgPo+EbLHYSVUz2FqMgqhZI3rtF0PrJXkhRVVuRiS1tD1cB7nq2l6jb/zULgKe4 1EvYwvteivpkrMlvlVFrddddqX38waiekyZEKbDz1ddFsfcHkLJetcF99JaEKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYDwn5B09zxX5; Wed, 15 Jan 2025 18:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50FIQnQM028125; Wed, 15 Jan 2025 18:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FIQnGu028122; Wed, 15 Jan 2025 18:26:49 GMT (envelope-from git) Date: Wed, 15 Jan 2025 18:26:49 GMT Message-Id: <202501151826.50FIQnGu028122@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: e0b7a9b6bee1 - main - RELNOTES: Document recent file handle layout changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0b7a9b6bee16f4855b392c0941e76b7fef777a0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e0b7a9b6bee16f4855b392c0941e76b7fef777a0 commit e0b7a9b6bee16f4855b392c0941e76b7fef777a0 Author: Mark Johnston AuthorDate: 2025-01-15 18:20:50 +0000 Commit: Mark Johnston CommitDate: 2025-01-15 18:21:08 +0000 RELNOTES: Document recent file handle layout changes Reviewed by: olce, rmacklem, imp, emaste Differential Revision: https://reviews.freebsd.org/D48093 --- RELNOTES | 5 +++++ UPDATING | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 5cdb0bde4ac4..515966f8ea08 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +8ae6247aa966, cf0ede720391d, 205659c43d87bd, 1ccbdf561f417, 4db1b113b151: + The layout of NFS file handles for the tarfs, tmpfs, cd9660, and ext2fs + file systems has changed. An NFS server that exports any of these file + systems will need its clients to unmount and remount the exports. + 07cd69e272da: Add a new -a command line option to mountd(8). If this command line option is specified, when diff --git a/UPDATING b/UPDATING index 412eb446f4fd..3eccd089d808 100644 --- a/UPDATING +++ b/UPDATING @@ -33,6 +33,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 15.x IS SLOW: this SoC familly will be selected. Also a new rk8xx device was added, this select the base driver for Rockchip PMIC. +20241223: + The layout of NFS file handles for the tarfs, tmpfs, cd9660, and ext2fs + file systems has changed. An NFS server that exports any of these file + systems will need its clients to unmount and remount the exports. + 20241216: The iwm(4) firmwares are no longer compiled as kernel modules but instead shipped as raw files. For pkgbase users if you use iwm(4) you will need From nobody Wed Jan 15 19:28:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYGJ22sjtz5kXVM; Wed, 15 Jan 2025 19:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYGJ220S9z3QVr; Wed, 15 Jan 2025 19:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736969314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAvvdiXoCNO/E5S5ykmHncL8e0LcFFAWaXIB+R27CtY=; b=Era9wJ4YvP1tnKv76MIhrEx0y3RPu/CS1/uUVsxqBWMCZUYvzyLXc6gZRrJezanbs1UdKI 8J12b7hI3fzx3ZdYyunlGIRXhQ2TQ+TT5fCzAvgFBC1v+2MiFtaOPb6CWGP6N60GVs8N6t UQKS9m4a8YoHKkRBq5MqJVAl03fBb6yBk+lAjiK2DaJH86NRrQMNIqaeUNVCOTh3p+0X1A 2+TeciWrBBbYMPL0/ZXflbp7dhkHsCGCiR8zl/Waij1QAP/290Fopp4TW+1b0F1/8lTpZH m4vsZ5O/0TVw5LhOI9vxEyQPUYXSggQ7cxM8uAPcA0sLQjLUmr2+/CrCIGrDHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736969314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mAvvdiXoCNO/E5S5ykmHncL8e0LcFFAWaXIB+R27CtY=; b=RlQ9p2FEqqeH3b67oZIuLu9vrtfNOk4dWoqhGFR65W4GB3Xm9/85yWqODfS6LRdsIcUDVi fx5AUOiy2snE7o4uMLgJxvim8EPg64uPMwD8ugcz4y0S44G67LJ7/iHM5BIwkiyEocDh5V /wD7ftQoYZw+bE6H0yopg1UnSnmYSc/sfaFae4+YD6NB1O45N1n9w+Np/cahK3N1gUei84 bXIr3iJj8QPm5kPjrz6zs5yBLZCVNif5UQFMhZ7FEQfGrLAeBEq64wuLxv5WKwODHIoluD gNOqdp1lp26H5Q6TWDJNv7MK1WmyFBxokO5LYRXn74FNY+1pMVbfuiM5AKRVdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736969314; a=rsa-sha256; cv=none; b=XHufmSO9M4VZuEWrC4pePaCRG2+Yv+Fs/PkIJ3tUuOIGEWe+Fd7rawDwRPAVsU1lKcLJck +MRjtwMBQji1OFGY75jvkh5ptaGWDdl75VbFqh21L2qhJ54D8iw0amH6fFS6inSJW1N3BS p9tux17rmARw7HN0rXvy/19CL/GJWI7oG1vHsGvmpaLplWLdMKKHUYzVTcb+8HxQj8R5B2 GwmG4fHyGR1Ye+jYtgcdohUH+PNWNo9mCFCb4S/rLhnc5XBQ04MEuIamXBC4KLTLP6JVUV 8FHQEfwPukoZWGSW6F+d2rQ1t9c4CvRTZ3bNy1WIZzrAB17A9Zdo2KHsrcgljw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYGJ21bTMz106B; Wed, 15 Jan 2025 19:28: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 50FJSYjb041524; Wed, 15 Jan 2025 19:28:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FJSYjk041521; Wed, 15 Jan 2025 19:28:34 GMT (envelope-from git) Date: Wed, 15 Jan 2025 19:28:34 GMT Message-Id: <202501151928.50FJSYjk041521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: c0661bbbd0d9 - main - depend-cleanup: Fix match expression for AArch64 asm files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0661bbbd0d917f602d42fe4bb9ee3edc5970c8a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c0661bbbd0d917f602d42fe4bb9ee3edc5970c8a commit c0661bbbd0d917f602d42fe4bb9ee3edc5970c8a Author: Ed Maste AuthorDate: 2025-01-14 21:36:08 +0000 Commit: Ed Maste CommitDate: 2025-01-15 19:28:03 +0000 depend-cleanup: Fix match expression for AArch64 asm files Some routines (strcmp, strncmp, strlen) switched from an asm implementation from arm-optimized-routines to a new asm implementation. The default clean_dep rule matches both the old and new dependency string, resulting in those routines always being rebuilt. Instead use "arm-optimized-routines" (i.e., contrib subdir for the previous implementation) as the matching regex. Also delete the old generated src files. Reviewed by: fuz Sponsored by: The FreeBSD Foundation Fixes: d57842ed2dad ("depend-cleanup.sh: clean up after AArch64 libc SIMD merge") Differential Revision: https://reviews.freebsd.org/D48459 --- tools/build/depend-cleanup.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 6f97747183a8..30c303d4f90f 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -242,7 +242,8 @@ fi if [ $MACHINE_ARCH = aarch64 ]; then # 20250110 5e7d93a60440 add strcmp SIMD implementation - clean_dep lib/libc strcmp S + clean_dep lib/libc strcmp S arm-optimized-routines + run rm -f "$OBJTOP"/lib/libc/strcmp.S # 20250110 b91003acffe7 add strspn optimized implementation clean_dep lib/libc strspn c @@ -260,7 +261,8 @@ if [ $MACHINE_ARCH = aarch64 ]; then clean_dep lib/libc strlcpy c # 20250110 25c485e14769 add strncmp SIMD implementation - clean_dep lib/libc strncmp S + clean_dep lib/libc strncmp S arm-optimized-routines + run rm -f "$OBJTOP"/lib/libc/strncmp.S # 20250110 bad17991c06d add memccpy SIMD implementation clean_dep lib/libc memccpy c @@ -272,7 +274,8 @@ if [ $MACHINE_ARCH = aarch64 ]; then clean_dep lib/libc strlcat c # 20250110 3863fec1ce2d add strlen SIMD implementation - clean_dep lib/libc strlen S + clean_dep lib/libc strlen S arm-optimized-routines + run rm -f "$OBJTOP"/lib/libc/strlen.S # 20250110 79e01e7e643c add bcopy & bzero wrapper clean_dep lib/libc bcopy c From nobody Wed Jan 15 20:31:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYHhR0411z5kcY3; Wed, 15 Jan 2025 20:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYHhQ6JLKz3ZBp; Wed, 15 Jan 2025 20:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736973078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwG9Qvd7d81aV6bz7sM9Qk3+/SdxbS0yE6to5DEl37c=; b=k0rO38wF+995y9J7uNAlxEutAfWeNjIFuOVVKNVl+J+nwyra3FUUBzqiJOudiLQD+ArIDp NqOgEX1W8Mj4iRxHb3KLYWVcJDOl+VsslC159V6dhk43hCBSmKdrpTQz9pjy9gOkFozm/I 5uXZPOF/zzNOr+B1ULQV2PP5IhxWG6HPLYGY2TonERD/NVPmlh1OUCbgzJFNCj0wO67J2D CQXYyWK5sOnPu6hxherkqhkvnKBVMUJs8wWbIM/GsGui7KrmPstHlHRySrjlmutoLE8ndk 7PR8M7ttPgbQ0YjgO4Vf6wd36wqBotPlaFd7iDVTWsZT23pWIhEH5OUaZVGb4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736973078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wwG9Qvd7d81aV6bz7sM9Qk3+/SdxbS0yE6to5DEl37c=; b=O5UpRMqNzStwfxeoIof6YFx5CttdKSaRhmT3OH/1Zyoq+7xAPk7JREWGETVqHDL6IeFqMQ bk3THv5T3EA7yJiuSIA0kf3NrtQuUymQRki6MeZL5djUqghon4yzLr70t/in+a+IZojpWP zfddeyh8gITRo/jKXvuq/RitD5MuKUcSGXkwz+zEz0g9WEg85WFAoaowvpXftS7mcsdANV VTkIWj5/tKE9fesUn28EW0UpE/HcF8qdLxdEoVvcHpjNWao73HrEYfgW/Vn2tQESu7h28B 9/0hYnDei6fUvViDoDjPDwHS+KWdipfou4ga4yeT0J5gkpXac3IEYCNiLBtV7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736973078; a=rsa-sha256; cv=none; b=BZVWuifU9BH3rKdlbQQJBKDBGT2+pSURgD9Q6EOKveBs5TdgIu/pRd2532mNvObbBffCKM dMgJe+25nDIT8sv/zVJpMeRLeHtC+nYt5U4zo51GNEfdAyOy+cT1BrXruAtQ8e+Z+n8pSt 0OHtyU4e8IyLa1BScQ3WDD88HfTvW9MSeGv/VG8I7UTu7J0zqyrvCSjZdvjCKWHWRLM43q 16TA2RnZmdIEm+DGJQksmb7g2B+znl+oLYUbTUbLbxN/oNRa8rwX6FPiz6bati/odROsSf WOhaV+IbLms8kzHCvnLWEgSo0KE3jjk8ZHMvJ5KaO2zwnswmmBDJwco2ka/jhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYHhQ5qdsz11vG; Wed, 15 Jan 2025 20:31: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 50FKVIIA065994; Wed, 15 Jan 2025 20:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FKVIHK065991; Wed, 15 Jan 2025 20:31:18 GMT (envelope-from git) Date: Wed, 15 Jan 2025 20:31:18 GMT Message-Id: <202501152031.50FKVIHK065991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 9f31c4746041 - main - fusefs: add a test for the max_read= mount option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f31c47460412ab6ccae36a70ca019b47423ccec Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9f31c47460412ab6ccae36a70ca019b47423ccec commit 9f31c47460412ab6ccae36a70ca019b47423ccec Author: Alan Somers AuthorDate: 2025-01-10 21:36:02 +0000 Commit: Alan Somers CommitDate: 2025-01-15 20:29:15 +0000 fusefs: add a test for the max_read= mount option When set, this limits the amount of data that the kernel will request of the server in any single read operation. The option has always been available in our fusefs implementation, but never covered by the test suite. MFC after: 2 weeks Sponsored by: ConnectWise --- tests/sys/fs/fusefs/mockfs.cc | 10 +++++++- tests/sys/fs/fusefs/mockfs.hh | 8 ++++++- tests/sys/fs/fusefs/read.cc | 53 +++++++++++++++++++++++++++++++++++++++++++ tests/sys/fs/fusefs/utils.cc | 2 +- tests/sys/fs/fusefs/utils.hh | 2 ++ 5 files changed, 72 insertions(+), 3 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 502f22a1e980..1fd2d5e358b1 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -416,7 +416,8 @@ void MockFS::debug_response(const mockfs_buf_out &out) { } } -MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, +MockFS::MockFS(int max_read, int max_readahead, bool allow_other, + bool default_permissions, bool push_symlinks_in, bool ro, enum poll_method pm, uint32_t flags, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool noclusterr, unsigned time_gran, bool nointr, bool noatime, @@ -424,6 +425,7 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, : m_daemon_id(NULL), m_kernel_minor_version(kernel_minor_version), m_kq(pm == KQ ? kqueue() : -1), + m_maxread(max_read), m_maxreadahead(max_readahead), m_pid(getpid()), m_uniques(new std::unordered_set), @@ -470,6 +472,12 @@ MockFS::MockFS(int max_readahead, bool allow_other, bool default_permissions, build_iovec(&iov, &iovlen, "from", __DECONST(void *, "/dev/fuse"), -1); sprintf(fdstr, "%d", m_fuse_fd); build_iovec(&iov, &iovlen, "fd", fdstr, -1); + if (m_maxread > 0) { + char val[10]; + + snprintf(val, sizeof(val), "%d", m_maxread); + build_iovec(&iov, &iovlen, "max_read=", &val, -1); + } if (allow_other) { build_iovec(&iov, &iovlen, "allow_other", __DECONST(void*, &trueval), sizeof(bool)); diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 38efcd049a61..1de77767d0c9 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -294,6 +294,12 @@ class MockFS { int m_kq; + /* + * If nonzero, the maximum size in bytes of a read that the kernel will + * send to the server. + */ + int m_maxread; + /* The max_readahead file system option */ uint32_t m_maxreadahead; @@ -355,7 +361,7 @@ class MockFS { bool m_quit; /* Create a new mockfs and mount it to a tempdir */ - MockFS(int max_readahead, bool allow_other, + MockFS(int max_read, int max_readahead, bool allow_other, bool default_permissions, bool push_symlinks_in, bool ro, enum poll_method pm, uint32_t flags, uint32_t kernel_minor_version, uint32_t max_write, bool async, diff --git a/tests/sys/fs/fusefs/read.cc b/tests/sys/fs/fusefs/read.cc index 9693428914e6..e9c79ba2ffda 100644 --- a/tests/sys/fs/fusefs/read.cc +++ b/tests/sys/fs/fusefs/read.cc @@ -111,6 +111,13 @@ class ReadAhead: public Read, } }; +class ReadMaxRead: public Read { + virtual void SetUp() { + m_maxread = 16384; + Read::SetUp(); + } +}; + class ReadNoatime: public Read { virtual void SetUp() { m_noatime = true; @@ -840,6 +847,52 @@ TEST_F(Read, mmap) leak(fd); } + +/* When max_read is set, large reads will be split up as necessary */ +TEST_F(ReadMaxRead, split) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + uint64_t ino = 42; + int fd; + ssize_t bufsize = 65536; + ssize_t fragsize = bufsize / 4; + char *rbuf, *frag0, *frag1, *frag2, *frag3; + + rbuf = new char[bufsize](); + frag0 = new char[fragsize](); + frag1 = new char[fragsize](); + frag2 = new char[fragsize](); + frag3 = new char[fragsize](); + memset(frag0, '0', fragsize); + memset(frag1, '1', fragsize); + memset(frag2, '2', fragsize); + memset(frag3, '3', fragsize); + + expect_lookup(RELPATH, ino, bufsize); + expect_open(ino, 0, 1); + expect_read(ino, 0, fragsize, fragsize, frag0); + expect_read(ino, fragsize, fragsize, fragsize, frag1); + expect_read(ino, 2 * fragsize, fragsize, fragsize, frag2); + expect_read(ino, 3 * fragsize, fragsize, fragsize, frag3); + + fd = open(FULLPATH, O_RDONLY); + ASSERT_LE(0, fd) << strerror(errno); + + ASSERT_EQ(bufsize, read(fd, rbuf, bufsize)) << strerror(errno); + ASSERT_EQ(0, memcmp(rbuf, frag0, fragsize)); + ASSERT_EQ(0, memcmp(rbuf + fragsize, frag1, fragsize)); + ASSERT_EQ(0, memcmp(rbuf + 2 * fragsize, frag2, fragsize)); + ASSERT_EQ(0, memcmp(rbuf + 3 * fragsize, frag3, fragsize)); + + delete[] frag3; + delete[] frag2; + delete[] frag1; + delete[] frag0; + delete[] rbuf; + leak(fd); +} + /* * The kernel should not update the cached atime attribute during a read, if * MNT_NOATIME is used. diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index 831ded0c0815..d059221b2e55 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -154,7 +154,7 @@ void FuseTest::SetUp() { m_maxwrite = MIN(libfuse_max_write, (uint32_t)m_maxphys / 2); try { - m_mock = new MockFS(m_maxreadahead, m_allow_other, + m_mock = new MockFS(m_maxread, m_maxreadahead, m_allow_other, m_default_permissions, m_push_symlinks_in, m_ro, m_pm, m_init_flags, m_kernel_minor_version, m_maxwrite, m_async, m_noclusterr, m_time_gran, diff --git a/tests/sys/fs/fusefs/utils.hh b/tests/sys/fs/fusefs/utils.hh index 506e8a985212..9dd8dad6b5cc 100644 --- a/tests/sys/fs/fusefs/utils.hh +++ b/tests/sys/fs/fusefs/utils.hh @@ -55,6 +55,7 @@ bool is_unsafe_aio_enabled(void); extern const uint32_t libfuse_max_write; class FuseTest : public ::testing::Test { protected: + uint32_t m_maxread; uint32_t m_maxreadahead; uint32_t m_maxwrite; uint32_t m_init_flags; @@ -80,6 +81,7 @@ class FuseTest : public ::testing::Test { unsigned long m_maxphys; FuseTest(): + m_maxread(0), m_maxreadahead(0), m_maxwrite(0), m_init_flags(0), From nobody Wed Jan 15 20:38:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYHs100jsz5kd45; Wed, 15 Jan 2025 20:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYHs04Pptz3c7v; Wed, 15 Jan 2025 20:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736973524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2th973HEIw6ewfVzlmHCHpoPtYFVJkCD+XkkrwEiJ3c=; b=JWZe7n5BiqnYhsOzLyA/MMT9WvoG3xuybDzceW1YV+I2lEYPDzyRaky9/LzvaHXl088Nxr u5JcmljQCi8eOMJnVJqeHBeEJL/uqHewmE6Q/QXhReAfGO7BZ0yGRfqI/B4r7cHgONm8VF mPUZ/Fh9GGY0a0jKT9op7NPa9D2Qhea6m9l0awy8ZoJBoX3STDvnL7ltQAuUeAw1TJdWsJ qYKIcYfnlgoN48gzL+WHyHm9y7B+xCqN4lI0uyb3J+f3xU66AkmN3ip4uBqJf6Nov5R/TJ LNJNGRGTVwLzcb1hEECb/G6VtRsnLBd7BDiXCHEmMcZQJ7xV+9BIARf8RAQQKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736973524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2th973HEIw6ewfVzlmHCHpoPtYFVJkCD+XkkrwEiJ3c=; b=mVmhkJUJnEu++UZnhDvlm6Nq3bKrsbXqXdC5HuFhOeGFF3Gss+Yf+mqJChtYwCoPs4k8l9 kzAtAbp/qqEA4aRr1kvG5Ji0XSGbEgHng+C6oC0iOrQQpxE1FJuwc3ULCNkb51Qrvue/KO /m2gHjf0a7L2VhbZL0AjRMXTkca30HZpZxdxV+udEn8CPid54ngcOsFHAbJSZLlbkpkppy DAdmT5Q2gWrc2JWcTDRl883cYfggI94cgGq5QRO8dND1S5cVcRfA9/Gf0GPrlw3Bgi7ILF 0Wn9O7BTr/cHUo50d7MFcDMCs7K6FSCmd5tmVdRxffwycaX0qCSQEJkihHhAHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736973524; a=rsa-sha256; cv=none; b=YwAT5LZtn5kE5gP1tUw6dxm0qpiHZupkYKRvMTUIzYsqdfOgDCt2yIg10fIGK+A8ticc/x Ul+0hUFI+OE7iAOBvzBG+Q1UpQ69oKwKA4VoO9N0BnkkOa3cS81egVNtE8FyfgHipLsQU4 o/BqXJ5t3BDEcyXjarT9YcyxCJjeBeAAPQr3WoA8gMJK1AAKjypzks2/ru6J8gFGPbkXu7 oYZ6Grd9N3Ju7hyz6LfqIey5Mq4D8LV3ITZZQnZOCEXM9ogLWGrQZ+C65ewDvtOezF8jOm aKw0EWI9VKy3Q0PIs/PgUIotRvUxvufllsJhsI7btkpRfP7y6W/qLAdNpQqNSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYHs03k0Sz11N8; Wed, 15 Jan 2025 20:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50FKcisT073080; Wed, 15 Jan 2025 20:38:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FKcidm073077; Wed, 15 Jan 2025 20:38:44 GMT (envelope-from git) Date: Wed, 15 Jan 2025 20:38:44 GMT Message-Id: <202501152038.50FKcidm073077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 564c732b5c02 - main - fusefs: slightly better debugging in the tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 564c732b5c0221373d067c9a21da09b310e676ae Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=564c732b5c0221373d067c9a21da09b310e676ae commit 564c732b5c0221373d067c9a21da09b310e676ae Author: Alan Somers AuthorDate: 2025-01-10 18:20:06 +0000 Commit: Alan Somers CommitDate: 2025-01-15 20:37:37 +0000 fusefs: slightly better debugging in the tests If the kernel rejects a response written by the server, print it. That would most likely be due to an error in the test logic. MFC after: 2 weeks Sponsored by: ConnectWise --- tests/sys/fs/fusefs/mockfs.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 1fd2d5e358b1..532dd27d77b9 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -1034,6 +1034,10 @@ void MockFS::write_response(const mockfs_buf_out &out) { ASSERT_EQ(-1, r); ASSERT_EQ(out.expected_errno, errno) << strerror(errno); } else { + if (r <= 0 && errno == EINVAL) { + printf("Failed to write response. unique=%lu:\n", + out.header.unique); + } ASSERT_TRUE(r > 0 || errno == EAGAIN) << strerror(errno); } } From nobody Wed Jan 15 21:10:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYJYs1j0Gz5kflD; Wed, 15 Jan 2025 21:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYJYs11sDz3gV4; Wed, 15 Jan 2025 21:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736975441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QP1hzsRs/KmCaEYm54FPdAfSY1ZEQEF/76dUiWhkMJw=; b=Qozh9e4t7RIY2gtcKiix0jgdwskEjBfL4JCk8mphV4i942O9stuem6Ky0qk2QunIBeMRBZ 4Mkq1zNskMv+LsCM/uBymA6K8DdAIa/fBSdErFOJlJ9ygR/VlIn2yHSrCXQRrIt4OoiJz+ oR3KYN/HnNKbQKmH4kr2okzMNPpth2+U79B0qjutrC1lTKK5QNr0S5P/Ke3Iy4afRUhRt3 yick+FC28XaQLDc2KlC/iRx+qRaDSulYLNpS608pUz241hT2hoCn76qaCMAQqi52qQUOIO YWzAuGaXr/y99cgm5F2Nvu/kBcGas1sIi21LOgpFIZX2VChbUBNs4XvfBDfOYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736975441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QP1hzsRs/KmCaEYm54FPdAfSY1ZEQEF/76dUiWhkMJw=; b=t3tAOU/iBoWj1xjWyN4FRqKoul1KapxtdEHJ7MN2/qSLaSMsuUpHCq7/Ikp7Xnsgyqrbde 0bHTGYN0wFjHQlHcCM0UhY4bsQ8yzJfaYsaT2RG/qPKo3HfMiTTL3aYdWNprlaXhALHA43 mA5wvywGY4K7TFdPoq96rJN/6xH/TagkHpxkgRenMS9iJH/AXqn0IvUbUxMOOS5Ot06/Xu ZI2F3tq5bWYvlR7Ke4HnJSuI/nYtYmUopPHPWHO/JD1zkrJZCbUj7CF8bq1VOAy5hTjUH5 jUbjZryiQlg++NHirw02uAGP7iEYBtqbMdr8f+ZqP4RwTVOud2eQHNIJrd1Edw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736975441; a=rsa-sha256; cv=none; b=I4g+Q13D2u2bzY7mIxR+BwPTTbyL5PByAKLXkZggf/Plv/5CFKKWQThscTrISTlB6wP4nJ FtX7pPPklrjAFBVzPr8JrqX+yJv9uZbe3DGAOcFONlO6N/QXFX8sczIMf1SiVwQxd7dHxW HfN94mgcFWLCc/fNoHpC7/e29ge8SBDedswr9bMJb+kheBwQbfjmoR/2xAOg+rgCy+bFxt c4LDlpJO2GYex+rRhtaXSJrDVDPc8XanZ2wCaWARcD9Xvmj7kKCBiMTMzYge3XwiYCrNHT Vp4N0WRuyyx8mCIh8QvwZ0AKQ1Lp1ki/vtoCAD6VOJOb0pfBspJj68DQznMZAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYJYs0Vhjz12fK; Wed, 15 Jan 2025 21:10: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 50FLAe3g042093; Wed, 15 Jan 2025 21:10:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FLAeFF042090; Wed, 15 Jan 2025 21:10:40 GMT (envelope-from git) Date: Wed, 15 Jan 2025 21:10:40 GMT Message-Id: <202501152110.50FLAeFF042090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: c18a6c15f415 - main - Use ffs_sbget() to replace open-coded superblock reload. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2 Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2 commit c18a6c15f4152029b6d1d0f64aa1ff36faceb9b2 Author: Kirk McKusick AuthorDate: 2025-01-15 21:08:42 +0000 Commit: Kirk McKusick CommitDate: 2025-01-15 21:08:42 +0000 Use ffs_sbget() to replace open-coded superblock reload. No functional change intended. Tested-by: Peter Holm MFC-after: 1 week --- sys/ufs/ffs/ffs_vfsops.c | 87 ++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 65 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 9e94d368d7c9..a739e0220ec9 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -578,8 +578,12 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && - (error = ffs_reload(mp, 0)) != 0) + (error = ffs_reload(mp, 0)) != 0) { return (error); + } else { + /* ffs_reload replaces the superblock structure */ + fs = ump->um_fs; + } if (fs->fs_ronly && !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { /* @@ -740,26 +744,20 @@ ffs_cmount(struct mntarg *ma, void *data, uint64_t flags) * Things to do to update the mount: * 1) invalidate all cached meta-data. * 2) re-read superblock from disk. - * 3) re-read summary information from disk. - * 4) invalidate all inactive vnodes. - * 5) clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags, allowing secondary - * writers, if requested. - * 6) invalidate all cached file data. - * 7) re-read inode data for all active vnodes. + * 3) If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. + * 4) invalidate all cached file data. + * 5) re-read inode data for all active vnodes. */ int ffs_reload(struct mount *mp, int flags) { struct vnode *vp, *mvp, *devvp; struct inode *ip; - void *space; struct buf *bp; struct fs *fs, *newfs; struct ufsmount *ump; - ufs2_daddr_t sblockloc; - int i, blks, error; - uint64_t size; - int32_t *lp; + int error; ump = VFSTOUFS(mp); @@ -782,31 +780,22 @@ ffs_reload(struct mount *mp, int flags) /* * Step 2: re-read superblock from disk. */ - fs = VFSTOUFS(mp)->um_fs; - if ((error = bread(devvp, btodb(fs->fs_sblockloc), fs->fs_sbsize, - NOCRED, &bp)) != 0) + if ((error = ffs_sbget(devvp, &newfs, UFS_STDSB, 0, M_UFSMNT, + ffs_use_bread)) != 0) return (error); - newfs = (struct fs *)bp->b_data; - if ((newfs->fs_magic != FS_UFS1_MAGIC && - newfs->fs_magic != FS_UFS2_MAGIC) || - newfs->fs_bsize > MAXBSIZE || - newfs->fs_bsize < sizeof(struct fs)) { - brelse(bp); - return (EINTEGRITY); - } /* - * Preserve the summary information, read-only status, and - * superblock location by copying these fields into our new - * superblock before using it to update the existing superblock. + * Replace our superblock with the new superblock. Preserve + * our read-only status. */ - newfs->fs_si = fs->fs_si; + fs = VFSTOUFS(mp)->um_fs; newfs->fs_ronly = fs->fs_ronly; - sblockloc = fs->fs_sblockloc; - bcopy(newfs, fs, (uint64_t)fs->fs_sbsize); - brelse(bp); + free(fs->fs_csp, M_UFSMNT); + free(fs->fs_si, M_UFSMNT); + free(fs, M_UFSMNT); + fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); + ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -816,42 +805,10 @@ ffs_reload(struct mount *mp, int flags) fs->fs_pendinginodes = 0; } UFS_UNLOCK(ump); - - /* - * Step 3: re-read summary information from disk. - */ - size = fs->fs_cssize; - blks = howmany(size, fs->fs_fsize); - if (fs->fs_contigsumsize > 0) - size += fs->fs_ncg * sizeof(int32_t); - size += fs->fs_ncg * sizeof(uint8_t); - free(fs->fs_csp, M_UFSMNT); - space = malloc(size, M_UFSMNT, M_WAITOK); - fs->fs_csp = space; - for (i = 0; i < blks; i += fs->fs_frag) { - size = fs->fs_bsize; - if (i + fs->fs_frag > blks) - size = (blks - i) * fs->fs_fsize; - error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, - NOCRED, &bp); - if (error) - return (error); - bcopy(bp->b_data, space, (uint64_t)size); - space = (char *)space + size; - brelse(bp); - } /* - * We no longer know anything about clusters per cylinder group. + * Step 3: If requested, clear MNTK_SUSPEND2 and MNTK_SUSPENDED flags + * to allow secondary writers. */ - if (fs->fs_contigsumsize > 0) { - fs->fs_maxcluster = lp = space; - for (i = 0; i < fs->fs_ncg; i++) - *lp++ = fs->fs_contigsumsize; - space = lp; - } - size = fs->fs_ncg * sizeof(uint8_t); - fs->fs_contigdirs = (uint8_t *)space; - bzero(fs->fs_contigdirs, size); if ((flags & FFSR_UNSUSPEND) != 0) { MNT_ILOCK(mp); mp->mnt_kern_flag &= ~(MNTK_SUSPENDED | MNTK_SUSPEND2); From nobody Wed Jan 15 21:49:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYKQm2STLz5kjRM; Wed, 15 Jan 2025 21:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYKQm1pVrz3kMK; Wed, 15 Jan 2025 21:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736977776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhmJ1Hn12SL2hqO5s/axnmNU5Dd1snIZG+fsv6jeu8M=; b=CNQjsEDzTPzYVJ1iaTz2wI6cJsWPFgkWT2bVMRbNIphDqUYn9dX24veP+8QZmvJfdEjPKK 4NIaGJeJhUesTVphdQ8BHqkw/WkcKnCFCnzo12ZR4V1fBPVKIRIZv8EUSNg62Rxrf0Ytbo xBTZ39JVAF4bU8aHsCY9wbTj3I1jTmB7tiZ66wuU5dm76f+ps1Izb/cATK+rVL9q6Uni9n MbPyffH5iLogHTzkVUsB/IyTtPHVtCrENzZzf52P0uWp1f2pYuVOut2vaOrnxRb4Vrz5Yq iloe2UfngGzs8fAQo/tp/RViaG0sCgjXZDPNp561uO0dWLK3jzEnQzbdEDaOMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736977776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhmJ1Hn12SL2hqO5s/axnmNU5Dd1snIZG+fsv6jeu8M=; b=ABk7kxQnyNQr2+jJoumJ3xJMfIeb+0+pEembaLFEhtQD2Pfv/7iMJJ5DR2Woj0HjlcKkPO JLJOmVPPySwKrcgwJruPoV7VMA0DNsZlP2AtCCQaFJVUDPYW0jK8Qc7e8Q+Ad9aF5s9zSP qGFe0xwPcZd1+D4kpE5a3XNPZN40mD2tZgl6HJnBqzvrKi6OqXMc7FgNGkLO3lERUmHpuP NK+LfvTI+tr5e0RGDRtsdZcZav4oqYQQS/1kFChNAFQC7bkCSAwbl2+B8yDM7pkmumZHft 7xSlGtjv7HhqK5c8hC0Q3v6AKCfYisPQ+Iri18g9loWBN/rxmaD379n54G/pwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736977776; a=rsa-sha256; cv=none; b=m3ZNqWfWIWvm2lLVThAYGZGlYkpJc5k4KNI8TXaH3erNhMbT8KR4lXRaP8ejClmEkEMlO4 gN4Bj/9Ji0ibobl2furk1G1IzgxrEaMRrKOX41eoQP2EGxYMOMM1scSvNuU8pjzxGKPAai MiWNudokGS/JmKubyPh8MmjfQEDFE5UajJVtAjfl6AW28jVv8L6ieXsJhoCkRkPtJ8gfw/ Qn2ENTmywZObBmNZGm2gyN1Cj19mLVIolFCQKowMeTHTe53tnMReI5H0tnk98szI4lSCw5 1fXqf2pscDAjaEWoPVhLv8I4w2wvc36clb6BoxVtRjnz+BlbrmruyM4LE9EI4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYKQm1BbZz13vk; Wed, 15 Jan 2025 21:49: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 50FLnaMi004570; Wed, 15 Jan 2025 21:49:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FLna4b004567; Wed, 15 Jan 2025 21:49:36 GMT (envelope-from git) Date: Wed, 15 Jan 2025 21:49:36 GMT Message-Id: <202501152149.50FLna4b004567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fab411c4fd52 - main - munmap.2: Remove EINVAL for negative len List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fab411c4fd5224e3dd44e0eb288d60b27480e2d1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fab411c4fd5224e3dd44e0eb288d60b27480e2d1 commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1 Author: Ed Maste AuthorDate: 2025-01-15 21:44:31 +0000 Commit: Ed Maste CommitDate: 2025-01-15 21:49:21 +0000 munmap.2: Remove EINVAL for negative len len is unsigned (it is size_t), so cannot be negative. Sponsored by: The FreeBSD Foundation --- lib/libsys/munmap.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsys/munmap.2 b/lib/libsys/munmap.2 index 560ed0056260..d6b53f1bcf19 100644 --- a/lib/libsys/munmap.2 +++ b/lib/libsys/munmap.2 @@ -55,7 +55,7 @@ will fail if: .It Bq Er EINVAL The .Fa len -argument was zero or negative, or +argument was zero, or some part of the region being unmapped is outside the valid address range for a process. .El From nobody Wed Jan 15 22:06:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYKpW0vtqz5kkDR; Wed, 15 Jan 2025 22:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYKpW08jKz3lsH; Wed, 15 Jan 2025 22:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736978803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uKru6bni5aRRSzhcR8WEk9SHF7pQJ7X5sOd96TAsbyg=; b=xM55OsweFBa2iCR94dJuoSZKOXmNxeBJFwuVUsF3dLuZ2ypN55R+zAvaXgwdQe4j0eBUtI sduQrA5bUJ4MXM9MPdOmUfhh7ERJw/4HwZEiyyue83Eg/dudApHvStvKZf5LytNjKMBjQh uON/JFRK/liHzRBOZCQWGUbPS90XwgtpEnQTc/95yK8mErMcZx5nsXxaf6cxMd+7U/ooeo XMmjivUM4P1gBRHcT5egJNp6n7RHKNST+foEwd+cAthZUnVdALEk55dzU2GoR/Os/xVEKB ikWciG2/YLLomxcpkgFD2nA3b79ErzNpIEiyGljHooiYLxJBVt0gCtoBpNkr8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736978803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uKru6bni5aRRSzhcR8WEk9SHF7pQJ7X5sOd96TAsbyg=; b=XwpgpiWdqK4alK83duJ4x3inWBUpid4GukSkgWT2GNsfWRZHmFLCqF9/49ZqmXBDE7O7tf dyLQOFOsV41IiWtH5x5qtgPgYDY9eW2Zjrm/KzXIpnie5xnzKUZ44kbMF9CMS1k4dKRYzv tal15rt7PzXoxB02AJxKz0Wih7sgoR2T1BeW2kpZH/H8VEK8LLC6xMs3LUHW4JkKfi3S4O O+cyjUFgA0Q1xnGSqdz9+o2ZU4UvSswqfph7ADigxS37rho7iKt8duOJmUcozY6YI/h3Wq fyXMqbIdFqM9Oa0eX9efRVwJc2CukxiiZOyGy4jMpJcaOu/sQVheoXdJPO23mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736978803; a=rsa-sha256; cv=none; b=RIrBKrpwCoT7Del0UvOVnadqL3AtFc/X7X9h4v3nR/ZmoVYrp0IurCVFkqNLZJcY4xm41I BIIK2VrWGZc/cxL9XZACDQP0ZE/qzOxxDQc3wAxl2/gnycGs/QdIhsyZUNPAnoVsZFlSQy yfww09Edfz3Ii0NS8YT4qOCvT58hNTk32ISdwxe3hUqlKAkPXDlBRWhmkxQ1BSueWTIefh LVbvvGjMOEI9uwX6wHhK1sZrT1XYzfPFBXGHmYcnZk6h41hhxMx2yIb86NF9DCaekYDU8C IXcgMzwDEnYhV80DeGIcWI+su9Hi1Gi5K/DriRzxnzeecwxvT9IYC+XG///Wvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYKpV6FP0z140w; Wed, 15 Jan 2025 22:06: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 50FM6gB3041768; Wed, 15 Jan 2025 22:06:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FM6gJ6041765; Wed, 15 Jan 2025 22:06:42 GMT (envelope-from git) Date: Wed, 15 Jan 2025 22:06:42 GMT Message-Id: <202501152206.50FM6gJ6041765@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: 2d2481c35f5a - main - pf: add extra SCTP multihoming probe points List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d2481c35f5a53322e982e47a2bb8f9085f525b7 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2d2481c35f5a53322e982e47a2bb8f9085f525b7 commit 2d2481c35f5a53322e982e47a2bb8f9085f525b7 Author: Kristof Provost AuthorDate: 2025-01-08 21:23:17 +0000 Commit: Kristof Provost CommitDate: 2025-01-15 22:02:42 +0000 pf: add extra SCTP multihoming probe points Add probe points in the SCTP multihome parsing code. This is intended to help debug a multihome issue, and is expected to be generally useful, so will be included for everyone. MFC after: 2 weeks Sponsored by: Orange Business Services --- sys/netpfil/pf/pf.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 053b0b2ccb31..a49216a9dc20 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -140,6 +140,13 @@ SDT_PROBE_DEFINE2(pf, sctp, multihome, add, "uint32_t", "struct pf_sctp_source *"); SDT_PROBE_DEFINE3(pf, sctp, multihome, remove, "uint32_t", "struct pf_kstate *", "struct pf_sctp_source *"); +SDT_PROBE_DEFINE4(pf, sctp, multihome_scan, entry, "int", + "int", "struct pf_pdesc *", "int"); +SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, param, "uint16_t", "uint16_t"); +SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, ipv4, "struct in_addr *", + "int"); +SDT_PROBE_DEFINE2(pf, sctp, multihome_scan, ipv6, "struct in_addr6 *", + "int"); SDT_PROBE_DEFINE3(pf, eth, test_rule, entry, "int", "struct ifnet *", "struct mbuf *"); @@ -7493,6 +7500,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) int off = 0; struct pf_sctp_multihome_job *job; + SDT_PROBE4(pf, sctp, multihome_scan, entry, start, len, pd, op); + while (off < len) { struct sctp_paramhdr h; @@ -7504,6 +7513,9 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) if (ntohs(h.param_length) < 4) return (PF_DROP); + SDT_PROBE2(pf, sctp, multihome_scan, param, ntohs(h.param_type), + ntohs(h.param_length)); + switch (ntohs(h.param_type)) { case SCTP_IPV4_ADDRESS: { struct in_addr t; @@ -7533,6 +7545,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) if (! job) return (PF_DROP); + SDT_PROBE2(pf, sctp, multihome_scan, ipv4, &t, op); + memcpy(&job->pd, pd, sizeof(*pd)); // New source address! @@ -7566,6 +7580,8 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) if (! job) return (PF_DROP); + SDT_PROBE2(pf, sctp, multihome_scan, ipv6, &t, op); + memcpy(&job->pd, pd, sizeof(*pd)); memcpy(&job->src, &t, sizeof(t)); job->pd.src = &job->src; @@ -7616,6 +7632,7 @@ pf_multihome_scan(int start, int len, struct pf_pdesc *pd, int op) return (PF_PASS); } + int pf_multihome_scan_init(int start, int len, struct pf_pdesc *pd) { From nobody Wed Jan 15 23:33:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYMkJ2bbpz5kpnP; Wed, 15 Jan 2025 23:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYMkJ1qCmz3sQ9; Wed, 15 Jan 2025 23:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736983992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvxCugZoTVHpHG/3fso0e4oHC3LjcV4pBz2pYhsOu24=; b=W3nOX0pgN350FAXr/6DW2R6UzL5gMK5RMkV3fXrAJ3CjDzsziyfgzfapDuyPuLuB7Qsi3V 4JHDc3S91y2CVOLj8oYEeGgiiSgj4AAe5P1AL6kgroM7inRqgXcbo0LGJMzD0ZUTs/y/Wg baufE1rM6euwE2Jc5qgljK3IkAf3UcGA4ggFJygLlm9RY4dRzwNdfbDB0HlXp/9AusTQy+ t5MV4inVqr33z/qPf5WcNaFo7sf6DwTtdJrU0+tzX5BAoQ+96ATVeVjrE0IDkgofoCkLpa KEhlkNsYCt3SRp9xJpvnzEuiZPytWCd4ROfSD940Vvk+HWSeKaiVBbdoFCp/pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736983992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wvxCugZoTVHpHG/3fso0e4oHC3LjcV4pBz2pYhsOu24=; b=GHkE0TZjidkXJuG0DWWCChKa395AnCqSquXwKyL57AqLmWzEjlrLNF03vqaZVq99K8v9C1 4Jt+K4XRaQjGu+uXugE26HdR8pQd8vKBYkKQrFxUlW2byrVvVn8x6jp4z4LJPbK29qZhbj /QNCf7bOXtlB8etxTF1/tCDyz3bclgpKmXAAb66eeaiBB7Bt3kfZOwdBpvzNchrSUxJ5Wk 0RzEbAyzNlMI6x7ASmdz6OigjxFfu8Nu1CNEXayncSl1TIO9okH8Jc6UiPnGmaLlJmP4EJ H57RsJyiwCvAO7FjFonXoIr2T+h125eAVWMQIg97BDFfqsqkCYAODxIwSqgY8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736983992; a=rsa-sha256; cv=none; b=J8cfssR9UxWrZa5ci7xRwMsf7iCddJbD8stsUpWzRsjSaDErAsWiXxmw2QZtUgJhaIbFGr 8uAGbhzjQk/s74GhUfKX7w5QwuuJJc+UWtkTtQRmCucUSUl/KKXNgceDrUEJ+oQlzXfNnB pVLzuIRiWU/3adXrLIFgT25ngv7r9U4rPCE6iA26jUpkb/aKVexYDoHYhCwX1BpWfe8Bfm rJ2xJ8MrUFYqqvJ7jdVV1ZS4lCLd6a055n6O9C/G9yvR5fykF7qCMZP3DBocu4MBOWOyZe R8Wjo0J2wKlw0tKtYwMWTH2cOpd8acNGs7/5ReYjkUCZ2IRIq0h4/22Fj/UA5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYMkJ1QQsz16PM; Wed, 15 Jan 2025 23:33: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 50FNXC76008636; Wed, 15 Jan 2025 23:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FNXC6H008633; Wed, 15 Jan 2025 23:33:12 GMT (envelope-from git) Date: Wed, 15 Jan 2025 23:33:12 GMT Message-Id: <202501152333.50FNXC6H008633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 52f7eb31ae84 - main - fusefs: fix the 32-bit build after 564c732b5c0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52f7eb31ae84b0a02cd79c857c3201cb7b65c00f Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=52f7eb31ae84b0a02cd79c857c3201cb7b65c00f commit 52f7eb31ae84b0a02cd79c857c3201cb7b65c00f Author: Alan Somers AuthorDate: 2025-01-15 23:31:56 +0000 Commit: Alan Somers CommitDate: 2025-01-15 23:31:56 +0000 fusefs: fix the 32-bit build after 564c732b5c0 It's a printf format specifier again. MFC with: 564c732b5c0221373d067c9a21da09b310e676ae Sponsored by: ConnectWise --- tests/sys/fs/fusefs/mockfs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index 532dd27d77b9..35ae6c207229 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -1035,8 +1035,8 @@ void MockFS::write_response(const mockfs_buf_out &out) { ASSERT_EQ(out.expected_errno, errno) << strerror(errno); } else { if (r <= 0 && errno == EINVAL) { - printf("Failed to write response. unique=%lu:\n", - out.header.unique); + printf("Failed to write response. unique=%" PRIu64 + ":\n", out.header.unique); } ASSERT_TRUE(r > 0 || errno == EAGAIN) << strerror(errno); } From nobody Wed Jan 15 23:36:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYMnt09krz5kpm9; Wed, 15 Jan 2025 23:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYMns6lCGz3sps; Wed, 15 Jan 2025 23:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rR58JaFIDRGPKgSKByJYZusWLymn1YQeIcawew+yu8k=; b=deVWpv+4U5UXa184CU+8R+wl87lC+ahI6YgAbzIbiRIloBOCkeDdvyjjvOXMVX/VMdgxeN pZwfZBRSXMI3X1sYLVUJBtuxjoUDf5LaBWO0JEkeMsCp58aYSkujx7fiSRQ7Q98KrwpHa1 Bek8KTTFPka2fJ2PYRh5vMQK1fVZtWgWr0vszkZjaOGME4MXdIhKFmnREFftU8OSqtYkvW jNN2ikR+3gnWZbcMCI69T/ODse020K5E0rKutI8HTlFmU9WwUCRNSEwIMY5hfuw02+odq/ dQpFxUSsoTLGH3P0GBMFqXiROgp6FvVRtdiKux6K7+ZsjMhygccJnxqW5MBdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rR58JaFIDRGPKgSKByJYZusWLymn1YQeIcawew+yu8k=; b=YIQ6vknnFYfG5k+Eg6AXrK01Boz8kp3nHIC3ahnGhd/EU3zDwkbA1J6rNxSDy8gPfdqVQH UorSPpm7KioXrhTWb0owpF1J0UQjNzLyYOIjfFpk/0LGzHlAtWQ787ajUqG+n1bgO8QKxP xiZsMz29wsvyQprcpZ+8tZa3EXhBz23ZM/dV8RGxahtOPqzrioAjK6pgp4DYY6iXT/R6lz in22wkL+AMnrm5Yy8iDvSwfGdyAwdNmk9Rl93eFdcoKTS0AYUaypXrCZ3mSDB/sBidffJT fRzdIIBlS80F8bP5LVDO+Ei20Wyl6BBHZy9ShhpxkKYZAG2hN6OsfVbodWO4ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736984177; a=rsa-sha256; cv=none; b=lFfyYB6nnZNvRUL2eM3Lg/wmAZDRmxNG/gOt7kVtgVnwqFriD2MoOFYqr0sUMeGpCRiBrw 0XgS+ZmGPEMU3Xujg3HP/I4FAW0I5LMd+7ZQsoL162FHJwobmUoVH6oZsbzcSxjhZ8ac7y E9MNNLME3bVY63o1lRGP04nBkQNuFa/cnSU4JoXmGe+XLkkgZzSMRK7Mx/LXSzx46kPUYz WzkpM+BzbwGgAWw9a27SLHmIYvjNEM7yAM9efn3dK08r4PZRC9agPBZ8nIzVJI7w+R3dlS 4CqlJeWrQCkpxUlAEz4aig5qpPt5vMxheDiFdHgTRyLVuhfx2K6tdgnKaFj7Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYMns6LqJz16m6; Wed, 15 Jan 2025 23:36: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 50FNaHRJ009658; Wed, 15 Jan 2025 23:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50FNaHH2009655; Wed, 15 Jan 2025 23:36:17 GMT (envelope-from git) Date: Wed, 15 Jan 2025 23:36:17 GMT Message-Id: <202501152336.50FNaHH2009655@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: 054c5ddf587a - main - net80211: add IEEE80211_IS_LOCKED() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 054c5ddf587a7a0c430cf64dbf100b718eafdcc5 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=054c5ddf587a7a0c430cf64dbf100b718eafdcc5 commit 054c5ddf587a7a0c430cf64dbf100b718eafdcc5 Author: Bjoern A. Zeeb AuthorDate: 2025-01-15 22:50:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-15 23:36:00 +0000 net80211: add IEEE80211_IS_LOCKED() When trying to sort out a teardown locking problem (downcall in the driver can sleep) I found that the fan-out tree was getting too big to fix net80211 locking per-se for this while working on entirely different problems. Add IEEE80211_IS_LOCKED() so the driver can check and un-/re-lock as necessary (as we do in other cases already) to avoid panics on debug kernels left and right. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48475 --- sys/net80211/ieee80211_freebsd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net80211/ieee80211_freebsd.h b/sys/net80211/ieee80211_freebsd.h index b58c55cc7652..ed913f7b3661 100644 --- a/sys/net80211/ieee80211_freebsd.h +++ b/sys/net80211/ieee80211_freebsd.h @@ -73,6 +73,8 @@ typedef struct { mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_OWNED) #define IEEE80211_UNLOCK_ASSERT(_ic) \ mtx_assert(IEEE80211_LOCK_OBJ(_ic), MA_NOTOWNED) +#define IEEE80211_IS_LOCKED(_ic) \ + mtx_owned(IEEE80211_LOCK_OBJ(_ic)) /* * Transmit lock. From nobody Wed Jan 15 23:42:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYMxH5VtCz5kqfd; Wed, 15 Jan 2025 23:42:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYMxH2j0hz3tMq; Wed, 15 Jan 2025 23:42:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984563; 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=eoLtTdjnufATvhJYJxoRAfrDbOZjCTinDzISFDiqxSM=; b=dohVRh+3w8NU31flCfLpjMEbQe5moJ1fcMHXgW2YjmKMS2fSRh/6zHaNJvog41/uUG9MUX 2DDRRozB5zDwQuJ36bdUq/ja+yTdF38+1c51aB5VOafbZvQsKJHkqNqjh0wFWUsj8xevr6 L6BV7kRTiLAuuBAcn0VJ+skBa0nAtrp1D9D/b7C9AJK9BpinA/BYtbLatLEjMAEKBt0oO5 hB+5SZfX2zusqE+7/03+eEBF0Cq5bbMJ8w9eG5b98ncfBfu1zMjUHalK7xNqPsUYUEaNds Qq8PbWXTzX3S8z6z2mDQ0CvdKcLZLTERLPPvacTmQ/Uf7XTvJiaFF4hcLis4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736984563; 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=eoLtTdjnufATvhJYJxoRAfrDbOZjCTinDzISFDiqxSM=; b=fRVoloPptmlI7nW+UOdZrSkLdHolanrtMS6SS2tub9b7+ezYwwj2MG4PBfT9Ze75q7qCck tuYOtch8xzC5ih0XFxOgrxiM8APZd7GQZbrPR3W2SwN/euCVHRaYeXAuSwgq60ppyi/zOi VRKGkho9fy4hA+Y6Fn3NRdansdbenyyLiN48sldAs0MOa4Y6K+DWnpBfHRhNYlJinMYD82 ZBde3hiIVl4ZHbiZl3eJ+Bij4+Z7ObJ6Fe1Gae4ovPckZfd0d8MWVahdeOyYJdAmhvU5He U9KASB/V7+LWH3jemu+2zx12kbP2FGgP13oArFdP75HfeDLmN5zQr6NIhJj3Cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736984563; a=rsa-sha256; cv=none; b=yHaPukb9fs9DJeQarV77ZH8HZb4Rn0f57s3PsWnccUCGb/Duj0t1xKvd+JuFC9bgWzcP5l zIYX+jK+ULaLnMhr3n+J5VlWIYPvQbewWkoW3xb/lza4xUuyyjJ2Li1KGye48si0R4Cex5 jfiTjAKpbDE3p/mkMb5sqKc/kqALlYIRAqUSa0LFHC+SsId8fyCpnWh6RTBhkFDzWw6f54 KQWce7w18f4UhzyaR+LIzyUNvCEIdy4bpurZ9D3UGDZOxSN3XcdxfPzIhbxT3k1NuU+BJo szL1rPalq8uj0b3VQU2QjuQmdutNwMyb1xvTjiNyf3cvW84z2fnwwHDTpJSxCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YYMxH1MGBzDmM; Wed, 15 Jan 2025 23:42:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id ED34FA64806; Wed, 15 Jan 2025 23:42:34 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 5BA0B2D029DD; Wed, 15 Jan 2025 23:42:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id tNhGCLRD-IhK; Wed, 15 Jan 2025 23:42:40 +0000 (UTC) Received: from strong-aiccu0.sbone.de (strong-aiccu0.sbone.de [IPv6:fde9:577b:c1a9:f491::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 155682D029D8; Wed, 15 Jan 2025 23:42:39 +0000 (UTC) Date: Wed, 15 Jan 2025 23:42:39 +0000 (UTC) From: "Bjoern A. Zeeb" To: Adrian Chadd cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 912a05670ed9 - main - net80211: add helper functions for VHT transmit In-Reply-To: <202501090059.5090xBuW075394@gitrepo.freebsd.org> Message-ID: <4n262snp-q102-67q2-7q11-7qp1qp7rnn25@SerrOFQ.bet> References: <202501090059.5090xBuW075394@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Thu, 9 Jan 2025, Adrian Chadd wrote: > The branch main has been updated by adrian: > > URL: https://cgit.FreeBSD.org/src/commit/?id=912a05670ed9545a1d1b010eedafb819e14eb1b8 > > commit 912a05670ed9545a1d1b010eedafb819e14eb1b8 > Author: Adrian Chadd > AuthorDate: 2024-12-16 02:29:33 +0000 > Commit: Adrian Chadd > CommitDate: 2025-01-09 00:51:51 +0000 > > net80211: add helper functions for VHT transmit > > * Add static helper functions for VHT TX for 20MHz, 40MHz and 80MHz. > * Add a public function to check if the given VHT width is available > for transmit. > > Differential Revision: https://reviews.freebsd.org/D48101 > --- > sys/net80211/ieee80211_vht.c | 137 +++++++++++++++++++++++++++++++++++++++++++ > sys/net80211/ieee80211_vht.h | 4 ++ > 2 files changed, 141 insertions(+) > > diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c > index a05beb91216f..82879f90c67b 100644 > --- a/sys/net80211/ieee80211_vht.c > +++ b/sys/net80211/ieee80211_vht.c > @@ -873,3 +873,140 @@ ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, > +bool > +ieee80211_vht_check_tx_bw(const struct ieee80211_node *ni, > + enum ieee80211_sta_rx_bw bw) > +{ > + > + switch (bw) { > + case IEEE80211_STA_RX_BW_20: > + return (ieee80211_vht_check_tx_vht(ni)); > + case IEEE80211_STA_RX_BW_40: > + return (ieee80211_vht_check_tx_vht40(ni)); > + case IEEE80211_STA_RX_BW_80: > + return (ieee80211_vht_check_tx_vht80(ni)); > + case IEEE80211_STA_RX_BW_160: > + return (ieee80211_vht_check_tx_vht160(ni)); > + case IEEE80211_STA_RX_BW_320: > + return (false); > + default: > + return (false); > + } You should be able to remove the default case and that'll mean we'll get compiler errors if we add another BW fields in the future and don't handle it ("check this place and implement it" warnings for free). /bz -- Bjoern A. Zeeb r15:7 From nobody Wed Jan 15 23:59:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYNKS5ZQtz5krCn; Thu, 16 Jan 2025 00:00:12 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYNKR14Fjz3vRj; Thu, 16 Jan 2025 00:00:10 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=zabbadoz.net header.s=20240622 header.b=lxBM9gdv; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2003:a:140a:2200:6:594:fffe:19 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net; dmarc=pass (policy=none) header.from=zabbadoz.net Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 5F97CA64805; Wed, 15 Jan 2025 23:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1736985595; bh=W1cKtsnIo5ExKhTnaNvy7rzhzx+menk84GGMk967h0E=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=lxBM9gdvWMctWf52QWbAOlnsim+jxIplqBtIkb3jjPLtg30RS9zu83funKWDdd3sl XdlqsD76gNDsJgywHUCc92nOQl2cVCpGXf0Zl196KSrVPnCsl1iHAikzsT7rZYWvrq BqxaGQAMP1OscUNTubPkBrfJFvJa8IjGw8FBPetnh9VdjCZY9camPH9c4Vs7Ra/w0L ogUTPxk8lHD72gJ8o/W0vBBJHCw5Q8bCb8xCG2FUm+9Zr4JVQVnjCtoFBoX0183ZAS d0d1Pi3D5X7xhAELzTtbVeOV3wfb+GYv0ce5rUFL8hpGnLak3uWNPxIMfkYnK5sGDO 5emvoSDt6KZ4USXWot7TuKNJ04KEiHUOcfyUb6ae849QmT34OdO1O/vhyG6H3LJOjk 3Oz2NE0siQkwDhHK8a1BTAOJxtkO20VEDTLFdiPfBnvG73T2rV+uiTqBvNXgICxAN1 bawcg4gpGRgAJnws2mpS8dxnfPiWKiI5EBAYE+Ke2lBiRWb7RvP8g4vjMnLQVs/Ce/ gwNNWZUAZNHk6ojxYiMEy8mlxw2GJGkqJKK0pH2O0/AlSMpOO+F/DXazatTXNnq3Ax 3xA86rTdx59osAGZiY/iE3POkFzn0faLlFGPpQPKHSPEzhy1VUx2oAow5dvH3o3I0O hd066OZqGBmP19tTWzje9Uiw= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BB4BD2D029DD; Thu, 16 Jan 2025 00:00:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id EJxPww25q2Iy; Thu, 16 Jan 2025 00:00:00 +0000 (UTC) Received: from strong-aiccu0.sbone.de (strong-aiccu0.sbone.de [IPv6:fde9:577b:c1a9:f491::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 399A52D029D8; Thu, 16 Jan 2025 00:00:00 +0000 (UTC) Date: Wed, 15 Jan 2025 23:59:58 +0000 (UTC) From: "Bjoern A. Zeeb" To: Konstantin Belousov cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: b0e020764aae - main - ipsec + ktls: cannot coexists In-Reply-To: <202501131930.50DJUCFg047113@gitrepo.freebsd.org> Message-ID: <71p14p04-5o5o-1385-1551-7733rr1qo57o@yvfgf.mnoonqbm.arg> References: <202501131930.50DJUCFg047113@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[zabbadoz.net,none]; R_DKIM_ALLOW(-0.20)[zabbadoz.net:s=20240622]; R_SPF_ALLOW(-0.20)[+ip6:2003:a:140a:2200:6:594:fffe:19]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:3320, ipnet:2003::/19, country:DE]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; DKIM_TRACE(0.00)[zabbadoz.net:+] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4YYNKR14Fjz3vRj On Mon, 13 Jan 2025, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b0e020764aae970545357b0f146dcba7b4b55864 > > commit b0e020764aae970545357b0f146dcba7b4b55864 > Author: Konstantin Belousov > AuthorDate: 2024-12-28 08:30:49 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-01-13 19:29:31 +0000 > > ipsec + ktls: cannot coexists Ignore my ignorance but that description sounds bad. Do you mean on a per-packet base or in general on a machine, i.e., (1) an individual packet cannot be processed by ktls and ipsec (2) a host can either run ktls or ipsec but not both? Either sounds like (half) a bug to me that should be fixed by the way but I am so out of the ipsec stack that I don't know current implications. What is the reason a packet could not first be KTLS handled and then put into IPsec (for some part of its journey)? /bz > but instead of tripping the assert in debug kernel, and silently falling > into UB for prod, skip IPSEC processing for KTLS framed packets when > mb_unmapped_to_ext() failed. > > Reviewed by: markj > Sponsored by: NVidia networking > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D48265 > --- > sys/netinet/ip_output.c | 33 +++++++++++++++++++++++++-------- > sys/netinet6/ip6_output.c | 34 ++++++++++++++++++++++++++-------- > 2 files changed, 51 insertions(+), 16 deletions(-) -- Bjoern A. Zeeb r15:7 From nobody Thu Jan 16 00:10:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYNZ31YZfz5krpJ; Thu, 16 Jan 2025 00:11:07 +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 4YYNZ22ZGrz3wCB; Thu, 16 Jan 2025 00:11:06 +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 50G0ArvM049456; Thu, 16 Jan 2025 02:10:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 50G0ArvM049456 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 50G0Arci049454; Thu, 16 Jan 2025 02:10:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Jan 2025 02:10:53 +0200 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b0e020764aae - main - ipsec + ktls: cannot coexists Message-ID: References: <202501131930.50DJUCFg047113@gitrepo.freebsd.org> <71p14p04-5o5o-1385-1551-7733rr1qo57o@yvfgf.mnoonqbm.arg> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71p14p04-5o5o-1385-1551-7733rr1qo57o@yvfgf.mnoonqbm.arg> 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: 4YYNZ22ZGrz3wCB 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 Wed, Jan 15, 2025 at 11:59:58PM +0000, Bjoern A. Zeeb wrote: > On Mon, 13 Jan 2025, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=b0e020764aae970545357b0f146dcba7b4b55864 > > > > commit b0e020764aae970545357b0f146dcba7b4b55864 > > Author: Konstantin Belousov > > AuthorDate: 2024-12-28 08:30:49 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-01-13 19:29:31 +0000 > > > > ipsec + ktls: cannot coexists > > Ignore my ignorance but that description sounds bad. > > Do you mean on a per-packet base or in general on a machine, i.e., > (1) an individual packet cannot be processed by ktls and ipsec > (2) a host can either run ktls or ipsec but not both? After this change, we are at the #1. Before, we were at #2. This change maps mbuf chains that are to be processed by sw IPSEC. So the change makes KTLS and IPSEC compatible. Mark said that there are plans to make sw IPSEC to fully handle unmapped packets. > > Either sounds like (half) a bug to me that should be fixed by the way > but I am so out of the ipsec stack that I don't know current implications. > > What is the reason a packet could not first be KTLS handled and then put > into IPsec (for some part of its journey)? Talking about software implementations, KTLS mbufs are unmapped, and IPSEC was not prepared to handle that, so we remap them. For inline offload on network cards (talking about mlx5), current offload engines can do only one crypto op on packet as it is processed. In other words, either KTLS, or IPSEC inline can be done, not both. From nobody Thu Jan 16 00:33:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYP3R3pT3z5ksmN; Thu, 16 Jan 2025 00:33:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYP3R2nlzz3xvs; Thu, 16 Jan 2025 00:33:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 30584A64805; Thu, 16 Jan 2025 00:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1736987579; bh=GilStMJw9r+JXdaZzdDnDQzRdK/J4cnJC/k3Jd6tyeQ=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=jC0NpDAuQzTAV0xRdcWQ2hqYMVHSG8NeoUbzmTPzpagVlnscPpOyx3aNu0oE3g9uj H8YoVd2TQc9x8jdBQZWikD22iy3NwMpX7GNVQ0NiPf7qGRx+rXJSJdsGoIsOPNs6rF 54BaQ/SfUI4fiI1tb7NYxPYs3DqGUhedXNU5Pr3k/eF3bSNGj0XtBdTuWgZrOUnFpA 9emA++t3MX1fDrucYgCvOSYz8fpPu/rzDXRXcH8fF9HN/rwm2+wKhQ34nrUHgGKU9Q Mrv/lp4ntwzftvuQNpcJ2fXAl8GyzrKWH2aAEB9ptrrwP3QSLPIOc0WqjjTEU088cG I45ftprQK/eU/o71a6LKsjRsKRGQq7dvXLRYW63xFzLe+NAxdgNGJ58n7DTOd3Z7yD gYCbcqjZPMKpG7GpDakoxynPxTRWjB/re53OZHoougEJUbGTuXz+RWIfmq4nKZHfaY 2TZQC8Kc4WUHZSvNXeC84yAcD/S5SPEu1MSx5ebk9KpaAdurVAl8GZKuCpR3aFIV+l ibSA1Dg+t5DW+Q2COHsg1uzPVZj2LEV17VjArEtLgIGCRoPDRqsBAXrqFmnAPpvlyO GQOSFuzNdOtYjHi2lg/9Gtift92g/8W+mKGcod0IN1Q8/EBiaEl/lrAZN+T0TGqjGC 8573EdC6jfK4HS5SvyCJXNMk= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 81E1D2D029DD; Thu, 16 Jan 2025 00:33:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id VP6XVe2mJNC6; Thu, 16 Jan 2025 00:33:04 +0000 (UTC) Received: from strong-aiccu0.sbone.de (strong-aiccu0.sbone.de [IPv6:fde9:577b:c1a9:f491::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 1229D2D029D8; Thu, 16 Jan 2025 00:33:03 +0000 (UTC) Date: Thu, 16 Jan 2025 00:33:02 +0000 (UTC) From: "Bjoern A. Zeeb" To: Konstantin Belousov cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b0e020764aae - main - ipsec + ktls: cannot coexists In-Reply-To: Message-ID: <3462o4sq-1833-o2r1-5q7p-58502pp2r8s5@yvfgf.mnoonqbm.arg> References: <202501131930.50DJUCFg047113@gitrepo.freebsd.org> <71p14p04-5o5o-1385-1551-7733rr1qo57o@yvfgf.mnoonqbm.arg> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4YYP3R2nlzz3xvs 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:3320, ipnet:2003::/19, country:DE] On Thu, 16 Jan 2025, Konstantin Belousov wrote: > On Wed, Jan 15, 2025 at 11:59:58PM +0000, Bjoern A. Zeeb wrote: >> On Mon, 13 Jan 2025, Konstantin Belousov wrote: >> >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=b0e020764aae970545357b0f146dcba7b4b55864 >>> >>> commit b0e020764aae970545357b0f146dcba7b4b55864 >>> Author: Konstantin Belousov >>> AuthorDate: 2024-12-28 08:30:49 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2025-01-13 19:29:31 +0000 >>> >>> ipsec + ktls: cannot coexists >> >> Ignore my ignorance but that description sounds bad. >> >> Do you mean on a per-packet base or in general on a machine, i.e., >> (1) an individual packet cannot be processed by ktls and ipsec >> (2) a host can either run ktls or ipsec but not both? > > After this change, we are at the #1. > Before, we were at #2. > > This change maps mbuf chains that are to be processed by sw IPSEC. So > the change makes KTLS and IPSEC compatible. > > Mark said that there are plans to make sw IPSEC to fully handle unmapped > packets. > >> >> Either sounds like (half) a bug to me that should be fixed by the way >> but I am so out of the ipsec stack that I don't know current implications. >> >> What is the reason a packet could not first be KTLS handled and then put >> into IPsec (for some part of its journey)? > > Talking about software implementations, KTLS mbufs are unmapped, and IPSEC > was not prepared to handle that, so we remap them. > > For inline offload on network cards (talking about mlx5), current offload > engines can do only one crypto op on packet as it is processed. In other > words, either KTLS, or IPSEC inline can be done, not both. I see. Thanks a lot for the work and explanations. Goinng from #2 -> #1 seems very good indeed. Lots of joy, /bz -- Bjoern A. Zeeb r15:7 From nobody Thu Jan 16 01:23:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYQ922KTnz5kxDR; Thu, 16 Jan 2025 01: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYQ9217Gsz44Cy; Thu, 16 Jan 2025 01: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=1736990582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGrVwwSIjyxz0ew/ouVRo10iOOYLrKZXPVD5dxVKOZ4=; b=b6p+dkFO0HXDzUd5vsTURi/swnnNwAfOZS7tUVJqglKapl5AeedHCkR40KPBnSaJEVSNjt tJb8n0OybUTfzla4vjyZORNLltyg17gdC8HKTw/MKbQgPbb7I89DZ7IGZnqRpXgdkMcwQY bqB96YZRPWJycdAkbV2KCxXm89lT32yxXj4b+xOM8R17FUtq1KwT2lF16JWyy+OiZLnZKq /gY8vwIVdw4h+ZF3ZArsFWahuPv6aPCW2UIP3tsMDFZ+J1YMvZpWytPjpoxCF/wbOkBSZd gMz74Dk0B4HsDA5Psd8VAI/Cj67agxwiDa6DF2ls32r75g1QEVg3L+InHLNCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736990582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGrVwwSIjyxz0ew/ouVRo10iOOYLrKZXPVD5dxVKOZ4=; b=c6Bod8kJYrURLOgUM7nfEG4QOxyPMn8fJhx5iC0FswnyoX+bgeOCl1tOAFlzyBKrwGXS4N rnJR9NQWrq+D+41vyp/Fv35e3Vp9T+F3QccEk1QZu23JpccbDqriLp4nP4RS53FRCFK/+Y I6dMlMtMfLHYMY1wDma9kA5OIBhVHewD5uubMQLq3GWmJ998ZZ9gKBI41jATX2bSQg0Yt7 NJTuKr8HYyFzRmME1QboUdEbQZyiNYkfx1E7PrPTVm26M1FIZv4Y46J/Jdq5DgejPxymUo fJaEn1MtKeOvSU9ZBKDOWPxB4Qfo0PRm8DWCbnqtcfCgYZJgalW+aR2dDuQB2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736990582; a=rsa-sha256; cv=none; b=hOgYnPO+IHOHoMgJnetUcQH66WjsGkJjSb/jqZjLaQ/kJEYeZYKJM1cYKIpdSMm9LQQSKD rCJPcvxWYEd9Sp1eWsn8aNiDNI+DXWCIEdRMWf0O8/oil+r5CDrLUnUkPIu8H3GKtX93xM XCmCjEphwM1ctAaM2IvCHsxZvFh3yrtcvxbMZEIICX2EyO3FVsbGTZvmLwwBwC0ifBKyrN Z8pt8307JMeugKt4FwsC5UCfGEj7/fIPszPCP3lD47in8l77r8KB42bppiH2M83jMfH5cd 6/McJRZqef4kBbtpuYOn8uQpHbkusx5+fBQtdSuJi8P/5wb+5Lop/Ireauxw0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYQ9204YZz19X8; Thu, 16 Jan 2025 01: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 50G1N1Or012159; Thu, 16 Jan 2025 01: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 50G1N11A012156; Thu, 16 Jan 2025 01:23:01 GMT (envelope-from git) Date: Thu, 16 Jan 2025 01:23:01 GMT Message-Id: <202501160123.50G1N11A012156@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: 521c1fe0e200 - main - libc/aarch64: fix strlen() when flush-to-zero is set List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 521c1fe0e2002dfd7d8db86eb7144b7865229912 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=521c1fe0e2002dfd7d8db86eb7144b7865229912 commit 521c1fe0e2002dfd7d8db86eb7144b7865229912 Author: Robert Clausecker AuthorDate: 2025-01-13 13:41:41 +0000 Commit: Robert Clausecker CommitDate: 2025-01-16 01:20:30 +0000 libc/aarch64: fix strlen() when flush-to-zero is set Our SIMD-enhanced strlen() implementation for AArch64 uses a floating-point comparison to compare a bit mask to zero. This works fine under normal circumstances, but fails if the FZ (flush-to-zero) flag is set in FPCR (the floating-point control register) as then the CPU no longer distinguishes denormals from zero. This was not caught during testing; this flag is rarely set and programs that do so rarely perform string manipulation. Avoid this problem by using an integer comparison instead. The performance impact seems to be small (about 0.5 %) on the Windows 2023 Dev Kit, but seems to be more significant (up to around 19%) on the RPi 5. Reviewed by: getz Fixes: 3863fec1ce2dc6033f094a085118605ea89db9e2 Differential Revision: https://reviews.freebsd.org/D48442 --- lib/libc/aarch64/string/strlen.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libc/aarch64/string/strlen.S b/lib/libc/aarch64/string/strlen.S index 7bfac7f4b1e1..6fefc252eca1 100644 --- a/lib/libc/aarch64/string/strlen.S +++ b/lib/libc/aarch64/string/strlen.S @@ -33,9 +33,8 @@ ENTRY(__strlen) ldr q0, [x10, #16]! cmeq v0.16b, v0.16b, #0 shrn v0.8b, v0.8h, #4 // reduce to fit mask in GPR - fcmp d0, #0.0 - b.eq .Lloop fmov x1, d0 + cbz x1, .Lloop .Ldone: sub x0, x10, x0 rbit x1, x1 // reverse bits as NEON has no ctz From nobody Thu Jan 16 07:30:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYZJq3shWz5lJty; Thu, 16 Jan 2025 07:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYZJq2jnDz3bH8; Thu, 16 Jan 2025 07:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94vCJ1BQKu4v0FzkWb9XNaf1vOSjM6KVFWokynYbBeQ=; b=Z6LNYtGwIf+fv1jNVDlFhm2MeSGCAU6u2pCShGq5rtuwlRCCoBQilTTTzdDkKlzRo8UX0Z gFjlEt9ZWF9Kn4ssVGOOZ2ZKv60P+RO5LKLf9NsqENmu3lTNuZdV+Aq44Rd7nZMYLP5zA8 yKGWfGR3SuguRbRaNi1t23KPGoHG+dOPQZKVx/Tm0x1IwhndFIk4yQ05KztJVFJ8XdhIU5 ig8DbxM/nJe05k85+ClGBJOyNVNs8kNmkcvh3Z+yTx7Ep0SYeYVo9sQvZ2QbQAcBeecnGJ V5HYDOKR34L7NTFljvee/ghM+Ap4dGsMg9E2ywF/YQRbpoomWT5nU2wlwmUJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=94vCJ1BQKu4v0FzkWb9XNaf1vOSjM6KVFWokynYbBeQ=; b=jFw+6H9HECH2sa8b5cLjq0a7r3ybgsmRmmX1GmTO9WMq92bF5du7WUU1yF4kbg7pt9Zq6s 9HPd/f+yLmyjcPUSjF3OO7GXbZ/7mfGix4mLDJJSc3auy2rTkopDBOswOvXtWcwGJ6y1R8 2heRWehI0Ri8c1es12GtW6RDZMWU023Kcg0zKiUtuv0OUL1gLozlBQQ19hVDkC/kiZudYc 0j2EVz7/rg3ZQzmNgzSyJhG6D68Qe/TTWot4NwIv3aUhsReVgGzVvE9aVjJB1kNSrskJm2 5WMvzOGkPWqh3p5aSVIqQchYlTrBx3f9vhFhrEPGBral6MkvFsEUf6m+lIPOMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737012619; a=rsa-sha256; cv=none; b=y3ViNAqoSiLIxCyyFphaftpXVpS6LTjTD04NRgkxUQ6COY2SaYHJelXO/gy/iAKxw5XQZr 5ImcvEQVPbSFPeKaTp5XhfDzkF7WO2ud3YzVxSoOLKvqvyO+j4J1CTZl3QmZMZwj4kR8q5 P9GR1YSoZzBmxrSwRIlCQ9pDwYNynZNUK+3E5FBDPQnbwVAhw9K79U1hEfiaQkF0SWc76d JcUjSyELTRG4f3H5BDJxShDFewPOTNR/S5LmwJeKKg9YkGfpfvFlSQO98svSNGXtCwyqtW +pyCweDJUaHPDOyvhZmBQ1rbC9Tm+jblMVio3oBJ8Eca4urFB0rlryXopDoEfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYZJq22Psz7FQ; Thu, 16 Jan 2025 07:30: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 50G7UJMj098584; Thu, 16 Jan 2025 07:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50G7UJcq098581; Thu, 16 Jan 2025 07:30:19 GMT (envelope-from git) Date: Thu, 16 Jan 2025 07:30:19 GMT Message-Id: <202501160730.50G7UJcq098581@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: c1f6b799a764 - main - powerd: use snl_get_genl_mcast_group() API List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1f6b799a7647a738f2e0dfa688c54ada83abc59 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c1f6b799a7647a738f2e0dfa688c54ada83abc59 commit c1f6b799a7647a738f2e0dfa688c54ada83abc59 Author: Gleb Smirnoff AuthorDate: 2025-01-16 03:33:16 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-16 07:20:57 +0000 powerd: use snl_get_genl_mcast_group() API --- usr.sbin/powerd/powerd.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c index 7be24e0c01ad..7eab9a630411 100644 --- a/usr.sbin/powerd/powerd.c +++ b/usr.sbin/powerd/powerd.c @@ -464,31 +464,23 @@ acline_read(int rfds) bool netlink_init(void) { - struct _getfamily_attrs attrs; + uint32_t group; if (modfind("nlsysevent") < 0) kldload("nlsysevent"); if (modfind("nlsysevent") < 0) return (false); - if (!snl_init(&ss, NETLINK_GENERIC)) + if (!snl_init(&ss, NETLINK_GENERIC) || (group = + snl_get_genl_mcast_group(&ss, "nlsysevent", "ACPI", NULL)) == 0) { + warnx("Cannot find \"nlsysevent\" family \"ACPI\" group"); return (false); + } - if (!snl_get_genl_family_info(&ss, "nlsysevent", &attrs)) + if (setsockopt(ss.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group, + sizeof(group)) == -1) { + warnx("Cannot subscribe to \"ACPI\""); return (false); - - for (unsigned int i = 0; i < attrs.mcast_groups.num_groups; i++) { - if (strcmp(attrs.mcast_groups.groups[i]->mcast_grp_name, - "ACPI") == 0) { - if (setsockopt(ss.fd, SOL_NETLINK, - NETLINK_ADD_MEMBERSHIP, - &attrs.mcast_groups.groups[i]->mcast_grp_id, - sizeof(attrs.mcast_groups.groups[i]->mcast_grp_id)) - == -1) { - warnx("Cannot subscribe to \"ACPI\""); - return (false); - } - } } return (true); } From nobody Thu Jan 16 07:30:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYZJr47Fdz5lJv0; Thu, 16 Jan 2025 07:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYZJr3VN5z3bmx; Thu, 16 Jan 2025 07:30:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qlK1G+6F1FNsv3RzKWSmKvSYKzyU6UFwmuSu+Wgoexc=; b=tCfYKDc1JRW436dWNVZ8KPlw2GnIN4jiZ31p9tzYNHuGG6HYO1/MNOFs9THQWDFxxJH9LT GIAFe5B7t3gEs3FhucaXh4SDXAAkIZPd9pfFK14fEFfRtB4Y2ZqwGshMS+GyxIAMgoDsvk baGQ4en2eOq8iCV+iHLgNdakdfl4xqe0ndc10h/rSbzHIVjnqzxDfaCXWkZcdCvU5wocuQ dckL17gLWvpAkGjWf0bolzok+5hx6dA7Fi/rxNk3hjUNzCb+NkXHz3dBsTGrJ+bkJhe15s UPdBYKkdgTkFiFvAKc9rcnZS7y1seghrI3kVaMu37TAy+zk3CKXAYX+7Crauyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qlK1G+6F1FNsv3RzKWSmKvSYKzyU6UFwmuSu+Wgoexc=; b=J2w9je+ZaOHR2p0+M1RDqUpzX/oMWNLam/x+rGyG/+18/lHqQXhjKIXN+yiHIEIIajOhLb AUFJPbK2d+ECZ1CNnlPCdsnDHWeDm2kpIQIuPkH9xAb6UBGZRjsuA4VhW9LSKybZI9ZSG5 vtGm9aJ1lqEzJxFZtBKrPe/rtYE+v6h5+3W8GDVH/BjOlhBRi6eqHMJDCG1ShkjygohiMW PPAGIH6WPwEwnpJh3R/wJaNS80PTGkJN+YFD99FuzDP0NMU2XfWQBIjDIt0eDan3Osmns6 fzHbHlPVJQSOtqhEDgVu+p6HGVtQbMBxa1qDMlj2RzkpO40sNWIaK4Y3nI6o+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737012620; a=rsa-sha256; cv=none; b=WKLdBR7MIyR9lcsWRrS2zLwdlZIFPKyMeNpij6amsGC0sJ6yC7Yqy+hria4xrujqFhhtsU /XxhcafnFBzbPhhXd8mfS8ekJhoZojThcUxKhNLFjZYBVIPuMVZvYVZA2qw9Zp7TkRAcSe oiViSnyKqspZjz4zzmDP+mXsRsTTdeJW6SuitwNxtKfYwn8veABJ3v7VZtWabMkgNLAPeI vNaBu6q+15KCWHaKcyO5JBsEubk9khwqvsxr1/4JKrzrp5VU9mM1nNQOB/Pad9eayyruTP VapjKp/GFCgJRcJogPYHg7WHgYV/1k1G5QrZEIvMYzbSLPmlDc0qpJZKKLqiRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYZJr30fNz70Q; Thu, 16 Jan 2025 07:30: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 50G7UKcG098632; Thu, 16 Jan 2025 07:30:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50G7UKLI098629; Thu, 16 Jan 2025 07:30:20 GMT (envelope-from git) Date: Thu, 16 Jan 2025 07:30:20 GMT Message-Id: <202501160730.50G7UKLI098629@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: c3df2fa9a755 - main - netlink: snl_create_msg_request() may fail due to ENOMEM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c3df2fa9a7554e00f34f1cbcf8be6c8ccf9ccd8a Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c3df2fa9a7554e00f34f1cbcf8be6c8ccf9ccd8a commit c3df2fa9a7554e00f34f1cbcf8be6c8ccf9ccd8a Author: Gleb Smirnoff AuthorDate: 2025-01-16 02:50:29 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-16 07:21:58 +0000 netlink: snl_create_msg_request() may fail due to ENOMEM --- sys/netlink/netlink_snl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 2861ea93bafb..d10852ac7a36 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -1261,9 +1261,13 @@ snl_end_attr_nested(const struct snl_writer *nw, int off) static inline struct nlmsghdr * snl_create_msg_request(struct snl_writer *nw, int nlmsg_type) { + struct nlmsghdr *hdr; + assert(nw->hdr == NULL); - struct nlmsghdr *hdr = snl_reserve_msg_object(nw, struct nlmsghdr); + if (__predict_false((hdr = + snl_reserve_msg_object(nw, struct nlmsghdr)) == NULL)) + return (NULL); hdr->nlmsg_type = nlmsg_type; hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; nw->hdr = hdr; From nobody Thu Jan 16 07:30:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYZJt6Cn5z5lKKF; Thu, 16 Jan 2025 07:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYZJs746wz3bWZ; Thu, 16 Jan 2025 07:30:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QdAIIN0sQMdMSIKeHV5PZO2I+tynOlgjFVk5QMHJIKU=; b=dIGMIa6AadAKXmd7SNN5O6GcRVp3q8jXUhtUSo0rnaMhdBIu97l2oIBhcoF6ay2GH9AGhQ hG3t69j5sriGoiHFeUFfwsQ2B8lXjx1RuKXs/u4kTAOXZuWddpDN0vurxFhbMZVzANCtj/ DRpcfjSbgnUwf0EKAtxlGSj9ZsKDhPhOl8osHDSoosXr0HDOwSWxVfSkonqk6LjiXlIDEr juXxtr18VUbcX3B7JuK0dAfG2UPmIXkNnqTfoLOqwPlgX5co0RPaNV4Vob95WyknbcNyVu JdcXlnIF74PAF1NDlnLAcIRJTDiz4oqA1QtN7g/5NVy0UMZL7v/ELcPUzJAL6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737012622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QdAIIN0sQMdMSIKeHV5PZO2I+tynOlgjFVk5QMHJIKU=; b=gylkdBhQF/vLWT4T97znJGcBOhUjFEETegbHCtnhJ5+uJcWX8HAjWxyMnz8EkrlWcL62ZG 2U3lsy4ENDjwFVls6hdgmO4MKGimtSZ+VcNs2r/kj7pRpxT0sHYQtYud+MtxP6z7BluYnf 1n7XC3bbQmKCGa5JaWmEfuvTja32HiSRtOK8GEmC1SoFYVKdQr/HpOXKdC6utiNpA2ZTCd P2iSzEiR/g4iYIUnkVanjt7FifF2inBUCKFNHdjB7qvriEH7u9rGKqw5CiZjqVX1+Mmb3Z vZdI3GD0vB8rTkcfhUg0a7kwQRxTNkYaDSlrM16e7GzfhcTeHHinzDM4FPLyYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737012622; a=rsa-sha256; cv=none; b=rAzJ+iwD878oQAhisjYCmIDyYdd75Rk2V8B8SHe24yHqA7ZZ6ccYKLVY4+VHWV3lpBvGz8 M7YZls7a+IZgcrwgWrZL9oJs5tDGwf2rpKnZJ+ItnMzEM6YMQVzVoiJpfGd4V7s5RuTagK aHAemqs+FhpdR5daO2Q5iIkR/JhfoH/MhriCecAvRxQ62LB0yCiE2T6zj+meGNWNHyo2NC VDnWrXp19cW0VlaLXtdiNEpdmOFZZsXG/J1+TdyJJ5upbFpIJFyudo24ZD6gWHeFiZVEWU tKCOhfhxoD1RvWmbUV7ev4W1Ni7X0EpVoOQfQ8GlRGT4i43+Xm6Giji72PDBIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYZJs3Tz9z6nn; Thu, 16 Jan 2025 07:30: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 50G7ULiR098677; Thu, 16 Jan 2025 07:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50G7UL6D098674; Thu, 16 Jan 2025 07:30:21 GMT (envelope-from git) Date: Thu, 16 Jan 2025 07:30:21 GMT Message-Id: <202501160730.50G7UL6D098674@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: 90b1df4f4df9 - main - netlink: small cleanup of generic snl(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90b1df4f4df937bca4b18563e6e15288de7484ac Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=90b1df4f4df937bca4b18563e6e15288de7484ac commit 90b1df4f4df937bca4b18563e6e15288de7484ac Author: Gleb Smirnoff AuthorDate: 2025-01-16 01:01:53 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-16 07:22:19 +0000 netlink: small cleanup of generic snl(3) - Add const qualifiers for the family/group name pointers. - Break & tab long lines. No functional changes. --- sys/netlink/netlink_snl_generic.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index e2dc4d1bfffe..bdbefb914259 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -62,7 +62,7 @@ static struct snl_field_parser snl_fp_genl[] = {}; struct snl_genl_ctrl_mcast_group { uint32_t mcast_grp_id; - char *mcast_grp_name; + const char *mcast_grp_name; }; struct snl_genl_ctrl_mcast_groups { @@ -72,25 +72,40 @@ struct snl_genl_ctrl_mcast_groups { #define _OUT(_field) offsetof(struct snl_genl_ctrl_mcast_group, _field) static struct snl_attr_parser _nla_p_getmc[] = { - { .type = CTRL_ATTR_MCAST_GRP_NAME, .off = _OUT(mcast_grp_name), .cb = snl_attr_get_string }, - { .type = CTRL_ATTR_MCAST_GRP_ID, .off = _OUT(mcast_grp_id), .cb = snl_attr_get_uint32 }, + { + .type = CTRL_ATTR_MCAST_GRP_NAME, + .off = _OUT(mcast_grp_name), + .cb = snl_attr_get_string, + }, + { + .type = CTRL_ATTR_MCAST_GRP_ID, + .off = _OUT(mcast_grp_id), + .cb = snl_attr_get_uint32, + }, }; #undef _OUT SNL_DECLARE_ATTR_PARSER_EXT(_genl_ctrl_mc_parser, - sizeof(struct snl_genl_ctrl_mcast_group), - _nla_p_getmc, NULL); + sizeof(struct snl_genl_ctrl_mcast_group), _nla_p_getmc, NULL); struct _getfamily_attrs { uint16_t family_id; - char *family_name; + const char *family_name; struct snl_genl_ctrl_mcast_groups mcast_groups; }; #define _IN(_field) offsetof(struct genlmsghdr, _field) #define _OUT(_field) offsetof(struct _getfamily_attrs, _field) static struct snl_attr_parser _nla_p_getfam[] = { - { .type = CTRL_ATTR_FAMILY_ID , .off = _OUT(family_id), .cb = snl_attr_get_uint16 }, - { .type = CTRL_ATTR_FAMILY_NAME, .off = _OUT(family_name), .cb = snl_attr_get_string }, + { + .type = CTRL_ATTR_FAMILY_ID, + .off = _OUT(family_id), + .cb = snl_attr_get_uint16, + }, + { + .type = CTRL_ATTR_FAMILY_NAME, + .off = _OUT(family_name), + .cb = snl_attr_get_string, + }, { .type = CTRL_ATTR_MCAST_GROUPS, .off = _OUT(mcast_groups), From nobody Thu Jan 16 09:10:42 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYcXf4T0Lz5lQ5p; Thu, 16 Jan 2025 09:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYcXf3ymLz3lkZ; Thu, 16 Jan 2025 09:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737018642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=52qcB619kl6vPmn+EjZX/79qX8q52TwjeSzWV4SkEHY=; b=WAtUtdezcijW6koVYtaYhsoZsKBCCgRBY9wSOLrpFjvbsHVbzP2n7Jm6iP7fs7a3kURXLE NV+/qAcgajrTRfcaBSI7511k4nDo+EcMjdj20DMDtE6OaOV8xBdcOzVl3xxCbZNjZbUnNM U/EO3T0r+dWW85Q53jzT6c16FDY7PebencPS4zjOw1jGRbIO+YWdYHa0G/Tt00psyeFVMy yGsAVj5dV/dJqtjNyzw8lr2rSLfR/hl/11EF1kIMURgLv+tw+JbZauOPFO45Y49LbrI7eq pbH/rEKOMzyNm4K4+4foI1BfYXIAw8LkzQeFlTur12wCCzmYWYMGnQpKNDgFPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737018642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=52qcB619kl6vPmn+EjZX/79qX8q52TwjeSzWV4SkEHY=; b=Y9/N5U8hOQ5rLZojSrnCzUFeLMIUjnREk9wYnE4MxshacmzpNzwB+u+zMXsfiHb8lK0yp5 6LsXim2oon1nFQYC5RmYIVXxzTSzAlM7MsUhE5tRPH7AXTgnISdpNvoWg26e16CfJ02s51 X3jEm5Bp8MaAWEVxBQZHuQdhGon8MC3GMlTGB2C/+sErUJTERGb/X8NCsGIAnqm82IAGng 1p5/UPLMHY3nWrLUSDchGYJHzvEFfHrVpjS6vaa8Fan3DNBnyHF0WN2/Q/aPtEo+C3V94u 6NcgKTyq1MpiEyWrLkYoFCZyXElCH514Sn8tIphJvLXcyqvmDfznEowisYgsvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737018642; a=rsa-sha256; cv=none; b=ZvgIUMa6ZJy8MeQ7M+N5r8KCkGeNjQB7v7n7PYRnlHSdAEAgxqygK9tE7OXlbXqCTem22g PqhIgrUDrS2GBIxI7VAy7J4JB5jccTO7nxt6TOKWOTN1Z/m0MOiN/Ve0N92OQ1sR2j1fKr XAYASr1TKZcYSQBSqq+oC/O1U90EwmZEyaleEepdPyzrmuTehC4f8tCRilTPlYMk7Ar1kx 7//kZ09FnditnyHbhzTc0iZQdZSa1azN+RWe+uuzzkgu6XU88bXFlN0b1aTGqAMDRkjBl9 5EekG3NmNrP/+LQMQ9z6+HXSrZZFssL6+V1EuTkNwGy9VCiLajsR3aongOTOxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYcXf3YrSz9KZ; Thu, 16 Jan 2025 09:10: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 50G9AgiB086944; Thu, 16 Jan 2025 09:10:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50G9Ag93086941; Thu, 16 Jan 2025 09:10:42 GMT (envelope-from git) Date: Thu, 16 Jan 2025 09:10:42 GMT Message-Id: <202501160910.50G9Ag93086941@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: 7c882c69a4f0 - main - libpfctl: use snl_f_p_empty instead of declaring own empty array List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c882c69a4f077efc2602da303c192363fe478d0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7c882c69a4f077efc2602da303c192363fe478d0 commit 7c882c69a4f077efc2602da303c192363fe478d0 Author: Kristof Provost AuthorDate: 2025-01-15 11:03:37 +0000 Commit: Kristof Provost CommitDate: 2025-01-16 09:05:09 +0000 libpfctl: use snl_f_p_empty instead of declaring own empty array Just as we did in the kernel in e9255dafa1ef0c635385aee78ead3a0050b19cca Suggested by: glebius Reviewed by: glebius, melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D48460 --- lib/libpfctl/libpfctl.c | 48 +++++++++++++++-------------------------------- sys/netlink/netlink_snl.h | 1 + 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index b374ef05e4d7..f0708c8f0439 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -392,8 +392,7 @@ static const struct snl_attr_parser ap_getstatus[] = { { .type = PF_GS_BCOUNTERS, .off = _OUT(bcounters), .arg_u32 = 2 * 2, .cb = snl_attr_get_uint64_array }, { .type = PF_GS_PCOUNTERS, .off = _OUT(pcounters), .arg_u32 = 2 * 2 * 2, .cb = snl_attr_get_uint64_array }, }; -static struct snl_field_parser fp_getstatus[] = {}; -SNL_DECLARE_PARSER(getstatus_parser, struct genlmsghdr, fp_getstatus, ap_getstatus); +SNL_DECLARE_PARSER(getstatus_parser, struct genlmsghdr, snl_f_p_empty, ap_getstatus); #undef _OUT struct pfctl_status * @@ -1356,11 +1355,9 @@ static struct snl_attr_parser ap_getrules[] = { { .type = PF_GR_NR, .off = _OUT(nr), .cb = snl_attr_get_uint32 }, { .type = PF_GR_TICKET, .off = _OUT(ticket), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_getrules[] = { -}; #undef _IN #undef _OUT -SNL_DECLARE_PARSER(getrules_parser, struct genlmsghdr, fp_getrules, ap_getrules); +SNL_DECLARE_PARSER(getrules_parser, struct genlmsghdr, snl_f_p_empty, ap_getrules); int pfctl_get_rules_info_h(struct pfctl_handle *h, struct pfctl_rules_info *rules, uint32_t ruleset, @@ -1665,9 +1662,8 @@ static struct snl_attr_parser ap_getrule[] = { { .type = PF_RT_RPOOL_NAT, .off = _OUT(r.nat), .arg = &pool_parser, .cb = snl_attr_get_nested }, { .type = PF_RT_NAF, .off = _OUT(r.naf), .cb = snl_attr_get_uint8 }, }; -static struct snl_field_parser fp_getrule[] = {}; #undef _OUT -SNL_DECLARE_PARSER(getrule_parser, struct genlmsghdr, fp_getrule, ap_getrule); +SNL_DECLARE_PARSER(getrule_parser, struct genlmsghdr, snl_f_p_empty, ap_getrule); int pfctl_get_clear_rule_h(struct pfctl_handle *h, uint32_t nr, uint32_t ticket, @@ -1778,11 +1774,9 @@ struct pfctl_creator { static struct snl_attr_parser ap_creators[] = { { .type = PF_ST_CREATORID, .off = _OUT(id), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_creators[] = { -}; #undef _IN #undef _OUT -SNL_DECLARE_PARSER(creator_parser, struct genlmsghdr, fp_creators, ap_creators); +SNL_DECLARE_PARSER(creator_parser, struct genlmsghdr, snl_f_p_empty, ap_creators); static int pfctl_get_creators_nl(struct snl_state *ss, uint32_t *creators, size_t *len) @@ -1913,11 +1907,9 @@ static struct snl_attr_parser ap_state[] = { { .type = PF_ST_RT, .off = _OUT(rt), .cb = snl_attr_get_uint8 }, { .type = PF_ST_RT_IFNAME, .off = _OUT(rt_ifname), .cb = snl_attr_store_ifname }, }; -static struct snl_field_parser fp_state[] = { -}; #undef _IN #undef _OUT -SNL_DECLARE_PARSER(state_parser, struct genlmsghdr, fp_state, ap_state); +SNL_DECLARE_PARSER(state_parser, struct genlmsghdr, snl_f_p_empty, ap_state); static const struct snl_hdr_parser *all_parsers[] = { &state_parser, &skey_parser, &speer_parser, @@ -2042,9 +2034,8 @@ struct pfctl_nl_clear_states { static struct snl_attr_parser ap_clear_states[] = { { .type = PF_CS_KILLED, .off = _OUT(killed), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_clear_states[] = {}; #undef _OUT -SNL_DECLARE_PARSER(clear_states_parser, struct genlmsghdr, fp_clear_states, ap_clear_states); +SNL_DECLARE_PARSER(clear_states_parser, struct genlmsghdr, snl_f_p_empty, ap_clear_states); static int _pfctl_clear_states_h(struct pfctl_handle *h, const struct pfctl_kill *kill, @@ -2478,10 +2469,9 @@ static struct snl_attr_parser ap_natlook[] = { { .type = PF_NL_SRC_PORT, .off = _OUT(sport), .cb = snl_attr_get_uint16 }, { .type = PF_NL_DST_PORT, .off = _OUT(dport), .cb = snl_attr_get_uint16 }, }; -static struct snl_field_parser fp_natlook[] = {}; #undef _IN #undef _OUT -SNL_DECLARE_PARSER(natlook_parser, struct genlmsghdr, fp_natlook, ap_natlook); +SNL_DECLARE_PARSER(natlook_parser, struct genlmsghdr, snl_f_p_empty, ap_natlook); int pfctl_natlook(struct pfctl_handle *h, const struct pfctl_natlook_key *k, @@ -2597,9 +2587,8 @@ struct pfctl_nl_timeout { static struct snl_attr_parser ap_get_timeout[] = { { .type = PF_TO_SECONDS, .off = _OUT(seconds), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_get_timeout[] = {}; #undef _OUT -SNL_DECLARE_PARSER(get_timeout_parser, struct genlmsghdr, fp_get_timeout, ap_get_timeout); +SNL_DECLARE_PARSER(get_timeout_parser, struct genlmsghdr, snl_f_p_empty, ap_get_timeout); int pfctl_get_timeout(struct pfctl_handle *h, uint32_t timeout, uint32_t *seconds) @@ -2680,9 +2669,8 @@ struct pfctl_nl_limit { static struct snl_attr_parser ap_get_limit[] = { { .type = PF_LI_LIMIT, .off = _OUT(limit), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_get_limit[] = {}; #undef _OUT -SNL_DECLARE_PARSER(get_limit_parser, struct genlmsghdr, fp_get_limit, ap_get_limit); +SNL_DECLARE_PARSER(get_limit_parser, struct genlmsghdr, snl_f_p_empty, ap_get_limit); int pfctl_get_limit(struct pfctl_handle *h, const int index, uint *limit) @@ -2730,9 +2718,8 @@ struct pfctl_nl_begin_addrs { static struct snl_attr_parser ap_begin_addrs[] = { { .type = PF_BA_TICKET, .off = _OUT(ticket), .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_begin_addrs[] = {}; #undef _OUT -SNL_DECLARE_PARSER(begin_addrs_parser, struct genlmsghdr, fp_begin_addrs, ap_begin_addrs); +SNL_DECLARE_PARSER(begin_addrs_parser, struct genlmsghdr, snl_f_p_empty, ap_begin_addrs); int pfctl_begin_addrs(struct pfctl_handle *h, uint32_t *ticket) @@ -2815,8 +2802,7 @@ pfctl_add_addr(struct pfctl_handle *h, const struct pfioc_pooladdr *pa, int whic static const struct snl_attr_parser ap_get_addrs[] = { { .type = PF_AA_NR, .off = 0, .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_get_addrs[] = {}; -SNL_DECLARE_PARSER(get_addrs_parser, struct genlmsghdr, fp_get_addrs, ap_get_addrs); +SNL_DECLARE_PARSER(get_addrs_parser, struct genlmsghdr, snl_f_p_empty, ap_get_addrs); int pfctl_get_addrs(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, @@ -2877,8 +2863,7 @@ static const struct snl_attr_parser ap_get_addr[] = { { .type = PF_AA_ANCHOR, .off = _OUT(anchor), .arg_u32 = MAXPATHLEN, .cb = snl_attr_copy_string }, { .type = PF_AA_ADDR, .off = _OUT(addr), .arg = &pool_addr_parser, .cb = snl_attr_get_nested }, }; -static struct snl_field_parser fp_get_addr[] = {}; -SNL_DECLARE_PARSER(get_addr_parser, struct genlmsghdr, fp_get_addr, ap_get_addr); +SNL_DECLARE_PARSER(get_addr_parser, struct genlmsghdr, snl_f_p_empty, ap_get_addr); #undef _OUT int @@ -2927,8 +2912,7 @@ static const struct snl_attr_parser ap_ruleset[] = { { .type = PF_RS_NR, .off = _OUT(nr), .cb = snl_attr_get_uint32 }, { .type = PF_RS_NAME, .off = _OUT(name), .arg = (void *)PF_ANCHOR_NAME_SIZE, .cb = snl_attr_copy_string }, }; -static struct snl_field_parser fp_ruleset[] = {}; -SNL_DECLARE_PARSER(ruleset_parser, struct genlmsghdr, fp_ruleset, ap_ruleset); +SNL_DECLARE_PARSER(ruleset_parser, struct genlmsghdr, snl_f_p_empty, ap_ruleset); #undef _OUT int @@ -3031,9 +3015,8 @@ static struct snl_attr_parser ap_srcnode[] = { { .type = PF_SN_CONNECTION_RATE, .off = _OUT(conn_rate), .arg = &pfctl_threshold_parser, .cb = snl_attr_get_nested }, { .type = PF_SN_NAF, .off = _OUT(naf), .cb = snl_attr_get_uint8 }, }; -static struct snl_field_parser fp_srcnode[] = {}; #undef _OUT -SNL_DECLARE_PARSER(srcnode_parser, struct genlmsghdr, fp_srcnode, ap_srcnode); +SNL_DECLARE_PARSER(srcnode_parser, struct genlmsghdr, snl_f_p_empty, ap_srcnode); int pfctl_get_srcnodes(struct pfctl_handle *h, pfctl_get_srcnode_fn fn, void *arg) @@ -3076,8 +3059,7 @@ pfctl_get_srcnodes(struct pfctl_handle *h, pfctl_get_srcnode_fn fn, void *arg) static struct snl_attr_parser ap_ndel[] = { { .type = PF_T_NBR_DELETED, .off = 0, .cb = snl_attr_get_uint32 }, }; -static struct snl_field_parser fp_ndel[] = {}; -SNL_DECLARE_PARSER(ndel_parser, struct genlmsghdr, fp_ndel, ap_ndel); +SNL_DECLARE_PARSER(ndel_parser, struct genlmsghdr, snl_f_p_empty, ap_ndel); int pfctl_clear_tables(struct pfctl_handle *h, struct pfr_table *filter, diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index d10852ac7a36..0f3b3b44622d 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -132,6 +132,7 @@ struct snl_field_parser { uint16_t off_out; snl_parse_field_f *cb; }; +static const struct snl_field_parser snl_f_p_empty[] = {}; typedef bool snl_parse_attr_f(struct snl_state *ss, struct nlattr *attr, const void *arg, void *target); From nobody Thu Jan 16 09:18:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYcjS64s7z5lQTy; Thu, 16 Jan 2025 09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYcjS5WBnz3msp; Thu, 16 Jan 2025 09:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737019100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eWOyjuYWZW1+dm23UQi8oj2yWOdweTyi2NDmEd71EiQ=; b=wWNVvTlSwZ7wBXKhTiG+0Xg4cW48IoTtwh3Ik80M/VcH/GAcKPpQbx2EKu4bie69NCjz9P icAiLe5yPqXKks9ahjgOXTj4syYyl0zQl3bttbRQqlSRj0Li4qwPA65M97kRHevNd9mOpx PQEW2c0wU1aPYsaD19yN1BnfdpA3XIT9u/JsXNZ3wIWV8HWl7HBJM+G6Mn81o/cU2Ks9Fj ZsIE2rs+6j4ZLjSBYZNhr1W927UnBwQOkVZdt7rrdm+epnI8+ISo3teO/v2bwU3r9UogGa LnCv6B9OedB2f3N0VqMCG7bZ9P6zhuJKFO3EYVIGiiyv+XGr6AAgJT8zha7Rbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737019100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eWOyjuYWZW1+dm23UQi8oj2yWOdweTyi2NDmEd71EiQ=; b=NpkVH3bPwyE+TKz3W+aJGxAd3GajRx3emKvqnwt44X5IB61RDcY0vZLm+Iz33RJUxN6Zhd I/E2+na6gFNFS4qS2VN3DKIGS+VXkPOr0mJGWuGGUm5yCUDoj12YGibLRl2fBWnz/zpUqw c2VEVAROv4wrVrO5A88Z2koi9w70ULF+WZg4pdHfncKjTRV/yPjFdXCPUKC2hhRUXkqUyS zqVHbEK8wWtLoMz0frv5oA22xSL2S2IQQMkxcS1qkrjX+QpyVMw83Q6QZl+yf0crredCId AKDCKJoE4iHK1XDmozGdQH4ccx/5fWLDCLeOcKtI27+HTqazSMpFb3iEIJ6dCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737019100; a=rsa-sha256; cv=none; b=F6lGsp34Rqrlz+DCteslXCYeN3negtx0v4MfqOA6pBv0+nbWYRKBgWNc5Rd9jps9XDwUJR fsd3z6WwUFtab0V9FSponLzEmk+Qy+PILAhBBrNWQ/FP4/bflWOVXTTdMbr7EtViU//R76 9uXl+64OLNO9HG3D51JmP0SS4sAdaesTtLshWZvcE9Yv42dCxFjxiSa7Ej5JCUguh5qWTb VFYlMMuQLSILw6YsT3NIHqw4orkirYZDAQyOHtpqFGam9fzX1NFwxeH71y8sMFq/c127rP kGpTJ/ero6Z13wGLA9GcvzVezTeAP5VkEW9kMb2ZUNxLbc0xRg3lz+f4qzcSyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYcjS538MzB7B; Thu, 16 Jan 2025 09: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 50G9IKqA096020; Thu, 16 Jan 2025 09: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 50G9IKdh096017; Thu, 16 Jan 2025 09:18:20 GMT (envelope-from git) Date: Thu, 16 Jan 2025 09:18:20 GMT Message-Id: <202501160918.50G9IKdh096017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 16dee1cc652b - stable/14 - bintrans(1): qp switch to getopt_long List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16dee1cc652b21bb4d03fc24cec259861647a8d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=16dee1cc652b21bb4d03fc24cec259861647a8d5 commit 16dee1cc652b21bb4d03fc24cec259861647a8d5 Author: Baptiste Daroussin AuthorDate: 2025-01-08 11:13:54 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 09:18:14 +0000 bintrans(1): qp switch to getopt_long In preparation for more arguments, switch bintrans qp argument parsing to getopt_long, while here make the decodign argument being -d|--decode for compatibility with base64 encoding/decoding MFC After: 1 week Reviewed by: pstef Differential Revision: https://reviews.freebsd.org/D48380 (cherry picked from commit a8d9bd3fa5855fe7583ed05946296ab6b9937d69) --- usr.bin/bintrans/bintrans.1 | 4 +-- usr.bin/bintrans/qp.c | 61 +++++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index 3376ecd332ed..4177a5c6b9eb 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 23, 2024 +.Dd January 8, 2025 .Dt BINTRANS 1 .Os .Sh NAME @@ -230,7 +230,7 @@ through a dedicated program: is a quoted-printable converter and accepts the following options: .Bl -tag -width indent -.It Fl u +.It Fl d Decode. .It Fl o Ar output_file Output to diff --git a/usr.bin/bintrans/qp.c b/usr.bin/bintrans/qp.c index c2c9dfa7a224..3bff47945acf 100644 --- a/usr.bin/bintrans/qp.c +++ b/usr.bin/bintrans/qp.c @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -151,44 +152,50 @@ static void usage(void) { fprintf(stderr, - "usage: bintrans qp [-u] [-o outputfile] [file name]\n"); + "usage: bintrans qp [-d] [-o outputfile] [file name]\n"); } int main_quotedprintable(int argc, char *argv[]) { - int i; + int ch; bool encode = true; FILE *fp = stdin; FILE *fpo = stdout; - for (i = 1; i < argc; ++i) { - if (argv[i][0] == '-') { - switch (argv[i][1]) { - case 'o': - if (++i >= argc) { - fprintf(stderr, "qp: -o requires a file name.\n"); - exit(EXIT_FAILURE); - } - fpo = fopen(argv[i], "w"); - if (fpo == NULL) { - perror(argv[i]); - exit(EXIT_FAILURE); - } - break; - case 'u': - encode = false; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } else { - fp = fopen(argv[i], "r"); - if (fp == NULL) { - perror(argv[i]); + static const struct option opts[] = + { + { "decode", no_argument, NULL, 'd'}, + { "output", required_argument, NULL, 'o'}, + {NULL, no_argument, NULL, 0} + }; + + while ((ch = getopt_long(argc, argv, "do:u", opts, NULL)) != -1) { + switch(ch) { + case 'o': + fpo = fopen(optarg, "w"); + if (fpo == NULL) { + perror(optarg); exit(EXIT_FAILURE); } + break; + case 'u': + /* FALLTHROUGH for backward compatibility */ + case 'd': + encode = false; + break; + default: + usage(); + exit(EXIT_FAILURE); + } + }; + argc -= optind; + argv += optind; + if (argc > 0) { + fp = fopen(argv[0], "r"); + if (fp == NULL) { + perror(argv[0]); + exit(EXIT_FAILURE); } } qp(fp, fpo, encode); From nobody Thu Jan 16 09:18:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYcjV0kYjz5lQP7; Thu, 16 Jan 2025 09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYcjT6sZpz3mnv; Thu, 16 Jan 2025 09: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=1737019102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yrNr6Ssphe5mSAioFOsjT46UJVnO2ASjAATUfErB6SE=; b=j1Vimv2YoIwOPkg0QfJvmW9G8K/r/XA38V+nY99iWfz1gOKcao5GXN9imZRXzniE/kZzdJ rQdJIFf0PQxv1WULmjyXWNw0XAYAae6RRccMESuhtZkaUd7iUAbq0XIkDctdNH51RRKpMn VPF1PrR9tXsi25VgoEnJUgZWcx3rRmRBpeazK3EdqsYKLoqaQLVnYxc6iFvMmQBVefQZIW ZvzJYBxsdUEQcgIwv71mY23ZLEg3eMJeSqz6ur5XoKngbdgWpLXs10qn4rDP+6G1cyLyy9 FG5p/BFJ75YTmTW6SV4HX7fAwTpLZuoatrEHuFpCAWvJeIcWp1w3/tZvSOvD7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737019102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yrNr6Ssphe5mSAioFOsjT46UJVnO2ASjAATUfErB6SE=; b=vJ910Q4fooOpCKQg0ZPCeG4CKWJ1kG4rXEaB79VHrJgGYPTYjl1h+HtmEEu8lv9XNFBzoD inWZNJi6rV3Od/4W1Ty7HEbqkXXJd/G9/tc0SC0AGQUF4u8kO+5mPOiz4NbcicL8h5FLwr SQw2cqjBYTSoM5JiLpjXAfAnfskruiULKVjxrAX+qdnWgR78+5SQUQsIDzfG0WN32pIKP3 WCCvs9Pdj6yuiwRfEckDmItQdr0VIYS9za8q9/qI6Zc4n7GrJ/3WJb6cNVmYBa0BEXJrZ4 Ooe8cpQs0gdmFjl54y42pQf2sNHu/bsUC4lWA8vEFuW3BuGv89VwK+wK3ohoZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737019102; a=rsa-sha256; cv=none; b=iOb6z2ORHDYevrYUNas5qKm0kCdZJXsqLzobKAJyDOhl3cFcWZELwUFZ79oiOiTG9y/9pa 7VRvOtOcRDpLn4pnn/dtdDvyz1v2u+fP1ZszZGfQVTWUMypnr6RwKwp9hJbHDCrEnGhfLq eV4WreKsSIBAbZ+ENklXP59wT03mm16b+b+ZUIfteNLloDzc9OM9+WQi16XKzSppTVxCbk z3T7Gv5dpbLgQXg6Y574kfS028DROeRZ95a1nI5juE1+5zZZuPJp17E2kOI5gHVBB47D5B Szj49MFDy4p+123ASnmjTpOTqHfrcGOe2pP6eQ/lu53Ukf5sbHctLMoSuXFLng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYcjT6KHjzB7C; Thu, 16 Jan 2025 09:18: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 50G9IL0R096069; Thu, 16 Jan 2025 09:18:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50G9IL1G096065; Thu, 16 Jan 2025 09:18:21 GMT (envelope-from git) Date: Thu, 16 Jan 2025 09:18:21 GMT Message-Id: <202501160918.50G9IL1G096065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 1795eae9a2cf - stable/14 - bintrans(1): RFC2047 variant of quoted print List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1795eae9a2cfdd0d83dc2b76420d55d363627ae7 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=1795eae9a2cfdd0d83dc2b76420d55d363627ae7 commit 1795eae9a2cfdd0d83dc2b76420d55d363627ae7 Author: Baptiste Daroussin AuthorDate: 2025-01-08 12:39:30 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 09:18:14 +0000 bintrans(1): RFC2047 variant of quoted print MFC After: 1 week Reviewed by: pstref Differential Revision: https://reviews.freebsd.org/D48381 (cherry picked from commit beab8b1ddf86a88e0605562f2cc1d6a26c68604f) --- usr.bin/bintrans/bintrans.1 | 2 ++ usr.bin/bintrans/qp.c | 32 +++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index 4177a5c6b9eb..02571067c8f0 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -236,6 +236,8 @@ Decode. Output to .Ar output_file instead of standard output. +.It fl r +Encode/Decode in RFC2047 specific variant. .El .Sh EXAMPLES The following example packages up a source tree, compresses it, diff --git a/usr.bin/bintrans/qp.c b/usr.bin/bintrans/qp.c index 3bff47945acf..862db437f4e0 100644 --- a/usr.bin/bintrans/qp.c +++ b/usr.bin/bintrans/qp.c @@ -51,7 +51,7 @@ decode_char(const char *s) static void -decode_quoted_printable(const char *body, FILE *fpo) +decode_quoted_printable(const char *body, FILE *fpo, bool rfc2047) { while (*body != '\0') { switch (*body) { @@ -80,6 +80,12 @@ decode_quoted_printable(const char *body, FILE *fpo) fputc(decode_char(body), fpo); body += 2; break; + case '_': + if (rfc2047) { + fputc(0x20, fpo); + break; + } + /* FALLTHROUGH */ default: fputc(*body, fpo); break; @@ -89,7 +95,7 @@ decode_quoted_printable(const char *body, FILE *fpo) } static void -encode_quoted_printable(const char *body, FILE *fpo) +encode_quoted_printable(const char *body, FILE *fpo, bool rfc2047) { const char *end = body + strlen(body); size_t linelen = 0; @@ -111,7 +117,10 @@ encode_quoted_printable(const char *body, FILE *fpo) if ((*body == ' ' || *body == '\t') && body + 1 < end && (body[1] != '\n' && body[1] != '\r')) { - fputc(*body, fpo); + if (*body == 0x20 && rfc2047) + fputc('_', fpo); + else + fputc(*body, fpo); prev = *body; } else { fprintf(fpo, "=%02X", (unsigned char)*body); @@ -135,16 +144,16 @@ encode_quoted_printable(const char *body, FILE *fpo) } static void -qp(FILE *fp, FILE *fpo, bool encode) +qp(FILE *fp, FILE *fpo, bool encode, bool rfc2047) { char *line = NULL; size_t linecap = 0; - void (*codec)(const char *line, FILE *f); + void (*codec)(const char *line, FILE *f, bool rfc2047); codec = encode ? encode_quoted_printable : decode_quoted_printable ; while (getline(&line, &linecap, fp) > 0) - codec(line, fpo); + codec(line, fpo, rfc2047); free(line); } @@ -152,7 +161,7 @@ static void usage(void) { fprintf(stderr, - "usage: bintrans qp [-d] [-o outputfile] [file name]\n"); + "usage: bintrans qp [-d] [-r] [-o outputfile] [file name]\n"); } int @@ -160,6 +169,7 @@ main_quotedprintable(int argc, char *argv[]) { int ch; bool encode = true; + bool rfc2047 = false; FILE *fp = stdin; FILE *fpo = stdout; @@ -167,10 +177,11 @@ main_quotedprintable(int argc, char *argv[]) { { "decode", no_argument, NULL, 'd'}, { "output", required_argument, NULL, 'o'}, + { "rfc2047", no_argument, NULL, 'r'}, {NULL, no_argument, NULL, 0} }; - while ((ch = getopt_long(argc, argv, "do:u", opts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "do:ru", opts, NULL)) != -1) { switch(ch) { case 'o': fpo = fopen(optarg, "w"); @@ -184,6 +195,9 @@ main_quotedprintable(int argc, char *argv[]) case 'd': encode = false; break; + case 'r': + rfc2047 = true; + break; default: usage(); exit(EXIT_FAILURE); @@ -198,7 +212,7 @@ main_quotedprintable(int argc, char *argv[]) exit(EXIT_FAILURE); } } - qp(fp, fpo, encode); + qp(fp, fpo, encode, rfc2047); return (EXIT_SUCCESS); } From nobody Thu Jan 16 13:10:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYjsm41mvz5kR1M; Thu, 16 Jan 2025 13:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYjsm3HYFz44K6; Thu, 16 Jan 2025 13:10:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737033052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FjPVXF1c+o1IAhjLekuykmhydHYl5lGwDGZqKuDnWTw=; b=Cp24wxLd0JHQQOD2rHPyBw70dyftEdYM+byjSG3B7VJJMHVT8QcQHvLFXKB8JNVTCkN0D4 8Y/OLlJINqTi9r5phYRSC5f0jLXODsxO7N74llDF0JZKvjDHVYCxye/PpjM5ofl32bS9Vc JyWQuc/a4PLdCdWiFP76f7lbz0VGW2eWwC+P7FWGFciYUIgCF0/9tKEhhUQdNcgv7E7ZcW 6Ag1/4lIe22C3hQDEzjo57tKI4cBblgiw4tgXX8s/VzcvDN00qJ0XWoZpIlNoQnJSqhdyQ x2WV0tCHaKKRN6smxM93dRkc6qzNGXTWja58f8mRzhFbpwa9TO9tidRd7JTe5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737033052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FjPVXF1c+o1IAhjLekuykmhydHYl5lGwDGZqKuDnWTw=; b=rxig5kyBM3c45a9MQTf7koYSXmd1+ieajpFpfh+ZtELLhe0fZEfAZsiYfnc2Ues1mHZOlE dqYAlQHyz6M2RkF+P93om8682BlzVAbdPtDHzzLyfhdIBDq8J0wrQmVW++0oVC5/7i5n+C wHZHzj5op0H/lgKNKkf06Hk3SUM8FwekoaSpXSs0VG+oF5iO8OyVDV9WVdjIEJil0rgoJQ 5Eb7/jLF/nF0UK1L4ZeuOcy6AMDtktE0U9tbBQ6hgSAToI7mv5+3stqM6Ba1rRCo0gnYKp TzeycPvqoP181w2U8j5l3VtH08Ro75knRzTL3Ik/XchM3+sV/b7H2NVtSk8rEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737033052; a=rsa-sha256; cv=none; b=VkBwLg2eabHYqfCR6hSo0zNU/HeYtRT7VcANQ6ydoOOqRwuyu/BAB/dQHHpkm0E79PsBZG gxQS311XOR6+A3JJs958SoGBa3xK4O4uH9bg/QN1ro1rw4u3ce/42pFtolM2Xlvp/wLF5e YyPO1zYPaP8Iljmv46lqNv8pUEBdr0Q89hptegL2h5KdqAp1tWMf58mOSLuiWo5sZZ9uYM 3BG1xB7E1G1VunSp0atBCchUv0xe5XXyktLk5sXH571rPCX+HdwuAzLtD8NxPv51apxSNZ s+ZAnbciOzKtyKDrM6vSNN0eD3XmuATqAEYOX/WkmSPBlVMrYn0yf0gb/TXNbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYjsm2pn7zZhJ; Thu, 16 Jan 2025 13:10: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 50GDAq34040204; Thu, 16 Jan 2025 13:10:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GDAqwp040201; Thu, 16 Jan 2025 13:10:52 GMT (envelope-from git) Date: Thu, 16 Jan 2025 13:10:52 GMT Message-Id: <202501161310.50GDAqwp040201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f538407b1ac2 - stable/14 - hda: Add patch for Framework Laptop Intel 13th gen List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f538407b1ac238abda529d653d01ea6cc88dad27 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f538407b1ac238abda529d653d01ea6cc88dad27 commit f538407b1ac238abda529d653d01ea6cc88dad27 Author: Daniel Schaefer AuthorDate: 2025-01-04 15:53:37 +0000 Commit: Ed Maste CommitDate: 2025-01-16 13:10:33 +0000 hda: Add patch for Framework Laptop Intel 13th gen It uses the same audio codec as 12th gen (PCI ID 0x0002). Actually everything is the same, except the CPU. Signed-off-by: Daniel Schaefer (cherry picked from commit 48b9d78a0a9d795cfdeb56895a27309aadd50c77) --- sys/dev/sound/pci/hda/hdaa_patches.c | 3 ++- sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index d425e3c0080b..3c063deb0822 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -330,7 +330,8 @@ hdac_pin_patch(struct hdaa_widget *w) } } else if (id == HDA_CODEC_IDT92HD95B && (subid == FRAMEWORK_LAPTOP_0001_SUBVENDOR || - subid == FRAMEWORK_LAPTOP_0002_SUBVENDOR)) { + subid == FRAMEWORK_LAPTOP_0002_SUBVENDOR || + subid == FRAMEWORK_LAPTOP_0003_SUBVENDOR)) { switch (nid) { case 10: patch_str = "as=1 seq=15 color=Black loc=Left"; diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index d00ad4e4705c..f0e72f091a85 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -528,6 +528,7 @@ #define FRAMEWORK_VENDORID 0xf111 #define FRAMEWORK_LAPTOP_0001_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0001) #define FRAMEWORK_LAPTOP_0002_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0002) +#define FRAMEWORK_LAPTOP_0003_SUBVENDOR HDA_MODEL_CONSTRUCT(FRAMEWORK, 0x0003) /* All codecs you can eat... */ #define HDA_CODEC_CONSTRUCT(vendor, id) \ From nobody Thu Jan 16 13:51:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYkn52CYSz5kTNh; Thu, 16 Jan 2025 13:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYkn51jB3z47SH; Thu, 16 Jan 2025 13:51:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737035513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u1h7Ggj+T4ptfx2GtOtA9VxHPQZkJAZhqFIpn4ZcSxQ=; b=I6bd4VfDrTnTBRjE+31LEqWqxdbT4Gt0obmUu7s7wkaP5bxdEjY5VpnJll251KuDzRkxzq idE7cpsF2K08XWdZY5gBYedzgw/YHNGYp3u6Ka3cxyt68IK2wZ496aJnG33XQjD/pKxGG6 IUeGsZTp/sezBAY5RFuJ0M9XwQTWxT0n/JFN24lW3zU6Zft/KnMWpE6u14IdCWNcb/rxHD 7rWjH4+WFPFsZz0zPG5TX6YFJ8w2gBJb1VGkHv4E/AI/vr3+8hFqYhKzMW5DxXWj5COACE lj8yJmCtYW3lmUdkjUjo+pA/MgjV3qS6T+HJ9RMNBOBHfSREj6QtKUnpEM9YOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737035513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u1h7Ggj+T4ptfx2GtOtA9VxHPQZkJAZhqFIpn4ZcSxQ=; b=B/9BTWwxKqa3fduqoBIn1tZcOmq36ie+D0e50PloAlFL2BfM1GbAIFyA+p4Jh3eltZ7y+2 Y08qlm7pYnh+BvBICIKF1ZF46NLNKnDrq8ZdFE+E12FSkzsBhl1qa0Mf2qIAFsDbUfUPSr a+XlpNOV4O69NLJvrmFoIX/slQQ0x7t10jal4DlpJR5oXtt9JQjPsadInUXGTpz1vIIw2o QDsrI9elM5vKsh0/nDn8daeWm/gQQ0JKp1a3tB7nJWG/Eu+30CqV62jd7L17W5SPREHoTB 21l+LFhpioISfb5zAKQjzK9WPcU/BXz1GQeSQS6UlA3OanFApmQ7/ULSf5HKnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737035513; a=rsa-sha256; cv=none; b=L8H31dV7c0qP1Tz2Se8Uoz7ybweW1rzvbGTXjyMIkYXFBRbcIR7FOyGElzNWZS2dZhSg0X 6hU1KoKYNEc3waxcH9P5wq7XQ6m9w7+jlNrsquKo1On5VexQ+7SlyrajjCa1wnULLASWic ZQ8yNbcxp2scw0SLuFjVs8gD5oApQbBwUb23nMfvCBE8LK8aWQhuBHOvmHsIV69XhKqcTy wuF+V/YkDaw2ZutFvkjxkXu2xPTMu8ZdCthEZ51IP3t1U6/3j2muG2dAPoBRLJPthAXQ8u Mr/FDj3tdCcgn+NtQG0p0E5EmHr3UiFWqkFbqCeH8ljUpV7MoLZml4ju+cClGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYkn51J6gzbwJ; Thu, 16 Jan 2025 13:51: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 50GDprfE016813; Thu, 16 Jan 2025 13:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GDprls016810; Thu, 16 Jan 2025 13:51:53 GMT (envelope-from git) Date: Thu, 16 Jan 2025 13:51:53 GMT Message-Id: <202501161351.50GDprls016810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: e3b4a51580fc - main - pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3b4a51580fcd4a1ddf0d61feb5f325ff1de5420 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b4a51580fcd4a1ddf0d61feb5f325ff1de5420 commit e3b4a51580fcd4a1ddf0d61feb5f325ff1de5420 Author: Baptiste Daroussin AuthorDate: 2025-01-16 13:50:42 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 13:50:42 +0000 pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME Catchup with pkg(8) by expanding more variable when parsing repositories The only missing variable now is ARCH, this will have to wait for pkg 2.0 to be the lowest supported version. --- usr.sbin/pkg/config.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 2ad6c8a93756..26d7dd66b2a4 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -477,11 +477,26 @@ read_conf_file(const char *confpath, const char *requested_repo, struct ucl_parser *p; ucl_object_t *obj = NULL; const char *abi = pkg_get_myabi(); + char *major, *minor; + struct utsname uts; + + if (uname(&uts)) + err(EXIT_FAILURE, "uname"); if (abi == NULL) errx(EXIT_FAILURE, "Failed to determine ABI"); p = ucl_parser_new(0); + asprintf(&major, "%d", __FreeBSD_version/100000); + if (major == NULL) + err(EXIT_FAILURE, "asprintf"); + asprintf(&minor, "%d", (__FreeBSD_version / 1000) % 100); + if (minor == NULL) + err(EXIT_FAILURE, "asprintf"); ucl_parser_register_variable(p, "ABI", abi); + ucl_parser_register_variable(p, "OSNAME", uts.sysname); + ucl_parser_register_variable(p, "RELEASE", major); + ucl_parser_register_variable(p, "VERSION_MAJOR", major); + ucl_parser_register_variable(p, "VERSION_MINOR", minor); if (!ucl_parser_add_file(p, confpath)) { if (errno != ENOENT) @@ -505,6 +520,8 @@ read_conf_file(const char *confpath, const char *requested_repo, ucl_object_unref(obj); ucl_parser_free(p); + free(major); + free(minor); return (0); } From nobody Thu Jan 16 14:10:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYlBy4FBTz5kV07; Thu, 16 Jan 2025 14:10:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYlBy31P2z49n8; Thu, 16 Jan 2025 14:10:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737036650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BMC64/J7LELMKuHc1OjsgamgBemLWe0Cd7/D3W5vlSI=; b=UIZY1Mdgedu+ZSTADnaVXvDfSf356z6iYdgrO5hORrYBRHrUxGO9VS5X0Sqq/lLBM3juLV ejHCdVh/DCozMswwifDDBmucuq0/cE7UuS55ZgIfLd5tsDLDo702TldGH5XYlW1rxkklCs gDaXCA0cv4i+oSKGy9IRFQduILKEbc9F/FO6wFWKuPnJklw1kjM5Lhxm5YRd/87lZsNQaN iMt+lNWd3E8PiQ5b9Rui+myl0dn8jnu5NC26UZ2IifYWHJSe/5eB7aUwXQJikRKnuctqG0 wEqX3bCFNw4PzUWSZ25mZszy/EPlLrqSVjIwC0Se2l5HoEBbkzcTsmZIG8Ji5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737036650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BMC64/J7LELMKuHc1OjsgamgBemLWe0Cd7/D3W5vlSI=; b=xOU6nZfqmDueIwHu3/Ed2C7wsa3P4V3LgIpdWrY+Di+xOgPzW0BF5svfKudqkQJmx7S2Sk SE6JOwU2fxrHVmU7JjcXUvy/LaZzfc9qGog24iNRcaR7BFQSz7pnbBJL+KEJYKeaQY273r ZZnbEjSCfdD5dtt4wwblF9Mr3Uh8SeAK+jg6vbIO6xOr9ekZtHBnjCeVoIce8+OgzxD4kt m3nPpnmgnq42IWjL2IXFgyalRwUB8r3ftL0tsUBb5HQOsAqJUACk9KOsO82OidifYMd1+M znXkTk0cfAnyIyBySN1wbuQ7rEXIHTqY8VniGRbpq1NjndMCgq9ymLM+XFFJhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737036650; a=rsa-sha256; cv=none; b=NDXbRlr25zp8cmnFhItJObOXth86GaE9iXMBy0X3sN30ymjxuPqYYAeIHtK5d6D/Se5yMq 89pGWSc2fKgjnlLPlNCDtw0rH+huHMJv7xc4eZgJ8Osf27CTglTjC1TB4udiMvhLZGs+J8 FGpP0FVOrgiqvVwbfWSvIbeD4s3e0RksZ2seysVCLljBZKduy6vsOcXQQWEV6sxJWGYQ42 JfWmZH53CoUHp7DEns+jQVcBFAEQCKJZlxzVxB2/L6cym16hD6a22LUgCVpVTo66+ZqAhF sCCy4vHViG9882MruIE7dXBqmLBjrVP7YgnAwr8Fes+YEUqU/PC5eYRI4M2akg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYlBy2TFNzc0H; Thu, 16 Jan 2025 14:10: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 50GEAoG3050923; Thu, 16 Jan 2025 14:10:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GEAoXq050920; Thu, 16 Jan 2025 14:10:50 GMT (envelope-from git) Date: Thu, 16 Jan 2025 14:10:50 GMT Message-Id: <202501161410.50GEAoXq050920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9dc96d8bc3f2 - main - libusb: hotplug, use events instead of a timer when possible List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dc96d8bc3f282fefb186670edbf07c7cc32f9c5 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc96d8bc3f282fefb186670edbf07c7cc32f9c5 commit 9dc96d8bc3f282fefb186670edbf07c7cc32f9c5 Author: Baptiste Daroussin AuthorDate: 2025-01-04 10:23:12 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 14:10:11 +0000 libusb: hotplug, use events instead of a timer when possible Try to fetch events from nlsysevent or devd to determine when to scan the usb bus for devices addition or removal. if none are available fallback on the regular timer based (4s) scanner if devd socket or netlink socket is closed or error fallback on the timer based method. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D48300 --- lib/libusb/libusb10.c | 8 ++ lib/libusb/libusb10.h | 16 ++++ lib/libusb/libusb10_hotplug.c | 173 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 196 insertions(+), 1 deletion(-) diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 6d9c11910ea0..afa25eabf459 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -155,6 +155,7 @@ libusb_init_context(libusb_context **context, return (LIBUSB_ERROR_INVALID_PARAM); memset(ctx, 0, sizeof(*ctx)); + ctx->devd_pipe = -1; debug = getenv("LIBUSB_DEBUG"); if (debug != NULL) { @@ -280,6 +281,13 @@ libusb_exit(libusb_context *ctx) HOTPLUG_LOCK(ctx); td = ctx->hotplug_handler; ctx->hotplug_handler = NO_THREAD; + if (ctx->usb_event_mode == usb_event_devd) { + close(ctx->devd_pipe); + ctx->devd_pipe = -1; + } else if (ctx->usb_event_mode == usb_event_netlink) { + close(ctx->ss.fd); + ctx->ss.fd = -1; + } HOTPLUG_UNLOCK(ctx); pthread_join(td, &ptr); diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index 544364386061..3402e0377c92 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -30,6 +30,12 @@ #ifndef LIBUSB_GLOBAL_INCLUDE_FILE #include +#include +#include +#include +#include +#include + #endif #define GET_CONTEXT(ctx) (((ctx) == NULL) ? usbi_default_context : (ctx)) @@ -90,12 +96,22 @@ struct libusb_hotplug_callback_handle_struct { TAILQ_HEAD(libusb_device_head, libusb_device); +typedef enum { + usb_event_none, + usb_event_scan, + usb_event_devd, + usb_event_netlink +} usb_event_mode_t; + struct libusb_context { int debug; int debug_fixed; int ctrl_pipe[2]; int tr_done_ref; int tr_done_gen; + usb_event_mode_t usb_event_mode; + int devd_pipe; + struct snl_state ss; pthread_mutex_t ctx_lock; pthread_mutex_t hotplug_lock; diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index 98903686f76b..fd016e972dfb 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -23,6 +23,7 @@ * SUCH DAMAGE. */ +#include #ifdef LIBUSB_GLOBAL_INCLUDE_FILE #include LIBUSB_GLOBAL_INCLUDE_FILE #else @@ -39,6 +40,10 @@ #include #include #include +#include +#include +#include +#include #endif #define libusb_device_handle libusb20_device @@ -49,6 +54,118 @@ #include "libusb.h" #include "libusb10.h" +#define DEVDPIPE "/var/run/devd.seqpacket.pipe" +#define DEVCTL_MAXBUF 1024 + +typedef enum { + broken_event, + invalid_event, + valid_event, +} event_t; + +static bool +netlink_init(libusb_context *ctx) +{ + struct _getfamily_attrs attrs; + + if (modfind("nlsysevent") < 0) + kldload("nlsysevent"); + if (modfind("nlsysevent") < 0) + return (false); + if (!snl_init(&ctx->ss, NETLINK_GENERIC)) + return (false); + + if (!snl_get_genl_family_info(&ctx->ss, "nlsysevent", &attrs)) + return (false); + + for (unsigned int i = 0; i < attrs.mcast_groups.num_groups; i++) { + if (strcmp(attrs.mcast_groups.groups[i]->mcast_grp_name, + "USB") == 0) { + if (setsockopt(ctx->ss.fd, SOL_NETLINK, + NETLINK_ADD_MEMBERSHIP, + &attrs.mcast_groups.groups[i]->mcast_grp_id, + sizeof(attrs.mcast_groups.groups[i]->mcast_grp_id)) + == -1) { + return (false); + } + } + } + ctx->usb_event_mode = usb_event_netlink; + return (true); +} + +static bool +devd_init(libusb_context *ctx) +{ + struct sockaddr_un devd_addr; + + bzero(&devd_addr, sizeof(devd_addr)); + if ((ctx->devd_pipe = socket(PF_LOCAL, SOCK_SEQPACKET|SOCK_NONBLOCK, 0)) < 0) + return (false); + + devd_addr.sun_family = PF_LOCAL; + strlcpy(devd_addr.sun_path, DEVDPIPE, sizeof(devd_addr.sun_path)); + if (connect(ctx->devd_pipe, (struct sockaddr *)&devd_addr, + sizeof(devd_addr)) == -1) { + close(ctx->devd_pipe); + ctx->devd_pipe = -1; + return (false); + } + + ctx->usb_event_mode = usb_event_devd; + return (true); +} + +struct nlevent { + const char *name; + const char *subsystem; + const char *type; + const char *data; +}; + +#define _OUT(_field) offsetof(struct nlevent, _field) +static struct snl_attr_parser ap_nlevent_get[] = { + { .type = NLSE_ATTR_SYSTEM, .off = _OUT(name), .cb = snl_attr_get_string }, + { .type = NLSE_ATTR_SUBSYSTEM, .off = _OUT(subsystem), .cb = snl_attr_get_string }, + { .type = NLSE_ATTR_TYPE, .off = _OUT(type), .cb = snl_attr_get_string }, + { .type = NLSE_ATTR_DATA, .off = _OUT(data), .cb = snl_attr_get_string }, +}; +#undef _OUT + +SNL_DECLARE_GENL_PARSER(nlevent_get_parser, ap_nlevent_get); + +static event_t +verify_event_validity(libusb_context *ctx) +{ + if (ctx->usb_event_mode == usb_event_netlink) { + struct nlmsghdr *hdr; + struct nlevent ne; + + hdr = snl_read_message(&ctx->ss); + if (hdr != NULL && hdr->nlmsg_type != NLMSG_ERROR) { + memset(&ne, 0, sizeof(ne)); + if (!snl_parse_nlmsg(&ctx->ss, hdr, &nlevent_get_parser, &ne)) + return (broken_event); + if (strcmp(ne.subsystem, "DEVICE") == 0) + return (valid_event); + return (invalid_event); + } + return (invalid_event); + } else if (ctx->usb_event_mode == usb_event_devd) { + char buf[DEVCTL_MAXBUF]; + ssize_t len; + + len = read(ctx->devd_pipe, buf, sizeof(buf)); + if (len == 0 || (len < 0 && errno != EWOULDBLOCK)) + return (broken_event); + if (len > 0 && strstr(buf, "system=USB") != NULL && + strstr(buf, "subsystem=DEVICE") != NULL) + return (valid_event); + return (invalid_event); + } + return (broken_event); +} + static int libusb_hotplug_equal(libusb_device *_adev, libusb_device *_bdev) { @@ -105,6 +222,7 @@ libusb_hotplug_enumerate(libusb_context *ctx, struct libusb_device_head *phead) static void * libusb_hotplug_scan(void *arg) { + struct pollfd pfd; struct libusb_device_head hotplug_devs; libusb_hotplug_callback_handle acbh; libusb_hotplug_callback_handle bcbh; @@ -112,9 +230,51 @@ libusb_hotplug_scan(void *arg) libusb_device *temp; libusb_device *adev; libusb_device *bdev; + int timeout = INFTIM; + int nfds; + memset(&pfd, 0, sizeof(pfd)); + if (ctx->usb_event_mode == usb_event_devd) { + pfd.fd = ctx->devd_pipe; + pfd.events = POLLIN | POLLERR; + nfds = 1; + } else if (ctx->usb_event_mode == usb_event_netlink) { + pfd.fd = ctx->ss.fd; + pfd.events = POLLIN | POLLERR; + nfds = 1; + } else { + nfds = 0; + timeout = 4000; + } for (;;) { - usleep(4000000); + pfd.revents = 0; + if (poll(&pfd, nfds, timeout) > 0) { + switch (verify_event_validity(ctx)) { + case invalid_event: + continue; + case valid_event: + break; + case broken_event: + /* There are 2 cases for broken events: + * - devd and netlink sockets are not available + * anymore (devd restarted, nlsysevent unloaded) + * - libusb_exit has been called as it sets NO_THREAD + * this will result in exiting this loop and this thread + * immediately + */ + nfds = 0; + if (ctx->usb_event_mode == usb_event_devd) { + if (ctx->devd_pipe != -1) + close(ctx->devd_pipe); + } else if (ctx->usb_event_mode == usb_event_netlink) { + if (ctx->ss.fd != -1) + close(ctx->ss.fd); + } + ctx->usb_event_mode = usb_event_scan; + timeout = 4000; + break; + } + } HOTPLUG_LOCK(ctx); if (ctx->hotplug_handler == NO_THREAD) { @@ -122,6 +282,10 @@ libusb_hotplug_scan(void *arg) TAILQ_REMOVE(&ctx->hotplug_devs, adev, hotplug_entry); libusb_unref_device(adev); } + if (ctx->usb_event_mode == usb_event_devd) + close(ctx->devd_pipe); + else if (ctx->usb_event_mode == usb_event_netlink) + close(ctx->ss.fd); HOTPLUG_UNLOCK(ctx); break; } @@ -192,6 +356,13 @@ int libusb_hotplug_register_callback(libusb_context *ctx, ctx = GET_CONTEXT(ctx); + if (ctx->usb_event_mode == usb_event_none) { + HOTPLUG_LOCK(ctx); + if (!netlink_init(ctx) && !devd_init(ctx)) + ctx->usb_event_mode = usb_event_scan; + HOTPLUG_UNLOCK(ctx); + } + if (ctx == NULL || cb_fn == NULL || events == 0 || vendor_id < -1 || vendor_id > 0xffff || product_id < -1 || product_id > 0xffff || From nobody Thu Jan 16 14:25:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYlXK0F1Bz5kW4F; Thu, 16 Jan 2025 14:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYlXJ6Lhxz4Dcn; Thu, 16 Jan 2025 14:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737037552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6drp7CAcq04pCzP9YWw36T9pyLv9PRRHt9gQD+ViXQ=; b=xJrOcAuivteimdLLljEdCW/pgVftsWPEm0m426uO9IjBuY9HRFMJ12NIIAo4ezBH8sYqpO H8x1cvcSOOPSRGUMKW43VV0+Dm/Z/+9ObyL+GXb5cEtP51GFdzZll4qdd08dMbp11npknk dETHE3yyKRs54bAogC+/s1zakR2uQTLI9qUcBMCdwWs+QmkbK6EEqS4MSWE+Qq5loJWTZ6 PPBLivv0AgVULP17udbp8NxSkCMDYlpxf1BSZnd1dP9Z/jDS9S+E3JVgxlB4eN3pe50GNO nsXDtTd88RIG/4aJ3ed4D5Y4iUxpz4AKlo/4lAeNX99MfiJT15J2vg1k61XMyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737037552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b6drp7CAcq04pCzP9YWw36T9pyLv9PRRHt9gQD+ViXQ=; b=QgA2d1U831d45ugdQe/yyWFPtxZIimoBMhlzo160zS2MsJiKL2oVb/15C1e5WL4WbdBSPZ 8bXPWZs1wb8MQTmpCaPR4ew7xgMJPPbigfk8ilIKo8eSzSlFMc/bWaA8GyZ4M1u9OvvApd o7N0dTZuert42yTv/BmA9hGys687sYJeycQPrAh0GL+P2PXZBQPXiNLRaLLqn+rv3GM4QM 5l+1SGzOdxfUQkGErYsu8TkwdBRsfnsrUXhguDhzlGbIGPDbZoZsxVbJMj267XAvlbqT1h W9OQEo1d7qEVvmUvTsN5QVWLwnxmnHkBSErezBYvcr2YVNuK0XUWbWYo7Rp+qQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737037552; a=rsa-sha256; cv=none; b=VX3HBFxY82BNXN0UEzW2IhbMMBY3CT5vYOXmaokO4dKr2lOI4gYplNTEezBi4jaBp+F0vW VhQdjwZt4uguFWGukgYowm/ZzfcEoqsAwvTLg+JG5NPn/RNoOa8xASgcm8ZmSMha33+vzw sj5ywpGxk6a9BS+qfuQU1h5un7pyv1HutsdyVyJtD35/hJEoR7WrDzy2hFD15OLH6Scgot FBWb1A6MfDzRDV+e4Bt4cMacAeRJ26J5iyee1lwsITaOy34NVvh30ear62j6rIHTWiu/JC ir6rqWn4LsAjRX0pBrq/XB5IrfMC0Gj8NGL3Zg2sLhOxhkqIROlo6tQ7CuXHAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYlXJ5f5zzcpF; Thu, 16 Jan 2025 14:25: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 50GEPqN2075702; Thu, 16 Jan 2025 14:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GEPq7N075699; Thu, 16 Jan 2025 14:25:52 GMT (envelope-from git) Date: Thu, 16 Jan 2025 14:25:52 GMT Message-Id: <202501161425.50GEPq7N075699@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: 621569254cd0 - main - hwpstate_amd: add amd pstate for zen4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 621569254cd0b0639488aa5d7b8143cef7c90a18 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=621569254cd0b0639488aa5d7b8143cef7c90a18 commit 621569254cd0b0639488aa5d7b8143cef7c90a18 Author: SHENGYI HONG AuthorDate: 2025-01-15 11:18:34 +0000 Commit: Mark Johnston CommitDate: 2025-01-16 14:25:45 +0000 hwpstate_amd: add amd pstate for zen4 Co-authored-by: Daniel Schaefer Reviewed by: markj MFC after: 2 weeks Sponsored by: Framework Computer Inc Differential Revision: https://reviews.freebsd.org/D48461 --- sys/x86/cpufreq/hwpstate_amd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c index 59a3a64e6495..5a2ff7611228 100644 --- a/sys/x86/cpufreq/hwpstate_amd.c +++ b/sys/x86/cpufreq/hwpstate_amd.c @@ -461,6 +461,7 @@ hwpstate_get_info_from_msr(device_t dev) break; case 0x17: case 0x18: + case 0x19: did = AMD_17H_CUR_DID(msr); if (did == 0) { HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); From nobody Thu Jan 16 14:25:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYlXL0jb5z5kVfY; Thu, 16 Jan 2025 14:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYlXK6my2z4DCS; Thu, 16 Jan 2025 14:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737037554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRyHWvfX3RMwKaCzo4OOuARrSj5SoCOhomCh4nfjdso=; b=i9W37ofRI5ra1TreQTFwWHh3XLld9GEMSjPh0C8C/qaeVRp+TVo3vbF0OtVG5/YSXaZKOQ ozlvZrZTyaVzvlC0dNk5pswk/hSWqgGYFhVwMQRISW8Twv6eWddIzjwd0+FwOPhBn+R8X+ 3gVf5MKCsnu0OwdW0/znMY4ALLi6A2cnP14qPloA/iLDonLoPnjRwUEtt5aniEMvtqUntM umC93DIpHKhwy6qYMS2JVxYfMwgqpF2EsfsmLsTPqDb+rQqsR83XrI/QRSygqaBJd0h1Zy vIjqqntuicyccRnVLLr8AkA5oEMaUDztugjXWOGMFiLUOnQal5NZj0GGEK+zAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737037554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRyHWvfX3RMwKaCzo4OOuARrSj5SoCOhomCh4nfjdso=; b=KBCXJNVFX3HVvF10xqmUlo3eIsxkojLjnita+RqN1xJulTWTKwgC4lGTzi2lTzcYUo9wVW vGmjF7LgT/lUrLQAqvWxnezYU2Nid57pIT79QDLd/WdPET0LoFolbQshgPTNIzHQFGpNUh UGXN/hI6d5WrBAn78DmHkGJnmQJqD9tk5B+5iE2S0MP0/dwVbn0AE9aS6hfqoPCgcdFlXz JYyoA3/RFPGOy4SwA/Pfs7M1CYqZqlTKHyJ//n/pUoEytuwGX4fjbpLMWr+SR5AIcr6KUq ZejZZsNPXOBQuj4HaCBJL+CqsKVmVQg1TLD/bH4YiZXD/9cLc+YBnh/k/Fw3bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737037554; a=rsa-sha256; cv=none; b=S85fNnSwZkkMq70IvpzsQg7vxUaiMdQEpeHiKLXfhUqIjfnoGJQLHMGtZR9BSkLS+ELLn8 pxd1t7Vmqm3OF9s+7tjzGxzUhvkVJQhwkjeKDc0dV9FldnqbVO4Ce/hcFIsoV6CAGEmNs3 HP58NDE5hO6babmxt8uhJvN0PEc4JDKcsRxaIUydRMLCa0gGMedhDOtXjIrJwG5JzaL8ZV XNH/y/BqNabYr/eR++1a/c8JyO1hH9Aa36FinF5NBoJPALj7HS3btx92i5oVd/hTGLY6Bt qXPxvkrvqKe9Gq+AOfv8NE4ux7C8GJciwd5ZkJLjGrfRw0VBoS4s2Me/yHDu7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYlXK6K54zclm; Thu, 16 Jan 2025 14:25: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 50GEPrQd075757; Thu, 16 Jan 2025 14:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GEPr6M075754; Thu, 16 Jan 2025 14:25:53 GMT (envelope-from git) Date: Thu, 16 Jan 2025 14:25:53 GMT Message-Id: <202501161425.50GEPr6M075754@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: 0e6e1f14f0a7 - main - hwpstate_amd: add amd pstate for zen5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0e6e1f14f0a7cfabec38106e41cb2f7a39363e55 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0e6e1f14f0a7cfabec38106e41cb2f7a39363e55 commit 0e6e1f14f0a7cfabec38106e41cb2f7a39363e55 Author: SHENGYI HONG AuthorDate: 2024-12-09 03:18:18 +0000 Commit: Mark Johnston CommitDate: 2025-01-16 14:25:45 +0000 hwpstate_amd: add amd pstate for zen5 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47985 --- sys/x86/cpufreq/hwpstate_amd.c | 62 +++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c index 5a2ff7611228..a9305e571ece 100644 --- a/sys/x86/cpufreq/hwpstate_amd.c +++ b/sys/x86/cpufreq/hwpstate_amd.c @@ -43,6 +43,8 @@ * 31116 Rev 3.20 February 04, 2009 * BIOS and Kernel Developer's Guide(BKDG) for AMD Family 11h Processors * 41256 Rev 3.00 - July 07, 2008 + * Processor Programming Reference (PPR) for AMD Family 1Ah Model 02h, + * Revision C1 Processors Volume 1 of 7 - Sep 29, 2024 */ #include @@ -88,6 +90,8 @@ #define AMD_17H_CUR_DID(msr) (((msr) >> 8) & 0x3F) #define AMD_17H_CUR_FID(msr) ((msr) & 0xFF) +#define AMD_1AH_CUR_FID(msr) ((msr) & 0xFFF) + #define HWPSTATE_DEBUG(dev, msg...) \ do { \ if (hwpstate_verbose) \ @@ -163,6 +167,23 @@ static driver_t hwpstate_driver = { DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, 0, 0); +static int +hwpstate_amd_iscale(int val, int div) +{ + switch (div) { + case 3: /* divide by 1000 */ + val /= 10; + case 2: /* divide by 100 */ + val /= 10; + case 1: /* divide by 10 */ + val /= 10; + case 0: /* divide by 1 */ + ; + } + + return (val); +} + /* * Go to Px-state on all cpus, considering the limit register (if so * configured). @@ -462,13 +483,30 @@ hwpstate_get_info_from_msr(device_t dev) case 0x17: case 0x18: case 0x19: - did = AMD_17H_CUR_DID(msr); - if (did == 0) { - HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); - did = 1; + case 0x1A: + /* calculate freq */ + if (family == 0x1A) { + fid = AMD_1AH_CUR_FID(msr); + /* 1Ah CPU don't use a divisor */ + hwpstate_set[i].freq = fid; + if (fid > 0x0f) + hwpstate_set[i].freq *= 5; + else { + HWPSTATE_DEBUG(dev, + "unexpected fid: %d\n", fid); + return (ENXIO); + } + } else { + did = AMD_17H_CUR_DID(msr); + if (did == 0) { + HWPSTATE_DEBUG(dev, + "unexpected did: 0\n"); + did = 1; + } + fid = AMD_17H_CUR_FID(msr); + hwpstate_set[i].freq = (200 * fid) / did; } - fid = AMD_17H_CUR_FID(msr); - hwpstate_set[i].freq = (200 * fid) / did; + /* Vid step is 6.25mV, so scale by 100. */ hwpstate_set[i].volts = (155000 - (625 * AMD_17H_CUR_VID(msr))) / 100; @@ -479,16 +517,8 @@ hwpstate_get_info_from_msr(device_t dev) * section 2.5.2.1.6. */ hwpstate_set[i].power = AMD_17H_CUR_IDD(msr) * 1000; - switch (AMD_17H_CUR_IDIV(msr)) { - case 3: /* divide by 1000 */ - hwpstate_set[i].power /= 10; - case 2: /* divide by 100 */ - hwpstate_set[i].power /= 10; - case 1: /* divide by 10 */ - hwpstate_set[i].power /= 10; - case 0: /* divide by 1 */ - ; - } + hwpstate_set[i].power = hwpstate_amd_iscale( + hwpstate_set[i].power, AMD_17H_CUR_IDIV(msr)); hwpstate_set[i].power *= hwpstate_set[i].volts; /* Milli amps * milli volts to milli watts. */ hwpstate_set[i].power /= 1000; From nobody Thu Jan 16 14:51:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYm5X23QJz5kXBb for ; Thu, 16 Jan 2025 14:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYm5X1Nbqz4GgM; Thu, 16 Jan 2025 14:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737039072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcMQ0Io0cY1zT9aGnzZ0DJfK51fBOjOLYzjaa8l7KJQ=; b=piDs8OG7AXerzkYcCIbkmS9e3JNlNehqGnLYDAxx+zurGyGE1u+a/ueRcGJomAW0DeY78u OgrUvJFKCtZAk3wLm3rRHPpTrzsPUM29rBhR4Pkmz0vgQyXuJieY7oCqrwnkye/HAJGRoN DC0FL7dkzxwUH1e9rlCCOXk9GUc0YJ/+WTY+DYIMgpkhxXTbfeA8EKPglXPAjAHRL6Qr8+ eAsgX2PcicOWBFpW+skG4VjO1eoLviq5vNi/blu+iE85K9BGUk0vnPwudk/NGPZCUJxkQi BIwD1z+0tdff32UFmD9pNKJOTu52qynKp71QheIj5OOdGH85ryxq4MQUfO2skg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737039072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcMQ0Io0cY1zT9aGnzZ0DJfK51fBOjOLYzjaa8l7KJQ=; b=U+0n3QZkD6tNr/R9oU68a72kyZ3a8n5DwvrhTm4onsa9/Pend4LkrXnddkSlNbVgSrEUyd 1XvKfZJvPf6vFvfb1LbYtIUhnh58HuQeQagcHXFBQ0akqieE5IpLFkJWpqmsL6hKP1gzGp ARQXvlhYUfqydKHqm8jP/zMR26x3HNgi3GbPwi4I5o8dDB9lKrPB4kzp4/wGABaKJVRkCa F4wLXjS2yMb74h/rCASmB8FC00gsPYAZzatuSN2Vm2eH5QWVUlgsVomtXHPSNKYz3TGIc4 6rWsMR0HEvoWT7dyeLk9SdXUoS7y1zTtJ/3Udo0uqmL0x10Mi1NsLcphaxScPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737039072; a=rsa-sha256; cv=none; b=S26JyyPUkupXcrPdiOSMtjRzdlfWlSdRWaAf+hJ/yNlJNWTmP2fiLp0U87nVpMps5Jffv1 Xd/cys7Uicj/4AuKFBAfXH6ONmY15akEdWtRCel61y9MhN4l7UMkSKcd7fzJSKxfDdVg6p trXfRu41zh/qa31foZM+r3wzl+MCnnKudNS+9hyvX4+tu2aAoNl65khjG9YYPB+L7LFXYW KJYDMR6NutTzG03fw40Td9LsDdZSpjW9U7FBmv5kEvE334pFbXmpzwLYFvXnxV4iGkHsSr kzwjWVMA89Q0hciVHXAuDQNHMq4gsrLPMKcCISZ8c0GeuxBErbyoOifIzlyTOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYm5X0V7hzd4h; Thu, 16 Jan 2025 14:51: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 50GEpBZh024534; Thu, 16 Jan 2025 14:51:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GEpBA2024533; Thu, 16 Jan 2025 14:51:11 GMT (envelope-from git) Date: Thu, 16 Jan 2025 14:51:11 GMT Message-Id: <202501161451.50GEpBA2024533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: f56b67c46df5..a51c056eb719 - vendor/llvm-project/release-19.x - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-19.x X-Git-Reftype: branch X-Git-Commit: a51c056eb719e563e5f13babc5ed3792c9b88666 X-Git-Oldrev: f56b67c46df5f53882fd6d3ace1f7942689b6290 X-Git-Newrev: a51c056eb719e563e5f13babc5ed3792c9b88666 Auto-Submitted: auto-generated The branch vendor/llvm-project/release-19.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=f56b67c46df5..a51c056eb719 a51c056eb719 Vendor import of llvm-project branch release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. From nobody Thu Jan 16 14:51:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYm5X48T2z5kWv5 for ; Thu, 16 Jan 2025 14:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYm5X1c8Xz4GRV; Thu, 16 Jan 2025 14:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737039072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wCrpy94C7pWXpusxZ4o44Rjzw6DH3IrFQROryLIn7T4=; b=DvvVxw+OB5OXQMi3jBNs7f8HLew+y2E4GSBzY1vk84x4s+pjOuV2gTeKMS3EWgvb7EHc3w GechCW4gGQ7vDgxJEvsNDF59xlkeQ+ELKczH9rI9w9LMxzLM4XDzUgbv7cc5bKK/MtHaWo mfBHHpClEOapP3mpeBFDb16l03waAG48gvGjyiANq0grudDVqQQtXO3JAunRENUvcm5qrR ghSdWI9v4k3A3kW7VKH8MAxEA3/Z/untTuxicZP5/qml6NUm5kKTwL4ReqA9MLIntAREJc oVrKS+UYc0lc9TbQEuGjLgppgo5uu/D1IZ9oMiKILKJnxhZ3wdzWOrkVEiVUqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737039072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wCrpy94C7pWXpusxZ4o44Rjzw6DH3IrFQROryLIn7T4=; b=IcahgOa78ayDky4U6DegSCS0dopNnUVekEP2CZcdzxJKAm2sQ7OI6Vkr4nGGSzPW+rK6sq 7C7gNSRuR5lLD8IjdQ+wUFSF9ObgpuYu0LFjFHGgOGgs0sp9IoE6aMQckF6lTv3595du+y HtCfWch4J7Sj6ZZ+uos6izYVxLNPZfNs/+oaAMQuz1pNCzcUj51RJ6zkYdeeTyEX1zXuVZ DHWaG7lEEumsaskSI3sXKr0Mkz7YS4YlXuRSdeyretEEIQ3uHnskmDadCDt3/0ElXlfjXC IZj2/a3Fkx1ExBTtsv8USJhCQPsBYPfXhjlTpuCa5mZhnGHbUUXlrzXg2xcFJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737039072; a=rsa-sha256; cv=none; b=gni5LGkpgiBdiQUzgJiAYO+q8UFxPW0tiahrfI+oA+AOONUhAqJNq5fUt12wAq0NsxNCst tRg0+miaDJosBpKuSnu04WnQKEpMxhRhgf82MEms8T9qN1W6Z/rRhw7YTMysbPtGsltP9P +w4VqCGsnWaSfYo6Px2cT+8iXemHLejSZcMQGdC4AQL5Bqam2jXHYwJqp0PyBhboNtu1mv yBsGi+ixZdex8t3u275Ee4//vYHMqm22APGHv8bLho/0Dw+KdFaACXWsLJ/Tpq2ZXZroqA kM+s98CBiVd40RF3ByFWGtTNNCkEgPv1gdJxe9yVTq8z551ufMNaggnlBSXfbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYm5X0znSzd3H; Thu, 16 Jan 2025 14:51: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 50GEpCEQ024553; Thu, 16 Jan 2025 14:51:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GEpCwT024552; Thu, 16 Jan 2025 14:51:12 GMT (envelope-from git) Date: Thu, 16 Jan 2025 14:51:12 GMT Message-Id: <202501161451.50GEpCwT024552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: cf1d29eeabc1 - Create tag vendor/llvm-project/llvmorg-19.1.7-0-gcd708029e0b2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-19.1.7-0-gcd708029e0b2 X-Git-Reftype: annotated tag X-Git-Commit: cf1d29eeabc1f04fdbe599c35caf6ea53a5741a4 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-19.1.7-0-gcd708029e0b2 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-19.1.7-0-gcd708029e0b2 tag vendor/llvm-project/llvmorg-19.1.7-0-gcd708029e0b2 Tagger: Dimitry Andric TaggerDate: 2025-01-16 14:50:46 +0000 Tag llvm-project branch release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. commit a51c056eb719e563e5f13babc5ed3792c9b88666 Author: Dimitry Andric AuthorDate: 2025-01-16 14:50:29 +0000 Commit: Dimitry Andric CommitDate: 2025-01-16 14:50:29 +0000 Vendor import of llvm-project branch release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. From nobody Thu Jan 16 15:02:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYmLb5ST9z5kY16 for ; Thu, 16 Jan 2025 15:02:31 +0000 (UTC) (envelope-from freebsd@oldach.net) Received: from nuc.oldach.net (hmo.in-vpn.de [IPv6:2001:67c:1407:60::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-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "nuc.oldach.net", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYmLb1fBCz4Jct; Thu, 16 Jan 2025 15:02:31 +0000 (UTC) (envelope-from freebsd@oldach.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of freebsd@oldach.net designates 2001:67c:1407:60::1 as permitted sender) smtp.mailfrom=freebsd@oldach.net; dmarc=pass (policy=none) header.from=oldach.net Received: from nuc.oldach.net (localhost [127.0.0.1]) by nuc.oldach.net (8.18.1/8.18.1) with ESMTPS id 50GF2F2D009130 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 16 Jan 2025 16:02:15 +0100 (CET) (envelope-from freebsd@oldach.net) Received: (from hmo@localhost) by nuc.oldach.net (8.18.1/8.18.1/Submit) id 50GF2FSt009129; Thu, 16 Jan 2025 16:02:15 +0100 (CET) (envelope-from freebsd@oldach.net) Message-Id: <202501161502.50GF2FSt009129@nuc.oldach.net> X-Authentication-Warning: nuc.oldach.net: hmo set sender to freebsd@oldach.net using -f Subject: Re: git: 1795eae9a2cf - stable/14 - bintrans(1): RFC2047 variant of quoted print In-Reply-To: <202501160918.50G9IL1G096065@gitrepo.freebsd.org> from Baptiste Daroussin at "16 Jan 2025 09:18:21" To: bapt@FreeBSD.org (Baptiste Daroussin) Date: Thu, 16 Jan 2025 16:02:15 +0100 (CET) Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: freebsd@oldach.net (Helge Oldach) X-No-Archive: Yes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: inspected by milter-greylist-4.6.4 (nuc.oldach.net [0.0.0.0]); Thu, 16 Jan 2025 16:02:15 +0100 (CET) for IP:127.0.0.1 DOMAIN:localhost HELO:nuc.oldach.net FROM:freebsd@oldach.net RCPT: X-Spamd-Result: default: False [-3.79 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_LONG(-0.99)[-0.993]; DMARC_POLICY_ALLOW(-0.50)[oldach.net,none]; R_SPF_ALLOW(-0.20)[+mx:c]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; ASN(0.00)[asn:29670, ipnet:2001:67c:1400::/45, country:DE]; MIME_TRACE(0.00)[0:+]; FROM_NO_DN(0.00)[]; MISSING_XM_UA(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_XAW(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_NONE(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4YYmLb1fBCz4Jct Baptiste Daroussin wrote on Thu, 16 Jan 2025 10:18:21 +0100 (CET): > The branch stable/14 has been updated by bapt: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1795eae9a2cfdd0d83dc2b76420d55d363627ae7 > > commit 1795eae9a2cfdd0d83dc2b76420d55d363627ae7 > Author: Baptiste Daroussin > AuthorDate: 2025-01-08 12:39:30 +0000 > Commit: Baptiste Daroussin > CommitDate: 2025-01-16 09:18:14 +0000 > > bintrans(1): RFC2047 variant of quoted print > > MFC After: 1 week > Reviewed by: pstref > Differential Revision: https://reviews.freebsd.org/D48381 > > (cherry picked from commit beab8b1ddf86a88e0605562f2cc1d6a26c68604f) > --- > usr.bin/bintrans/bintrans.1 | 2 ++ > usr.bin/bintrans/qp.c | 32 +++++++++++++++++++++++--------- > 2 files changed, 25 insertions(+), 9 deletions(-) > > diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 > index 4177a5c6b9eb..02571067c8f0 100644 > --- a/usr.bin/bintrans/bintrans.1 > +++ b/usr.bin/bintrans/bintrans.1 > @@ -236,6 +236,8 @@ Decode. > Output to > .Ar output_file > instead of standard output. > +.It fl r > +Encode/Decode in RFC2047 specific variant. That should probably read "Fl" not "fl"? Kind regards Helge From nobody Thu Jan 16 15:23:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYmpH2kpBz5kYt5; Thu, 16 Jan 2025 15:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYmpH1sDQz4KjN; Thu, 16 Jan 2025 15:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737040983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9y6XAIQogJmz+Crj/oSVLuOl88XX8yoZEs54JKxCMo=; b=J4w93QB4GBlVfi+lTl5jFqkxXWWUUFqTK5h7kF9GVEBLtBgckUw33vzVAUJkPVFC2yxs3t +EEhjfjC5vpxYaPdY2N6/OzLK7LyAMDf8bS5EVBOG9TcqgYBhjxcDG99W/isQ05EYY/oM3 z8prailg6x0/9HsKXphCDNq+R0GPFGyYBxEFkqtZy3ttWJnak/gIPPDR4h92Q6D6cHlkco dWLmh1imxSKL/9+0R/yVD6g3LwTvvkUQrMKo28CHC5gJPZ6S03ZX9Qo8bpADxUG92IPrgY cMkDyPEUHF3HscgP/D4r0xDLxTesD76sYA2hpmEqAiLIIEctX8n8ae8smtR6Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737040983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e9y6XAIQogJmz+Crj/oSVLuOl88XX8yoZEs54JKxCMo=; b=DDr7DA44ByTshUSBJjY+Jw5f+pHywLzF7vqdcezgy6LKJjQ7BrjuxW+SNk96UcDH+J+i5d hZS4t12s2leIOJihBOXBFSS/NW8pJOXXPm46TG6HrNSQTI2e6KashQ0IWzimnZRLKcw8ku VDYOvBtERiiWOFjVahgC5ZXuIdnPLpv+/O40K63BouMZnQ+Pp7Q+a/Uaqqx4KJPfkfAhuy t3lhUw2lRbOzi+mwHAbg1I7wwSYCG716HP/JYvk+80QDuy5FBfPkkBZEpOQ7cGFERt+Jkg HwBVysqqaR1LoKC7oJSbJhAb2C+HolmTSFxthzrKED4i2gKLEy7eKccNif1RKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737040983; a=rsa-sha256; cv=none; b=Rk6hmJANP8T+RPF4tiNEYvA0llDAdmagOEcIL66cE8BQrUC+nLCe9W23MNpkAYMiMbihcA yYw1gxSVu++MXdVS/dY1bqenl9r2zjTg9VF8fUShrbkoflnS1g9yiIBT0W2bjw3CbTsS3/ qOxPQbSheL1IlxqxBdysWDldQFaZrYHfqCLvMvhBwpVuikwDZ1W8yrIYjE5nzIptj/PgO6 12NGb99GzgaADS7N9JGstchxgm1PmM5UtL20gt+INKYcxjfmFcR8lhXB/LBqii3cdBuMJk BLdUnxG9KaW/C8INPuPD5Ai15Q/5Z0p8h5ntVWyVDsjkegyKm2DeJ1KkunXjMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYmpH18N0zfHT; Thu, 16 Jan 2025 15:23: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 50GFN3R5087861; Thu, 16 Jan 2025 15:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFN3lV087858; Thu, 16 Jan 2025 15:23:03 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:23:03 GMT Message-Id: <202501161523.50GFN3lV087858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 635c2b82f60e - stable/13 - pf tests: check cleared time when zeroing stats for table addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 635c2b82f60e7417746a03d4d22c7fafd08f7e7c Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=635c2b82f60e7417746a03d4d22c7fafd08f7e7c commit 635c2b82f60e7417746a03d4d22c7fafd08f7e7c Author: Leonid Evdokimov AuthorDate: 2025-01-02 09:30:06 +0000 Commit: Kristof Provost CommitDate: 2025-01-16 08:42:04 +0000 pf tests: check cleared time when zeroing stats for table addresses Verify that we reset the cleared time when we zero an address' counters in a table. PR: 282877, 282984 Reviewed by: kp MFC after: 2 weeks Signed-off-by: Leonid Evdokimov Differential Revision: https://reviews.freebsd.org/D48242 (cherry picked from commit 0749d8134300b8e3c956e161890ab496247d2542) --- tests/sys/netpfil/pf/table.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index b650884c7c30..b2fb2ea728e8 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -116,6 +116,20 @@ zero_one_head() atf_set require.user root } +pft_cleared_ctime() +{ + jexec "$1" pfctl -t "$2" -vvT show | awk -v ip="$3" ' + ($1 == ip) { m = 1 } + ($1 == "Cleared:" && m) { + sub("[[:space:]]*Cleared:[[:space:]]*", ""); print; exit }' +} + +ctime_to_unixtime() +{ + # NB: it's not TZ=UTC, it's TZ=/etc/localtime + date -jf '%a %b %d %H:%M:%S %Y' "$1" '+%s' +} + zero_one_body() { epair_send=$(vnet_mkepair) @@ -145,16 +159,31 @@ zero_one_body() -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ jexec alcatraz pfctl -t foo -T show -vv + local uniq base ts1 ts3 + uniq=`jexec alcatraz pfctl -t foo -vvT show | sort -u | grep -c Cleared` + atf_check_equal 1 "$uniq" # time they were added + + base=`pft_cleared_ctime alcatraz foo 192.0.2.1` + atf_check -s exit:0 -e ignore \ jexec alcatraz pfctl -t foo -T zero 192.0.2.3 + ts1=`pft_cleared_ctime alcatraz foo 192.0.2.1` + atf_check_equal "$base" "$ts1" + + ts3=`pft_cleared_ctime alcatraz foo 192.0.2.3` + atf_check test "$ts1" != "$ts3" + + ts1=`ctime_to_unixtime "$ts1"` + ts3=`ctime_to_unixtime "$ts3"` + atf_check test $(( "$ts3" - "$ts1" )) -lt 10 # (3 pings * 2) + epsilon + atf_check test "$ts1" -lt "$ts3" + # We now have a zeroed and a non-zeroed counter, so both patterns # should match atf_check -s exit:0 -e ignore \ -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ - jexec alcatraz pfctl -t foo -T show -vv - atf_check -s exit:0 -e ignore \ -o match:'In/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ -o match:'Out/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ jexec alcatraz pfctl -t foo -T show -vv From nobody Thu Jan 16 15:23:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYmpJ0gHxz5kZ87; Thu, 16 Jan 2025 15:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYmpH69CJz4KrS; Thu, 16 Jan 2025 15:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737040983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fpt+/u5hV0JXvwrdl4Of6bdvZzin5D0lSuhfN6tr3Ew=; b=XbruP7c4GVVdCz/Wd2OcmYoPedU4QvwCBJ0VahUTn6ub0s2G0CxfzWPmZokuXTcfh5PYbW HPxA7IApJ27cE9G0nKqArBceib2ixURF7Da7XwmT/OttblfJqpBM1l+67KV4knFBtxDj5F fk6rCKAa9Ffc8E29EqIS/iigKoWD/+CAxPwjyHcxoKpN3ndkkPw92yLfxiwnLgCc8s3yG2 HOpSea6eEWQhCtNKCIQdWFUlWwmqOJHZONhvBUNOOf4vKoRub3yZeriAlIpdbrofKJtxz9 F8gRpdZ44gxYdUzj3wvgdAWuH4h1aXQaFQE1DIowbh2zBIWLUjqL7Hn0tYfvUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737040983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fpt+/u5hV0JXvwrdl4Of6bdvZzin5D0lSuhfN6tr3Ew=; b=fO2pPLgbDbhbA50EuFeAEkqfqlUlZs02LMF1sP+7mzzbAJGgXsJv3WEl5Y8FrZ3IhCHjnF w2+vd4GCDYhBq7lSFGdjvW8ONGxn/L4tJkRCQFvzaHQJrPUEUUUIk/tMC1Iw99bAr52qdr pTlwXNz0dKZOPalHd6yyg58UTMBLWC/YWLyp/5HSXzJ/QKBHaQAOsrLgkuD98S9xnowFC7 ZzJT2pCTiQ3lM4kMuS26ME6gn5C1HiGwIDrKqMpsVlZwKZpVxhOBamiSDpOXYJl7GaT2Wv 4WVkTd+V0wqLhC5IjTBVU89ebBN2kX7LPn7x7FT4SqI9qVJRfsigSjEhFVFffg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737040983; a=rsa-sha256; cv=none; b=obbexrXSEfEU3+dhHp2Hs1U01SNwPlsAO06CWb0D6RS5dFGHDaJxN0xEDglt5juxtCUeIe qg8GaaIUj02spotZ9uXhVOKEgeQM5wYcNP5QOHBJRBuBOvQL6spNXoffei3cOZRg03qLY6 N0r89bJ3fXx3SU+PuKp83LDDsQY9uWhtxGvcatvFzuWf5VwEUS/+0x/MMou9do/JNAbwx5 d+ZOkeLGzhs8sBhv8e+yfBsfvXf/gDbcnxaUY3Tpmo/FtohtxQTBsfPk4Fq8DO1q0S/2Zc 7Y582Dd3T7VA0HNG6JXc4scxrp11RsUKNDdtq2hBd38zEUgbYJqBmROjuvSLuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYmpH5Rb6zdZs; Thu, 16 Jan 2025 15:23: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 50GFN3QF087976; Thu, 16 Jan 2025 15:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFN3Q2087973; Thu, 16 Jan 2025 15:23:03 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:23:03 GMT Message-Id: <202501161523.50GFN3Q2087973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 3870483ec496 - stable/14 - pf tests: check cleared time when zeroing stats for table addresses List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3870483ec496544c5c1d1b29903cb2ca6872646d Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3870483ec496544c5c1d1b29903cb2ca6872646d commit 3870483ec496544c5c1d1b29903cb2ca6872646d Author: Leonid Evdokimov AuthorDate: 2025-01-02 09:30:06 +0000 Commit: Kristof Provost CommitDate: 2025-01-16 15:20:34 +0000 pf tests: check cleared time when zeroing stats for table addresses Verify that we reset the cleared time when we zero an address' counters in a table. PR: 282877, 282984 Reviewed by: kp MFC after: 2 weeks Signed-off-by: Leonid Evdokimov Differential Revision: https://reviews.freebsd.org/D48242 (cherry picked from commit 0749d8134300b8e3c956e161890ab496247d2542) --- tests/sys/netpfil/pf/table.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 62c9d66d80ce..f655463f3c03 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -116,6 +116,20 @@ zero_one_head() atf_set require.user root } +pft_cleared_ctime() +{ + jexec "$1" pfctl -t "$2" -vvT show | awk -v ip="$3" ' + ($1 == ip) { m = 1 } + ($1 == "Cleared:" && m) { + sub("[[:space:]]*Cleared:[[:space:]]*", ""); print; exit }' +} + +ctime_to_unixtime() +{ + # NB: it's not TZ=UTC, it's TZ=/etc/localtime + date -jf '%a %b %d %H:%M:%S %Y' "$1" '+%s' +} + zero_one_body() { epair_send=$(vnet_mkepair) @@ -145,16 +159,31 @@ zero_one_body() -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ jexec alcatraz pfctl -t foo -T show -vv + local uniq base ts1 ts3 + uniq=`jexec alcatraz pfctl -t foo -vvT show | sort -u | grep -c Cleared` + atf_check_equal 1 "$uniq" # time they were added + + base=`pft_cleared_ctime alcatraz foo 192.0.2.1` + atf_check -s exit:0 -e ignore \ jexec alcatraz pfctl -t foo -T zero 192.0.2.3 + ts1=`pft_cleared_ctime alcatraz foo 192.0.2.1` + atf_check_equal "$base" "$ts1" + + ts3=`pft_cleared_ctime alcatraz foo 192.0.2.3` + atf_check test "$ts1" != "$ts3" + + ts1=`ctime_to_unixtime "$ts1"` + ts3=`ctime_to_unixtime "$ts3"` + atf_check test $(( "$ts3" - "$ts1" )) -lt 10 # (3 pings * 2) + epsilon + atf_check test "$ts1" -lt "$ts3" + # We now have a zeroed and a non-zeroed counter, so both patterns # should match atf_check -s exit:0 -e ignore \ -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ - jexec alcatraz pfctl -t foo -T show -vv - atf_check -s exit:0 -e ignore \ -o match:'In/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ -o match:'Out/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ jexec alcatraz pfctl -t foo -T show -vv From nobody Thu Jan 16 15:48:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnN95Kk5z5kbQr; Thu, 16 Jan 2025 15:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnN94lBnz4PDf; Thu, 16 Jan 2025 15:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ud5LyQqnjS40vOQF8lyj5AErd7VP03wJz3Vl9cHW0d0=; b=Xegg/bId8mQQ6U/4UTP+dV1VmHDLj/ep9pR95gSvOtrxHzx1PoZojzhPwwd55GH9f3pdym 2Q8qPM2YcIJaFW1/vPaMx6CqPuLFXj9sxblLzMOgYbYWSthkfAlOlU/bfq14mmXPXKW8hX SuMETedGcSwHbHghkBINsxWkGHLJZMxEIX39Bcp4/03Ze0/dsa9VOQBW9CkW9eDSp5D8ct ja9CWsC2kBwqy+9NClwNjuK756+Ku3I1aclEZFDpUOKw5POqOOh44yhOujE+3zlX4ofG2u p4v9JwoeFqU14GaynMuEKOdirx0yN0XHaKdjk96pSSeU4TwGqTK3drlYRYSJGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ud5LyQqnjS40vOQF8lyj5AErd7VP03wJz3Vl9cHW0d0=; b=rCKHHFGSbnmpQf5z6Cjxp4NRNt8ZMTTpli3BjrhGWCGLG1zi+HH6yzsAsL1GVZHBLHy3e0 WM+LKpgznoj2galqzqCzKaeOxn1T8STpYOaC1NvC8fPmtxAfTw49MNv3Sh+JG8VgRJdrlP kU65dRbXxjW15mcFDebz7yiAEwwS7tGs1v5tOmv4bptnjpQsNACYzdqt8PIRUZWEFGOtu8 IlsCQ2l7ZMSwKKaqB84DNFSe7OYXlMmEZJBaU2yZAo+NrqttnY/otpCsVbQ8gXvUkcLsdv ZCqhvxUZQKb3SfcFMkcOtk4S2ZPtSXJXrRJRDF8iRYkHX4ikS5bBXt4nRVytrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042537; a=rsa-sha256; cv=none; b=rabvUoPkxoZii7TzhE/3CbdXly7G1DwIEDpwqIZZyStgbgrYcrBfSRScyz0SkSSu003HJZ tt652TTCw6TYEXQvkFECGQNUaxOcue1Mb85xs/XoDRNfxGCXwhAn5oFKzQ0h9ndV/Ngqqv cZUeltsyaHNXQsBzqEQoOSId+xrzOk/uzJWvf5Af5GrttZIuWVjW78XTJbPFKis/CfmhUb VCLVgf18xJ22F5/Zy9icsE/JfBqa1ykb84QXrIQGiICzKiOXRKLUtWVoKR+YS6ugMhoNQx IUA0/xPGtjR1o8NzmjD1ocFY3VyH5MGC5T+wlSHnzraG/7ZttxrTgidY+OoYIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnN93yKLzfKM; Thu, 16 Jan 2025 15:48: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 50GFmvVG026618; Thu, 16 Jan 2025 15:48:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFmvdc026615; Thu, 16 Jan 2025 15:48:57 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:48:57 GMT Message-Id: <202501161548.50GFmvdc026615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 491db92a1751 - main - bintrans(1): fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 491db92a1751ae3546cee4e73f43d7146cc9dc9d Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=491db92a1751ae3546cee4e73f43d7146cc9dc9d commit 491db92a1751ae3546cee4e73f43d7146cc9dc9d Author: Baptiste Daroussin AuthorDate: 2025-01-16 15:48:10 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 15:48:10 +0000 bintrans(1): fix typo Reported by: Helge Oldach --- usr.bin/bintrans/bintrans.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index 02571067c8f0..73baac115de4 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -236,7 +236,7 @@ Decode. Output to .Ar output_file instead of standard output. -.It fl r +.It Fl r Encode/Decode in RFC2047 specific variant. .El .Sh EXAMPLES From nobody Thu Jan 16 15:49:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnNg4yxQz5kbFW; Thu, 16 Jan 2025 15:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnNg3jWLz4PRx; Thu, 16 Jan 2025 15:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a+cDIRFaYXn044JShC3OKoEPd/bpLZRMZYXCkUjQNnM=; b=Bv/LbXo0jGJSUZGFr5zKICOwxXcupXcWdtKkZX6/zkOSpdu+6JCM4zglCsYuaywJ8jZXfc X6j97Gj5Bxu1YUhPK0vTRufV72yKWiWayJu4fYENpSRvP3Xfcw7KYJObOggWkHKIhZH4e6 CPdrZcGKJ1ktNOqKhwnqEVgvlCbuGyjVIT1AzVMnZHAjUSTLdDOgQ1HhJ4Kz7EW/UQAKxx xnOOmWmm147yd+bP7Y6gijmGziWfzaUwIztHpC1Qt8SBerQryvcQAUUzRjqpDpGcQgt0CJ FnWNsJVHPjIeUS53OuGiesmt+iBsL4zD/N/HThjXMHTCHNK6hcjoNeKRSp138A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a+cDIRFaYXn044JShC3OKoEPd/bpLZRMZYXCkUjQNnM=; b=A996PZ1p+oBOuqf3N+FDJOCH/xF71qTkm2mjnrFhho2wI4kEihwybufvtqS/vHzTk14rqC HsbG/9i4jtXWxNBm8lHvH9rmg46TovIC0yKEvEB0fKdg6ayLe0BYI0WBTHAGt2lXQ2qt3w Ez0ZCg7zxd51poAZz8ms0tlZv3ERnLYusbsbVaZvwCwUeg6bHydYQGSUWxraVVDZ6PUFn8 +0Ixlsu0g562cDtWsdOrxD0MSHbiGNuAOGcjWT6nip1S94Ypwr+J5FXYjJVj1hufb6DM4B uvvbH1cTTkrbrlCa5gQLtGDYEx3vvhTQSoOUngfUMzHdBnYO1iAjSTCRdkUmjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042563; a=rsa-sha256; cv=none; b=SBWmAD0bk0cvGMfxXbzzhYUIgl9wHrMvZ8Bc2XAlDelm6RMXR/LYaQ6kXYovAVLig3D2Gs 0+IOvL3QTYJgWrnt82XHpQlAg4BMDi8IfuJfeAZnI1Uuv4+f9pOyhtjyxj6Rm5ZRl0+1r/ p8Xu2fNq4nBCDnVuOyWnahPSjABpxmhvit4koOWA2cEFl/PYy2Gv5gdtBqMd8q3qUeOvhk tHhNvBA7TfH4QyiclCIof4D4Z0uLlub83e3tTlHyvWiFGt2NjmHinxHU/UMHchW17cjJae RFfNrS0F+PhuklqEd/AJYkmE0Oedtu3Jb86uBfm7k4M3P2AxssYOw6t3cPOdjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnNg3J9gzfKP; Thu, 16 Jan 2025 15:49: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 50GFnN8S026850; Thu, 16 Jan 2025 15:49:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFnNFw026847; Thu, 16 Jan 2025 15:49:23 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:49:23 GMT Message-Id: <202501161549.50GFnNFw026847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 279d6c5173ff - stable/14 - bintrans(1): fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 279d6c5173ffb4f47c37f97ca54948628ce6650c Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=279d6c5173ffb4f47c37f97ca54948628ce6650c commit 279d6c5173ffb4f47c37f97ca54948628ce6650c Author: Baptiste Daroussin AuthorDate: 2025-01-16 15:48:10 +0000 Commit: Baptiste Daroussin CommitDate: 2025-01-16 15:49:17 +0000 bintrans(1): fix typo Reported by: Helge Oldach --- usr.bin/bintrans/bintrans.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index 02571067c8f0..73baac115de4 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -236,7 +236,7 @@ Decode. Output to .Ar output_file instead of standard output. -.It fl r +.It Fl r Encode/Decode in RFC2047 specific variant. .El .Sh EXAMPLES From nobody Thu Jan 16 15:49:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnP71lsWz5kb0m; Thu, 16 Jan 2025 15:49:47 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnP715jrz4Pq5; Thu, 16 Jan 2025 15:49:47 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042587; 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=wZQZr8h5NLZEjm67GayVBlQyFWklCDFUsXoK4LvTA/Y=; b=rFKn7M4sVgi65LYM1uPxT6lJSobQ1wfhvBSavFyi0KqBDzS3Q2Iwmpm3TT/HEGzifFsyq2 uV5AoxmhxVgakIeOkQjRWVLxlkrwUTRUhlHgV24loytlxYChRDvAHuex47216qUv6GB5FG vdKmoapBMQ6APwe3SPLrr6kaF/MLn+iFlfGJk5967LPq+CP619g5SoU6JHJ7ynmC1WDP/P B3O9zs8Ls0fR9wrNRBDqeRhcMlaJJkyQxG8wqRV7zXxMxpAGKto+2eUEJtN9zgwJXtTXEo OrBU81UvCTcZ8IOmwO4CT/0wqR88VBTC4oVlQVzTwbQnURdWtF3GBj43cUvRqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042587; 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=wZQZr8h5NLZEjm67GayVBlQyFWklCDFUsXoK4LvTA/Y=; b=tu0uF6+mBG667mvjqtiyRx6InHn/i6qrihWEu0fz2mdR1AK40wtC0prwMHrDHYl9gftKGh Upet1SzlFHDhw6LMcRrUeZhH+0rNqooVpybq/iSaxumBA6Il/tUIh4cC1Wnv/Cz+tDX49v Yv03uHYIicl2iYa7Q/Zt6dhI6Xpu1r4+5btEShxAmUOKZB1z9AFSvBdcOSwcdvHfYPKM09 wxDyWraf3MHcVMsgombipur24/KHA90bMooTjLmn3vO9F/XaKWIfwG6BrzfKcdWpm0qiFh Yp+bciMk9jJOhHs5YkFgAH0uFn1TdcfjxNbskXuwLP1bCgziWjUkSLJPsPxgrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042587; a=rsa-sha256; cv=none; b=eKQ7kvW0a9uq37pBtsnW1VLAcKOvzgRYsr+OE1EC02mo6/KuvflfA4Efdldch4vLRn/8Jm Lk0jml97UQDuw6j+weqgWqHjE+bfs4gb39UmqpDoysOEXcRp4++/T1gYhI/E3AfOjwRnZt f+1cpaATfpGokqTRuwxs82+hMiDeqXLULXwtRROZggZ5Myrk3dzS6nuL9VfbIOI+bUHPd2 pryRTxhzhYuscMK6U/HQi+7uNMDOqRn22v2eZkRbYsfOJK2bdl6DrhPF28EAnOJ2v5TnSe gvlWJbRIHY1NXtiDpBHfDpqygSKcVUH1Qg7BKh5qGlPlVVlr1SmCvv4w7US1Gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_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: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YYnP66nWqzrjL; Thu, 16 Jan 2025 15:49:46 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 66126153691; Thu, 16 Jan 2025 16:49:45 +0100 (CET) Date: Thu, 16 Jan 2025 16:49:45 +0100 From: Baptiste Daroussin To: Helge Oldach Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 1795eae9a2cf - stable/14 - bintrans(1): RFC2047 variant of quoted print Message-ID: References: <202501160918.50G9IL1G096065@gitrepo.freebsd.org> <202501161502.50GF2FSt009129@nuc.oldach.net> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202501161502.50GF2FSt009129@nuc.oldach.net> On Thu 16 Jan 16:02, Helge Oldach wrote: > Baptiste Daroussin wrote on Thu, 16 Jan 2025 10:18:21 +0100 (CET): > > The branch stable/14 has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1795eae9a2cfdd0d83dc2b76420d55d363627ae7 > > > > commit 1795eae9a2cfdd0d83dc2b76420d55d363627ae7 > > Author: Baptiste Daroussin > > AuthorDate: 2025-01-08 12:39:30 +0000 > > Commit: Baptiste Daroussin > > CommitDate: 2025-01-16 09:18:14 +0000 > > > > bintrans(1): RFC2047 variant of quoted print > > > > MFC After: 1 week > > Reviewed by: pstref > > Differential Revision: https://reviews.freebsd.org/D48381 > > > > (cherry picked from commit beab8b1ddf86a88e0605562f2cc1d6a26c68604f) > > --- > > usr.bin/bintrans/bintrans.1 | 2 ++ > > usr.bin/bintrans/qp.c | 32 +++++++++++++++++++++++--------- > > 2 files changed, 25 insertions(+), 9 deletions(-) > > > > diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 > > index 4177a5c6b9eb..02571067c8f0 100644 > > --- a/usr.bin/bintrans/bintrans.1 > > +++ b/usr.bin/bintrans/bintrans.1 > > @@ -236,6 +236,8 @@ Decode. > > Output to > > .Ar output_file > > instead of standard output. > > +.It fl r > > +Encode/Decode in RFC2047 specific variant. > > That should probably read "Fl" not "fl"? > > Kind regards > Helge Good catch, fixed, thank you! Best regards, Bapt From nobody Thu Jan 16 15:52:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnRh44w2z5kbHd; Thu, 16 Jan 2025 15:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnRh3Q1Rz4QGv; Thu, 16 Jan 2025 15:52:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8HCyyYqeHCOlYxrAldXttT9UzyQFzTiSF72OD7O2pwI=; b=q/Nbe9hlpUK+WfEKIRslXZ4UrlAyGaeABzdJOoY75pkRTrZBiRvFbfZky5nN7KYULpUwnW mcDOLWynquXsEwq7xSxjkQWhSU7nipnwtdbqHpCYpB+kj6osC40/iH+QnmeCJrt5Z7Ri5W Vcqm/tbCzExUDsLtcR9lG1LFDU7d6iQbv7BYDQ1K9kP1M5C4YB3H8X4W0MO3YfWjib6Bo9 cIL57uavN3th/tj7jp00PUAZZTvbKN8OBl5NaVB+0jw2wx5HXu63DZ3ySGXbFUUjteHTBf Gxty+pzhorMu16kJr+Dpxg0CiqUsTjeN/6VtKlW05yB1IHdKL0vPZsX5DOnTLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8HCyyYqeHCOlYxrAldXttT9UzyQFzTiSF72OD7O2pwI=; b=NuJUOFlsYBPApfXOi9TU4JTcopNiuTZrmOUl2T/OLu/1fHHWjfNSAMFdRgCtcPYiFwakz7 lwEhq4Uo3ZY4+O01hYnWyFOnxr8DhiL9/5WENpHeK2qhl+3V5JI35fXRfpJID7G6b+40qd TqhjJBO0o4En1x1a5l8A/R0ICEx87KrWpkuWuKrbsksRBdvWDFHCc+yOVdyOulOVzi/DO3 ZE/+fP1+q3cVq1GKYLAxwLCMOXQLgHTU1+It4jshZ9RYo+N+TXVpFoy8s9djhWayzGMems J2sRV0qQfivlcQapjJh0098tKq+6UkQ2ntoWzbzhwYcvbad9I8v7uoMekSg+rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042720; a=rsa-sha256; cv=none; b=kdEfUPquzVr5zhaF65g7uYSkIMAHQ7ihAdJbLeOn8nTkt5Xg17boeyHyvgx5cKnuZ4MgIj C++zSfEPJPFSzqJvjjEPIv/B6QmY+x3RRbPhH5Jzx8Rc78VHs75GpTPnh9sC31ftMijrbg idlAUtFwCHq3IMT66NuF5DOg3tH+ozTFfEu01kD/povNWchvUBpR67BuY+Yqp8h2n9YYcv qQkVQjdijnGpjbXNccz6kRzqxYFyn5MyOmtlrkzh5aJ2rXsHP253VckmIQksoBdOD0VRur B8xBS+h7I7fbwVNHKAdE7z7dMdjCNhzn0UKXr1YAzoTKKoD3biPh+Ghj7xgMiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnRh2zjGzg29; Thu, 16 Jan 2025 15:52: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 50GFq0wM040548; Thu, 16 Jan 2025 15:52:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFq0Bp040545; Thu, 16 Jan 2025 15:52:00 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:52:00 GMT Message-Id: <202501161552.50GFq0Bp040545@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: 4276dfa8c4b9 - main - BUS_HINTED_CHILD.9: New manpage to document this bus method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4276dfa8c4b9e75ab29f2c53a7af36c2f77ab563 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4276dfa8c4b9e75ab29f2c53a7af36c2f77ab563 commit 4276dfa8c4b9e75ab29f2c53a7af36c2f77ab563 Author: John Baldwin AuthorDate: 2025-01-16 15:51:44 +0000 Commit: John Baldwin CommitDate: 2025-01-16 15:51:44 +0000 BUS_HINTED_CHILD.9: New manpage to document this bus method Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D48366 --- share/man/man9/BUS_HINTED_CHILD.9 | 36 ++++++++++++++++++++++++++++++++++++ share/man/man9/Makefile | 1 + 2 files changed, 37 insertions(+) diff --git a/share/man/man9/BUS_HINTED_CHILD.9 b/share/man/man9/BUS_HINTED_CHILD.9 new file mode 100644 index 000000000000..699bb06e8dd8 --- /dev/null +++ b/share/man/man9/BUS_HINTED_CHILD.9 @@ -0,0 +1,36 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 John Baldwin +.Dd January 6, 2025 +.Dt BUS_HINTED_CHILD 9 +.Os +.Sh NAME +.Nm BUS_HINTED_CHILD +.Nd notify a bus device about a potential child device identified by hints +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_HINTED_CHILD "device_t dev" "const char *dname" "int dunit" +.Sh DESCRIPTION +The +.Fn BUS_HINTED_CHILD +method is invoked by the +.Xr bus_enumerate_hinted_children 9 +function for each set of named hints whose +.Dq at +hint matches the bus device +.Fa dev . +Typically, this method should determine if the set of hints for the given +device name and unit sufficiently describe a new device. +If so, a new device should be added via +.Xr BUS_ADD_CHILD 9 . +.Sh SEE ALSO +.Xr BUS_ADD_CHILD 9 , +.Xr device 9 +.Sh HISTORY +The +.Fn BUS_HINTED_CHILD +method first appeared in +.Fx 6.2 . diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index c09d3aa554a1..6e8edc3f698d 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -47,6 +47,7 @@ MAN= accept_filter.9 \ BUS_GET_CPUS.9 \ BUS_GET_PROPERTY.9 \ bus_get_resource.9 \ + BUS_HINTED_CHILD.9 \ bus_map_resource.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ From nobody Thu Jan 16 15:55:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnWj3BJ2z5kbtp; Thu, 16 Jan 2025 15:55:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnWj1wx5z4Qh6; Thu, 16 Jan 2025 15:55:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V86Jj6ZB4lWuqBefF+wSPzNEEQwDCf9YJgFMVsVGoOg=; b=EAVtEJxDAiKf9Qu6ptgq0DN4OM57WUM07SQGuUTQD62C0Q2ZPH8zqsKNtg15Xg5fU+zThk n8Prr/ftbWBHxhTVEFQZJ1kbGvmA15707zfnYJ3aB+xcoWVUks/QFcJ5/NGWVfN0MXQ6qK 2hB5cixtin2ugvLBHuKNrCVYspiIAOhY22Irp/5anagiei0HGOJaaXaHev1uvW7CA42/+X M0QwbnWfFo64myjvUOHUj9UwpXuZ599qYu3c8iyDsV8gvQR06Prrp2u04RflzIm2yjn8Vt 7mVrJ923eK2dCAfSnrs/dDf26rjtWGdVSx2v0L4VNfenh9lWGiBxyG3PdP/o7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V86Jj6ZB4lWuqBefF+wSPzNEEQwDCf9YJgFMVsVGoOg=; b=Oih80KaP5EfDKIIanpaGfSOYYZ4WxcsioKk2x2YsylZTRUld/9FqD1vd2cAvrMLEM56fsC /PgimytHO1QwrOSd1IQhCZhHcy7d7u1oNWlyDDobntiJxG5vxzH0qUROWHLTIJsU2RE2/2 IwwNArHTGcoZXYQZ00boUmU7uENu/Y1g4wPKZ032hYJCrJo3lbh2MJC9l7lnJ+2/YFvGZC FFgCySeR0aGeNDlx7S3UtPVQ2fmbNviR/jBgY/YlW7yqzHYLoiWzzg7MaGosoBmW4Py57A EibStZ9KiKSW187sBZIUf1F56tlLg6f6zUpMCSBI5eIp+f4zZMGfyf91OMfARA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042929; a=rsa-sha256; cv=none; b=ZrvFqegrkkfIsHM3afjHirUiWq/QKbBowhf2OOjf1OSD4da7AlLQoMarty+VycJulq8FnM wsmi2ORtMH/sDwGq9WnFxnUKjTj6YW9Y1FL9Nib3EuV+GzA+eAU/7Mtc/qJ0p06ID92urR Fp582ZDs0p6czOOVxLAnmbwu5NLOJ4qHN/dagjV5G0x9yRWPVj8BdiZiUSNILjWlDupsFI A2b5qHu3OWpegDT1gdrmrfkn1Yp8B5NC5Kt0lXsjrtQX/tyuFrGPgwefUaxkxMkI0/Q0YT 91WhfVlkvpm9da3SwkGcdudSf4x25aePpTWRNh5CchZEe6xPWe//z0tSxQCNpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnWj0yTMzg0G; Thu, 16 Jan 2025 15:55: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 50GFtSqp045057; Thu, 16 Jan 2025 15:55:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFtSNm045046; Thu, 16 Jan 2025 15:55:28 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:55:28 GMT Message-Id: <202501161555.50GFtSNm045046@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: 2759653c8523 - main - bus_generic_print_child.9: Add bus_print_child_{header,footer} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2759653c8523f279cf0715d5cf641d2e029b6614 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2759653c8523f279cf0715d5cf641d2e029b6614 commit 2759653c8523f279cf0715d5cf641d2e029b6614 Author: John Baldwin AuthorDate: 2025-01-16 15:55:02 +0000 Commit: John Baldwin CommitDate: 2025-01-16 15:55:02 +0000 bus_generic_print_child.9: Add bus_print_child_{header,footer} These functions are already described in the body, just add them in the NAME and SYNOPSIS sections along with MLINKS. Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D48370 --- share/man/man9/Makefile | 2 ++ share/man/man9/bus_generic_print_child.9 | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 6e8edc3f698d..42564aa2ac72 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -692,6 +692,8 @@ MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamem_free.9 \ bus_dma.9 bus_dma_tag_create.9 \ bus_dma.9 bus_dma_tag_destroy.9 +MLINKS+=bus_generic_print_child.9 bus_print_child_footer.9 \ + bus_generic_print_child.9 bus_print_child_header.9 MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9 MLINKS+=BUS_GET_CPUS.9 bus_get_cpus.9 MLINKS+=bus_map_resource.9 bus_unmap_resource.9 \ diff --git a/share/man/man9/bus_generic_print_child.9 b/share/man/man9/bus_generic_print_child.9 index 8c3bd4b0fc71..1adca331b016 100644 --- a/share/man/man9/bus_generic_print_child.9 +++ b/share/man/man9/bus_generic_print_child.9 @@ -26,11 +26,13 @@ .\" (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 15, 2017 +.Dd January 16, 2025 .Dt BUS_GENERIC_PRINT_CHILD 9 .Os .Sh NAME -.Nm bus_generic_print_child +.Nm bus_generic_print_child , +.Nm bus_print_child_footer , +.Nm bus_print_child_header .Nd generic implementation of .Dv DEVICE_PRINT_CHILD for buses @@ -39,6 +41,10 @@ for buses .In sys/bus.h .Ft int .Fn bus_generic_print_child "device_t dev" "device_t child" +.Ft int +.Fn bus_print_child_footer "device_t dev" "device_t child" +.Ft int +.Fn bus_print_child_header "device_t dev" "device_t child" .Sh DESCRIPTION This implementation prints out the default device announcement message. Given device 'foo0' on bus 'bar0' where foo0 has the name "FooCard 1234" the From nobody Thu Jan 16 15:55:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnWk2YRnz5kbWQ; Thu, 16 Jan 2025 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnWk1Tm2z3BvW; Thu, 16 Jan 2025 15:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=64nXjzEpGdI5NA4ywOKsf4uYyh59RFPh+/t/U8gX6n0=; b=OK2+yfIy7EmAqJSirKqlB4TIqg4c11RVub6ixYl9vmBK+IbZ9FMBHn3WJkv6nYNCtbjBrL wDZLm3W4enpqNQFbsj4aSppMm3SxaNLKBc6nbMQ9jt8INhcmUC4y8pXTHmyuQ1FAhNn1nu ToTmTv2KrjMOfOcnT5t/JyTRX7WA8E9d77ANSsLD84wQ1ZHOmFlpABy+ck+nSIc0KO7FmL edyJ1hIcQHkeeu3WAa05sEg0VN3bYIe8U3zNQrNO3HVE2eLOs+CNZCyE68C/lc3k12LrLs lylmISNZhQGg+QT/aHuP+HxJ9VEN/SNLh1W+4cymEqiriQSPpwlEg6fnBPOdLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737042930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=64nXjzEpGdI5NA4ywOKsf4uYyh59RFPh+/t/U8gX6n0=; b=eH9NXRxmL2qlCzZ4jBwXqoSuFoIQHUFqVR02O0AGjkT2t/EXlfPLyro52x+rwlRrIhIn5v jFAG4Y4b5mLw2gOZdkJ7+PHRtFn+qqCUeSJ6LKBm4n8Whi8Z8TLvj4qF2Gb96tfsyWOq/y VmZt8EgSSU6STpPJ1Hw+TnqYMQ7FJRJ0PJ2osFbKyLyBGGNy+iMgJqV0OtFt+N1fEJDr9y 9xLoI9Xs0fNKeIvvZpHjWOniXSk6KTjBq0ShSv9ukW/uHrmyiwMZ5qj78tYFhFMCzEJ4PU aLP2bXGXB+2FDETc60ryfDiCxTLBvuJ5bSAssWBcITdJcUgpE9MUnmrait5jDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737042930; a=rsa-sha256; cv=none; b=eZIk3WWFHvFG8ZNmqpOE4Lke2R0XuqXmCEZ1El6fFmhu9VJT8JGSmO1IBPnG50KWaODhE8 0YMz//AJZC+O3rar4iOfHM3NCukXZyHw9mHI93Eug2kvQGyvdWrkQRt3Hfp15gt9hrbj/I 9x3Nx0iiY/sJtRu+216yOxYXCKemXE5lP2sgW/t10uXhBksIWRUL63tPk2ZqxsuygA+Q3H EVxYNcCxkWRL8k0lwONEePPZ2Fty5byQns8jBvC/A4HGTpcud0FpDfOpIYLSnWopxD8Vr5 mhIv3r4hyhKlAsW8BYdNyiSpKv7yRf93++XgfBfk+L8n+H1YYLfOLrTdl4qhpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnWk0x6kzg2L; Thu, 16 Jan 2025 15:55: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 50GFtUPG045155; Thu, 16 Jan 2025 15:55:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GFtUS7045152; Thu, 16 Jan 2025 15:55:30 GMT (envelope-from git) Date: Thu, 16 Jan 2025 15:55:30 GMT Message-Id: <202501161555.50GFtUS7045152@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: e2012b81cb87 - main - BUS_CONFIG_INTR.9: Describe bus_config_intr() wrapper function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2012b81cb87793be589cffa0a89d9b230df7c93 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e2012b81cb87793be589cffa0a89d9b230df7c93 commit e2012b81cb87793be589cffa0a89d9b230df7c93 Author: John Baldwin AuthorDate: 2025-01-16 15:55:20 +0000 Commit: John Baldwin CommitDate: 2025-01-16 15:55:20 +0000 BUS_CONFIG_INTR.9: Describe bus_config_intr() wrapper function Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D48372 --- share/man/man9/BUS_CONFIG_INTR.9 | 16 +++++++++++++--- share/man/man9/Makefile | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/share/man/man9/BUS_CONFIG_INTR.9 b/share/man/man9/BUS_CONFIG_INTR.9 index cf6ecbb4b823..aaeb6c3ec089 100644 --- a/share/man/man9/BUS_CONFIG_INTR.9 +++ b/share/man/man9/BUS_CONFIG_INTR.9 @@ -23,12 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 15, 2017 +.Dd January 16, 2025 .Dt BUS_CONFIG_INTR 9 .Os .\" .Sh NAME -.Nm BUS_CONFIG_INTR +.Nm BUS_CONFIG_INTR , +.Nm bus_config_intr .Nd "configure interrupt polarity and trigger mode" .\" .Sh SYNOPSIS @@ -36,9 +37,13 @@ .In sys/bus.h .Ft int .Fo BUS_CONFIG_INTR +.Fa "device_t bus" "device_t dev" "int irq" "enum intr_trigger trig" +.Fa "enum intr_polarity pol" +.Fc +.Ft int +.Fo bus_config_intr .Fa "device_t dev" "int irq" "enum intr_trigger trig" "enum intr_polarity pol" .Fc -.\" .Sh DESCRIPTION The .Fn BUS_CONFIG_INTR @@ -53,6 +58,11 @@ that it is called prior to .Xr BUS_SETUP_INTR 9 . .Pp The +.Fn bus_config_intr +function is a simple wrapper around +.Fn BUS_CONFIG_INTR . +.Pp +The .Fa trig argument can be one of: .Bl -tag -width ".Dv INTR_TRIGGER_CONFORM" diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 42564aa2ac72..a284eaca5ecb 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -674,6 +674,7 @@ MLINKS+=buf_ring.9 buf_ring_alloc.9 \ MLINKS+=bus_activate_resource.9 bus_deactivate_resource.9 MLINKS+=bus_alloc_resource.9 bus_alloc_resource_any.9 MLINKS+=BUS_BIND_INTR.9 bus_bind_intr.9 +MLINKS+=BUS_CONFIG_INTR.9 bus_config_intr.9 MLINKS+=BUS_DESCRIBE_INTR.9 bus_describe_intr.9 MLINKS+=bus_dma.9 busdma.9 \ bus_dma.9 bus_dmamap_create.9 \ From nobody Thu Jan 16 16:03:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnjN3W1qz5kcCy; Thu, 16 Jan 2025 16:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnjN2kqjz3Dsb; Thu, 16 Jan 2025 16:03:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737043432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eW40lEsuNVOGALY6QmEu11h91+tbOlMVuLE1v+C3/i8=; b=xeli8kYOT8tog7oW3BLq0c1/JiePo0+iyjiU+pOJckxoaqagz6je/UoJEUgMRL3Fuy/b48 8xAPLcxI3VQedPvmZcAku2OsN4ZFTT2WVZURAhp6Xv0IaFweHhHn7LKKy1n/TC8m9aP0Dk HnwUb1KjMtpvVb8UaMCtMlirAYrTX4U2XyGjvMORMXAQsKd5GJcwTisg4AaYY7fPVhE4BJ bVajChIuZYWS7qpXlMZbkvSYSMSbXxbPkEXexxMlY7vCgwkfhHz7gBptmYQujcj4q4XUuO 9qndlS86s5ixYp629+yYkV/6MTPdCVsPzE+NF1eckd9PJlMpnPo6iFCXCwY3ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737043432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eW40lEsuNVOGALY6QmEu11h91+tbOlMVuLE1v+C3/i8=; b=QfXY/a56KjWu+8+srhg98tzPS1qlQHqfmklrSt9zRV0tNvAMJEZUDELBjYnK9uo+xxxTm0 /isTjl4ix0CFxN9AL/LOaxlcp2QbGNvssNFZBVT/8GxbTGh3dcMFe87uDz7t0HLQmPrh/q Y0C44E2EWzzSI6QQXv5wv4OuwGZan2iWj7LbqDEPV//BOk8sOf2jrI85PKB9YSTdlaDgCm h5NCNNxDn4uJCbt2HrqaPDlnItZQ7rhfRDnyfxIKCrdvx8wlGUc7k0DJbb08ZEH7ERckNb sBzKDpOvw/oxq8pNCdcJboZSw8Tut6fJ7JnFeCXr/Ug5/6paBgDlwS6kVTP4pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737043432; a=rsa-sha256; cv=none; b=d4oLR7153Y9XdzS8ib648djr/69XpmhNBYi1F+wYw3py3Z6a/RIMzl27Ua+dgICbHtFeMN 1+pxyB4ojJTZXeP5gtVhQsQMlnjfcuKuYY/Au6EAatKuGt/HIan6UDRP+Olw8njq1mrNOU 3kouHNdzbxECpRGIEYY+JDq6H2JihlT9BrKkyY/qAR7U86cjj1MRvHEZxKAfELPwZWVawd iE29C19KRGEEb66Vol5RR79Hy69zjEK73I03FhFPfrZd8keD0w1uUjAEQ5b3TnZnyBxdS4 t4WfQVNSrHHXBMAJ5AYFVKlXXeaiOEZXcjrYXaA9U6rTBFbLzxgb3/ThkZqpzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnjN2Kh6zg12; Thu, 16 Jan 2025 16:03: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 50GG3q8t064540; Thu, 16 Jan 2025 16:03:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GG3qM9064537; Thu, 16 Jan 2025 16:03:52 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:03:52 GMT Message-Id: <202501161603.50GG3qM9064537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 82fa7f83b53b - main - ls -lh: humanize the total List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82fa7f83b53b3c5b7f3a5c5560edc7caeeaa1029 Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=82fa7f83b53b3c5b7f3a5c5560edc7caeeaa1029 commit 82fa7f83b53b3c5b7f3a5c5560edc7caeeaa1029 Author: Piotr Paweł Stefaniak AuthorDate: 2025-01-06 17:59:03 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2025-01-16 16:00:17 +0000 ls -lh: humanize the total Before this change, the total printed on the first line was always in blocks. Now the long format with -h will print the "humanized number" instead. `ls -sh` never provided sizes in anything other than blocks, total or individual, and this commit doesn't change that. The total number of blocks is a sum of fts_statp->st_blocks, so it's multiplied by 512 and not by blocksize. $ ls -lh /usr/bin | head -n 2 total 442 MB -r-xr-xr-x 1 root wheel 70B Dec 20 21:06 CC Differential Revision: https://reviews.freebsd.org/D48329 --- bin/ls/ls.1 | 4 ++++ bin/ls/print.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index d86250b82db2..6aaa5025a6e1 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -539,6 +539,10 @@ which are listed as the directory's contents and .Pa .. and other files which start with a dot, depending on other options). +If the +.Fl h +option is given, +the total size is displayed as the number of bytes. .Pp The default block size is 512 bytes. The block size may be set with option diff --git a/bin/ls/print.c b/bin/ls/print.c index f651dea5de90..a504ec63dc26 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -210,7 +210,14 @@ printlong(const DISPLAY *dp) if ((dp->list == NULL || dp->list->fts_level != FTS_ROOTLEVEL) && (f_longform || f_size)) { - (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); + if (!f_humanval) + (void)printf("total %lu\n", howmany(dp->btotal, blocksize)); + else { + (void)humanize_number(buf, 7 /* "1024 KB" */, + dp->btotal * 512, "B", HN_AUTOSCALE, HN_DECIMAL); + + (void)printf("total %s\n", buf); + } } for (p = dp->list; p; p = p->fts_link) { From nobody Thu Jan 16 16:03:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnjP4hJXz5kc39; Thu, 16 Jan 2025 16:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnjP3Z3Zz3DmH; Thu, 16 Jan 2025 16: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=1737043433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hamiwax/yokCbOzhy6Womnn4fEP5n6vpCxaPkEKffuU=; b=B32Ej8WP5cZFEBbfYY2gcF4tdvVspBOPs+Uo6NOCXt/wgda57M9FYvioyZcK31Zg1Q/L3O peDunEMS0xn2rURA8aPmgbWHEeAa4r70At9IymgIeEoJMHyRQE3MYQhLLlU8cOKKJUvqOy fS1rxrNaLHLocZR371t6iZ9Fya9hP+9zWddtRawk/UEOcT+jxiAFeyat+px9/Hl85nDoLv BEwToXsdUrH+qRpW7Mdqr7kDH297LYYri4jsOOYM+IsyGQ90ZQ+ZJqAJjasEh1bhxf3Bhz SaZ4vjPyc8vpYMMjw3hi/omZFf8lWW0uLvOL2r77QzrRalUSehp97S68EKJq0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737043433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hamiwax/yokCbOzhy6Womnn4fEP5n6vpCxaPkEKffuU=; b=Ns6/N1+RatT5W650ZtlYxpzKnguk5OhL52N0DbvunvortyjflL2LVawco//ocYKAonWUyN mvY2OkKRMADeCbe/1a2v/LbPoSzZ6bCEDQiwPL0UOYn8Gl1RF2OMl+VnHZ67AagUIUp6Qg JFtayDVoAt5QnC4orzkF5c6fCLqr6aHPyz/91aejPA9PlbxK7M1+IahgqlzAKrEO4E3g5q nRCbEuX7vfLPdmvTH3H/CW0LGWC6bfjd0cJT1nulXBGRoHG/qT9KcC7+IDaEP4XrajltXb waUF8jpOYcJ7eR0RsMNclIV2F+GO7NoyvX6zemqqzl8nTLnhmdkb/neq9ljUag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737043433; a=rsa-sha256; cv=none; b=CTWFYbYCSQnb7ixa6HtEDdGpmaPh/EXWyuFOWyUPd/Rm9XZVJ8dYiAUQdetEgnp1OVfhWz uUBdzCumL2xQ5+1hFba8uvcRMuNLs6+ogdPmX6kSt1e9vDh90efrCmwt5ZixMe/vryU/Cf JrdrZR/vCeNvvueVcFhNAokf7lmGukRZQXBj7mWn2lMprOFhEyEylSnX6y8FECjUht26m0 QdvVE9WunFqb2PQ+fC+5uE2cW1towwYBDJUb2g9roqFxgE2+WBzGAICheQ5Gs6sP6twfz2 C6JJawmEhu/G4AtRa5D54vLBXbuzAD2L+glHmgAlddf5zM5koYqiQezYXeUG7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnjP3794zg5h; Thu, 16 Jan 2025 16: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 50GG3rYS064610; Thu, 16 Jan 2025 16: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 50GG3rVW064607; Thu, 16 Jan 2025 16:03:53 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:03:53 GMT Message-Id: <202501161603.50GG3rVW064607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 8b92977857f8 - main - ls: implement --group-directories-first for compatibility with GNU ls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b92977857f8acaa539c21800b024edea9eee8b4 Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=8b92977857f8acaa539c21800b024edea9eee8b4 commit 8b92977857f8acaa539c21800b024edea9eee8b4 Author: Piotr Paweł Stefaniak AuthorDate: 2025-01-06 21:26:14 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2025-01-16 16:00:17 +0000 ls: implement --group-directories-first for compatibility with GNU ls Also implement --group-directories which takes a parameter. "first" is equivalent to --group-directories-first, "last" gives reversed sorting. Changes in sorting between elements of the same type (files, directories) are not intended. Differential Revision: https://reviews.freebsd.org/D48347 --- bin/ls/ls.1 | 19 ++++++++++++++++++- bin/ls/ls.c | 35 +++++++++++++++++++++++++++++++---- bin/ls/util.c | 4 ++-- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 6aaa5025a6e1..b634f2f23ae6 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -39,6 +39,8 @@ .Nm .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuvwxy1\&, .Op Fl -color Ns = Ns Ar when +.Op Fl -group-directories Ns = Ns Ar order +.Op Fl -group-directories-first .Op Fl D Ar format .Op Ar .Sh DESCRIPTION @@ -303,6 +305,16 @@ options. Display the long .Pq Fl l format output without the file owner's name or number. +.It Fl -group-directories Ns = Ns Ar order +Within results for each operand, +group directories together and print them either +.Cm first +or +.Cm last. +.It Fl -group-directories-first +Equivalent to +.Fl -group-directories Ns = Ns Ar first . +Implemented for compatibility with GNU coreutils. .It Fl h When used with the .Fl l @@ -914,8 +926,13 @@ and .St -p1003.1-2008 . The options .Fl B , D , G , I , T , U , W , Z , b , h , v , w , y -and +, .Fl , +.Fl -color +and +.Fl -group-directories Ns = +(including +.Fl -group-directories-first ) are non-standard extensions. .Pp The ACL support is compatible with diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 048cfc9293e6..ca0fb9877b7e 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -87,12 +87,24 @@ static void display(const FTSENT *, FTSENT *, int); static int mastercmp(const FTSENT * const *, const FTSENT * const *); static void traverse(int, char **, int); -#define COLOR_OPT (CHAR_MAX + 1) +enum { + GRP_NONE = 0, + GRP_DIR_FIRST = -1, + GRP_DIR_LAST = 1 +}; + +enum { + BIN_OPT = CHAR_MAX, + COLOR_OPT, + GROUP_OPT +}; static const struct option long_opts[] = { - {"color", optional_argument, NULL, COLOR_OPT}, - {NULL, no_argument, NULL, 0} + {"color", optional_argument, NULL, COLOR_OPT}, + {"group-directories", optional_argument, NULL, GROUP_OPT}, + {"group-directories-first", no_argument, NULL, GROUP_OPT}, + {NULL, no_argument, NULL, 0} }; static void (*printfcn)(const DISPLAY *); @@ -105,6 +117,7 @@ int termwidth = 80; /* default terminal width */ int f_accesstime; /* use time of last access */ int f_birthtime; /* use time of birth */ int f_flags; /* show flags associated with a file */ +static int f_groupdir = GRP_NONE;/* group directories first/last */ int f_humanval; /* show human-readable file sizes */ int f_inode; /* print inode */ static int f_kblocks; /* print size in kilobytes */ @@ -449,6 +462,15 @@ main(int argc, char *argv[]) case 'y': f_samesort = 1; break; + case GROUP_OPT: + if (optarg == NULL || strcmp(optarg, "first") == 0) + f_groupdir = GRP_DIR_FIRST; + else if (strcmp(optarg, "last") == 0) + f_groupdir = GRP_DIR_LAST; + else + errx(2, "unsupported --group-directories value '%s' (must be first or last)", + optarg); + break; case COLOR_OPT: #ifdef COLORLS if (optarg == NULL || do_color_always(optarg)) @@ -1004,7 +1026,7 @@ label_out: static int mastercmp(const FTSENT * const *a, const FTSENT * const *b) { - int a_info, b_info; + int a_info, b_info, dir; a_info = (*a)->fts_info; if (a_info == FTS_ERR) @@ -1023,5 +1045,10 @@ mastercmp(const FTSENT * const *a, const FTSENT * const *b) if (b_info == FTS_D) return (-1); } + + if (f_groupdir != GRP_NONE) + if ((dir = (a_info == FTS_D) - (b_info == FTS_D)) != 0) + return (f_groupdir * dir); + return (sortfcn(*a, *b)); } diff --git a/bin/ls/util.c b/bin/ls/util.c index 40610faa5fae..d83cae0e98d1 100644 --- a/bin/ls/util.c +++ b/bin/ls/util.c @@ -219,9 +219,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuvwxy1,] [--color=when] [-D format]" + "usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuvwxy1,] [--color=when] [-D format] [--group-directories=]" #else - "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuvwxy1,] [-D format]" + "usage: ls [-ABCFHILPRSTUWZabcdfghiklmnopqrstuvwxy1,] [-D format] [--group-directories=]" #endif " [file ...]\n"); exit(1); From nobody Thu Jan 16 16:09:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYnqk6LQZz5kckS; Thu, 16 Jan 2025 16:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYnqk5cyBz3FYm; Thu, 16 Jan 2025 16:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737043762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iO2dRVQ+CM3iYmSi/OFuXXLlMSHNEzR5JQW8FaqHA5I=; b=SHlDShTHh4PePPQaaRm6/3qO3LxSbto9AcN46apVS52JDaxz9RoHejwR8ae0M0mCwIRoZw Cl2RKR/xeWZi/YnxMIHZN+mzaAMwTqbSG2dqxK4GJhiX5CAPyxEasyA4eQaQVG4nzgwvR+ 4OyHAKQ5toHT/gd9BTVYHkCIMIi+V/LJxNQj5vr3po6/sCLpJrSy1H668URJSw7q+rfsE0 wFkD5+1MJSlfJIOXldpaKnUmljNO0Z389cybM8RUKfRB2fAiSZgxOCjOynJVWBrciBoCeL Pqzm/l1+SswSDts7e+CcRW3ZmkXX15ZzVtxsJDr1Nyni7AWeyA8GiF76724w7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737043762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iO2dRVQ+CM3iYmSi/OFuXXLlMSHNEzR5JQW8FaqHA5I=; b=Wf8q19UuL/iv55H1wmgTCrqkGiRR/owGU7XEJiQMiMvNCHSwM8OxvqbYsWIGEzLK/R96wJ BdQ41B4JQwEaUyiZDMYXzHi7GHNv6rvoghL418khYHExIuISEIL5w/8EpT9FUXdChkvADc kafLrK2touIG7Ais5M9SqGg3OrG93uJrzcNu3u4klrI/JMSBoHVAvOZIE5El/kB57+/uCD zwjLTUNckw6MXz8kPxMoUKc7HlpEL6jXnzStEVlXZAxRAywigosnYMZLLePoQd6o+s8VZl 6gbjN9Tl6g7OmTfmvTpZY7Jya+koIMSFuITXI+3c8Hroy6l7bMuMRd1uaypCRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737043762; a=rsa-sha256; cv=none; b=fKwg8eMQOrsLf6Ps94s62BbPVyId3lLKE7GsCHbTLaAmTcd0UMZcG0BoYzP3oU2PjZCXTD I15ueXXxZFZlSFppLPAeGWyh6iBKG3iEqNk91/IWFWIN1C5N4jZE/hllK5lGF7My1nLrMa 80KiysOWABXHD/vHF4wkE6mf33Ens9LOmyUND8m1fGmuf6uU8csgNfDd4Cqj92XFYPnICi QE5JixJNR+THfNmSAAx6fvnWFKkgaAiB7xs/2vk17Y3sVjna/H+XwFaIX/UGal9z5t2SJA lJN8mLbyC4O6LVDhHQrbZIGRv1/6FUrv0ER6fFNpIg6jEhP3sChGzPIch6qXLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYnqk5ClKzf53; Thu, 16 Jan 2025 16:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GG9MMW066387; Thu, 16 Jan 2025 16:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GG9Mkb066384; Thu, 16 Jan 2025 16:09:22 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:09:22 GMT Message-Id: <202501161609.50GG9Mkb066384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 4ed2448a4f2b - main - ls.1: bump date after 82fa7f83b53b and 8b92977857f8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ed2448a4f2b32d0c4055c282e4cc2b691d621ed Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=4ed2448a4f2b32d0c4055c282e4cc2b691d621ed commit 4ed2448a4f2b32d0c4055c282e4cc2b691d621ed Author: Piotr Paweł Stefaniak AuthorDate: 2025-01-16 16:05:43 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2025-01-16 16:05:43 +0000 ls.1: bump date after 82fa7f83b53b and 8b92977857f8 --- bin/ls/ls.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index b634f2f23ae6..9621959821be 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 22, 2024 +.Dd January 16, 2025 .Dt LS 1 .Os .Sh NAME From nobody Thu Jan 16 16:54:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYprG6Z0Nz5kfvM; Thu, 16 Jan 2025 16:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYprG5rKdz3Ktb; Thu, 16 Jan 2025 16:54:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCoXtvho4vgiYLduib5Zb3aL2rzK/Ah4L4EQY4IjlmU=; b=IVTEYjfquz6ZHGm40QPF2YskkJ7wBYjDQS83fipWeoDKZOUFHS5XDTFfnUYF0bbMADSoH/ jtWnNmCOexNjH1G16D0KhFDSt9TrIXD0T5HzQcegrPJk5YW2LdGEH8UqLrm2PhS6SE7xAd 553T1sWUlVhzAaQGXX4t1wtQIX59x6yopuE69J7DJ6h+PoAL+4dtaIvG93WUiogUzDob0q zRa3Z4Icdye0fvwk2N0lpy0OA/YHCTwTNSYYAh6UZwdZs+wY1Te5WD5wRaqgK2hICa0uqb 94csEPgTzt88SSMjdIr67EDwVOhiglZth3FF4ovDmcNE7RgWW8f/hUeDtqa72Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCoXtvho4vgiYLduib5Zb3aL2rzK/Ah4L4EQY4IjlmU=; b=npx9PBAQAbE46Ik7ALAR1raWkKx2SKiGIFwIE0XG7U4MfSwAZ8MuOI4g4+Q1FXQ5fr1vT/ shnadyuJ5XSMXwv/pGG+QP6ZtQbknIPeSCY9nB1r9g8TJMO2CbvFGNVT6MJsjp113Ciu0V v7ztpvfo1y21X+DhfaZfU01PeRyWCkdFeoUxT+3sD9mxFgQWQAYkoexopHUYw0W/DPBwCL +8Wf/EsDoA2Qd1QQwUjUEQPcDrtT5JLcy96s9UqjFxzkKPx2u/uRdi8wjM2njl9igcRZDa AsPGFI7r4HvJtMGmOyFg6+4jsV0YYIV2FeH98MCgogkwzqxEhJ0SuaiPqKNurQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737046494; a=rsa-sha256; cv=none; b=kq+SJiH8VtgdcssvqpirBIGu8k5QOljCmm3K9LZpXjU/2xgb5c0NjuDVzO5FaROHh9SSG4 hxw0dIgSt/2DLsQK7HmVpkOoEJhGdA7XvLK2GMHcgTGwPjrF4P+yTCZHkk55VLtxN14GRH Mf59Xv4O4VASrXjJvo6km5bRkGR7l5+aEiEqP2rxqNIn+5RqGpUhj8lNYnGsGcAid6ZMDr Xns8cvxSX9MnDqmWtLzWEEWXWOCSPWquI8PjwBq8FIgG2stcVH3EqO1+YUZweC/BNxUjft h2tHyz+2lURU7ba4qf79u+gawapVevYcxpyLzYoUfStC2RFYNSKCMYb2nEZ69w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYprG5L7szhGk; Thu, 16 Jan 2025 16:54: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 50GGsslc057842; Thu, 16 Jan 2025 16:54:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GGssak057839; Thu, 16 Jan 2025 16:54:54 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:54:54 GMT Message-Id: <202501161654.50GGssak057839@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: c1557708f1fa - main - pkg: Fix Coverity warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1557708f1fae1bb9c8e23e3bbb2aa2b055e1211 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c1557708f1fae1bb9c8e23e3bbb2aa2b055e1211 commit c1557708f1fae1bb9c8e23e3bbb2aa2b055e1211 Author: Mark Johnston AuthorDate: 2025-01-16 15:09:58 +0000 Commit: Mark Johnston CommitDate: 2025-01-16 16:45:15 +0000 pkg: Fix Coverity warnings - Fix allocation size in config_get_repositories(). - Fix a memory leak in read_conf_file(). - Avoid a null pointer dereference in an error path in verify_pubsignature(). Fixes: e3b4a51580fc ("pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME") Fixes: dc4581589a32 ("pkg: clean support for repositories") --- usr.sbin/pkg/config.c | 17 ++++++++++------- usr.sbin/pkg/pkg.c | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c index 26d7dd66b2a4..6649e75b7f6b 100644 --- a/usr.sbin/pkg/config.c +++ b/usr.sbin/pkg/config.c @@ -476,9 +476,9 @@ read_conf_file(const char *confpath, const char *requested_repo, { struct ucl_parser *p; ucl_object_t *obj = NULL; - const char *abi = pkg_get_myabi(); - char *major, *minor; + char *abi = pkg_get_myabi(), *major, *minor; struct utsname uts; + int ret; if (uname(&uts)) err(EXIT_FAILURE, "uname"); @@ -502,9 +502,9 @@ read_conf_file(const char *confpath, const char *requested_repo, if (errno != ENOENT) errx(EXIT_FAILURE, "Unable to parse configuration " "file %s: %s", confpath, ucl_parser_get_error(p)); - ucl_parser_free(p); /* no configuration present */ - return (1); + ret = 1; + goto out; } obj = ucl_parser_get_object(p); @@ -517,13 +517,16 @@ read_conf_file(const char *confpath, const char *requested_repo, else if (conftype == CONFFILE_REPO) parse_repo_file(obj, requested_repo); } - ucl_object_unref(obj); + + ret = 0; +out: ucl_parser_free(p); + free(abi); free(major); free(minor); - return (0); + return (ret); } static void @@ -674,7 +677,7 @@ config_get_repositories(void) { if (STAILQ_EMPTY(&repositories)) { /* Fall back to PACKAGESITE - deprecated - */ - struct repository *r = calloc(1, sizeof(r)); + struct repository *r = calloc(1, sizeof(*r)); if (r == NULL) err(EXIT_FAILURE, "calloc"); r->name = strdup("fallback"); diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 21ee1cd4bd30..92fdbf0ebff8 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -664,7 +664,7 @@ verify_pubsignature(int fd_pkg, int fd_sig, struct repository *r) pubkey = r->pubkey; } else { if (config_string(PUBKEY, &pubkey) != 0) { - warnx("No CONFIG_PUBKEY defined for %s", r->name); + warnx("No CONFIG_PUBKEY defined"); goto cleanup; } } From nobody Thu Jan 16 16:54:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYprJ0wnBz5kfn3; Thu, 16 Jan 2025 16:54:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYprH74t9z3Ktc; Thu, 16 Jan 2025 16:54:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3DIwWxyXOkwweE15Y3YAGjT3cddB8giz5OOkEd5I2Vg=; b=A/K5C4VeP3C4o+zvm0FXGdYryUHhRx5VFT5dnY8C3q6ZHhtFbvJWsyYYKFbg91fL2Q9MxF +V2VHHGaoQhJLI3pkvxVQI0ljtEftFZGXBs+GDE7G6Yzrsu0Uxl5O0z7r7SPmmaOUoQ8fB 56SbWpCNh5nU9ISqbBhLvpIWvLxsrnYJ0BXodhm5TTbv6QCtkVskUpfPzowYFO7kb0sNn8 Q+bBLf8+Aj/bMOPCLk/vKhpiCZL1lmLbz+j1DatdSmq/S4ecW17eVPh4asVdCKkeHxu4bA QrkeACr87iOWr9rXJmhQiJSW1BNz1Q1cKbEBrHDY4pFYrQn8nQn0SSyvA/4iLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3DIwWxyXOkwweE15Y3YAGjT3cddB8giz5OOkEd5I2Vg=; b=jtqgsXn0GG2EK8LKDYKOTwRVZMESyVcFthXYvLvWepg1S2RGl4Z65NGpNci0cJ2Vfa/Tmz 2G4C8k9vBWH55nGzaHxsugDzMNl7P8o62I7PnYrh1IYHuMe8mwklsGSTTd4HOhT4rfzl5U JMxafI31KInYi6FXkk1TuJLUSl+sYk8l1SgUqapC1WAzzublvO4Q2NhA0boSPYzryKuWhX ywjM8rADJLZzbLne4yCKb97Q0pOY6p5XezOulVUXBN4nfKw0etyhdTEzZXM9AQmXcTOiWI +xQnIjr2nWjPlq658F86MZ5HTP+dxuSEap6sgMygsKftD/DvjF9DCZcPLkAn+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737046496; a=rsa-sha256; cv=none; b=PpUEPMP0XixozJMgnWuvAC+KAHmNM7pJkdAiYN+ei1wdxjaajmJHlgBCGJLW7nF2z3vYz+ Jn/Jm0UoV2Twt315gf9xdFv+G5aH+CAjjWnDpnwk/xVGtBiyXCNFgsXUrXSa6k26tkEf1m DgIiiJXLQOLAhgsmFeQN3brNOE++F3rQktLBwPHQYwQjv5ftGwm5+KyhNazTbdf3fAwFbA rg3lmioztXOIahwLb6WH9m4hpRLRp7877sQvWK7vTIhc8uYrcviF+2Eqx3dIO+iIX9/me8 Yh4izAwCUGnGtcniPYeBWXJqdp3yxFxjh+Q9GeihMpJQAANk7c52R7gXmgUdfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYprH6MSkzhGl; Thu, 16 Jan 2025 16:54: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 50GGstBb057888; Thu, 16 Jan 2025 16:54:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GGstxb057884; Thu, 16 Jan 2025 16:54:55 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:54:55 GMT Message-Id: <202501161654.50GGstxb057884@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: 886396f1b1a7 - main - pf: Force logging if pf_create_state() fails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 886396f1b1a727c642071965612e2c2c9dd11d6c Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=886396f1b1a727c642071965612e2c2c9dd11d6c commit 886396f1b1a727c642071965612e2c2c9dd11d6c Author: Mark Johnston AuthorDate: 2025-01-16 15:44:40 +0000 Commit: Mark Johnston CommitDate: 2025-01-16 16:45:16 +0000 pf: Force logging if pf_create_state() fails Currently packets are logged before pf_create_state() is called, so we might log a packet as passed that is subsequently dropped due to state creation failure. In particular, the drop is not logged, which is wrong. Improve the situation a bit: force logging if state creation fails. This isn't totally right as we'll end up logging the packet twice in this case, but it's better than not logging the drop at all. Add a regression test. Discussed with: kp, ks Co-authored-by: Franco Fichtner MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D47953 --- sys/netpfil/pf/pf.c | 1 + tests/sys/netpfil/pf/pflog.sh | 64 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a49216a9dc20..cfab6a828d5f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5911,6 +5911,7 @@ nextrule: &match_rules, udp_mapping); if (action != PF_PASS) { pf_udp_mapping_release(udp_mapping); + pd->act.log |= PF_LOG_FORCE; if (action == PF_DROP && (r->rule_flag & PFRULE_RETURN)) pf_return(r, nr, pd, sk, th, diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index f5a1241cb5a8..968d165f3dcb 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -2,6 +2,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2023 Rubicon Communications, LLC (Netgate) +# Copyright (c) 2024 Deciso B.V. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -132,8 +133,71 @@ matches_cleanup() pft_cleanup } +atf_test_case "state_max" "cleanup" +state_max_head() +{ + atf_set descr 'Ensure that drops due to state limits are logged' + atf_set require.user root +} + +state_max_body() +{ + pflog_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}a + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz "pass log inet keep state (max 1)" + + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog0 >> ${PWD}/pflog.txt & + sleep 1 # Wait for tcpdump to start + + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + atf_check -s exit:2 -o ignore \ + ping -c 1 192.0.2.1 + + echo "Rules" + jexec alcatraz pfctl -sr -vv + echo "States" + jexec alcatraz pfctl -ss -vv + echo "Log" + cat ${PWD}/pflog.txt + + # First ping passes. + atf_check -o match:".*rule 0/0\(match\): pass in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog.txt + + # Second ping is blocked due to the state limit. + atf_check -o match:".*rule 0/0\(match\): block in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog.txt + + # At most three lines should be written: one for the first ping, and + # two for the second: one for the initial pass through the ruleset, and + # then a drop because of the state limit. Ideally only the drop would + # be logged; if this is fixed, the count will be 2 instead of 3. + atf_check -o match:3 grep -c . pflog.txt +} + +state_max_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "malformed" atf_add_test_case "matches" + atf_add_test_case "state_max" } From nobody Thu Jan 16 16:54:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYprL212kz5kfl8; Thu, 16 Jan 2025 16:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYprK5Yz2z3Kp0; Thu, 16 Jan 2025 16:54:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Y19IQN5JCvA9oiAKd3XtaGun5i32xpLuGFcc/fwWyE=; b=NnBMsYpyQcJVAkspdq+9IhawR7KuO/fB0Ao7kNqim0O7r0wl3Q8UkeMHqGIXO5EUnsWX99 vJ4VrKBrmvihc95OBdQUtTsHcQPh0r1dDUjyqTiEEznpbrnhBa2rr4Rg8NWW3cwgaeRHNp jpgpGXn1ayxfbHnKQwKmGqLBhiQUZoMFI9DN46czNreZbBkSJ/kjZmapGykOACKb3QXzMh t3pDtQ5esuBZROEFDjFTNnoPJ5T17kNlYxJYVtsphY9TxDquNCYVNQilJykyTUufgpzM+X Pck23goIuH83pqQacARwNlc1V3EuZiCQof0Ezm3WR7jxLEQfYlFrLOH53Lo66w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737046497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Y19IQN5JCvA9oiAKd3XtaGun5i32xpLuGFcc/fwWyE=; b=Vmun4dzPrqr5x6AyerbVorC5n/EkmgYM8HbIq15h3hdKTJyB4d8aKDoMso00blT+Bp8+Ar NHj0Q1NFKaYtBSCjP7eyZSdMoLeYNNaQ/6kdW/0iVofaFH9Quv+IvFVUaM3cN2dD95CfLj zq+AYN1dg2Q5AYq0aarEq2ERNNjJaD+nY1QrppL88ZgajUCEgtNh5Rert+0c3A9MjUdob5 BgaBK3pRsah9N2k891yzsuKTzHv/3FepCKziuwzw7NnOukIWB9ikSWaxmA5RvNGoEAt0xm TX+cAc7Ekmv5TuQHByH/OuOH92u3LOuq3Z6Z37pyOOzPnlNnrRo7ug2DMU0xTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737046497; a=rsa-sha256; cv=none; b=H/s0U3F5SOLf5/stKJZqmlQyshA4y/sIGkuK/SZrQfcVrdQPbntJVfSVWVt538iVcOi7Oo u+8ND6KukCp8WRPe8kvwyhWhIOT7KOMhhEyizeIuGbSanIX7/DWYaK/k+fWwRV0q9wz94l +fB8y222NLsmkFBrUnCkZl72Wb2PVMmNBoUptxS68h5t/7y6KCLjUJVg9kacYKRjuBYSYG PpM3h9QBtyFhv0P0Po71whD6I5jf+HmvhCBXL+xOAoRsJHHJ+pp2oDmYzQffc6m6ch9d0Q K8gJClq0XpeX8Jqm+G6YlzDqGcdHZp2XLjtSPyuNT4qH9WlQAN1jfJDe9fPqgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYprK0ZH7zhbj; Thu, 16 Jan 2025 16:54: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 50GGsuml057975; Thu, 16 Jan 2025 16:54:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GGsusJ057970; Thu, 16 Jan 2025 16:54:56 GMT (envelope-from git) Date: Thu, 16 Jan 2025 16:54:56 GMT Message-Id: <202501161654.50GGsusJ057970@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: 40faf87894ff - main - ip: Defer checks for an unspecified dstaddr until after pfil hooks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40faf87894ff67ffdf8126fce9bb438ddf61a26f Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40faf87894ff67ffdf8126fce9bb438ddf61a26f commit 40faf87894ff67ffdf8126fce9bb438ddf61a26f Author: Mark Johnston AuthorDate: 2025-01-16 15:46:37 +0000 Commit: Mark Johnston CommitDate: 2025-01-16 16:45:16 +0000 ip: Defer checks for an unspecified dstaddr until after pfil hooks To comply with Common Criteria certification requirements, it may be necessary to ensure that packets to 0.0.0.0/::0 are dropped and logged by the system firewall. Currently, such packets are dropped by ip_input() and ip6_input() before reaching pfil hooks; let's defer the checks slightly to give firewalls a chance to drop the packets themselves, as this gives better observability. Add some regression tests for this with pf+pflog. Note that prior to commit 713264f6b8b, v4 packets to the unspecified address were not dropped by the IP stack at all. Note that ip_forward() and ip6_forward() ensure that such packets are not forwarded; they are passed back unmodified. Add a regression test which ensures that such packets are visible to pflog. Reviewed by: glebius MFC after: 3 weeks Sponsored by: Klara, Inc. Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D48163 --- sys/netinet/ip_input.c | 16 +++++++--- sys/netinet6/ip6_fastfwd.c | 1 + sys/netinet6/ip6_input.c | 17 +++++++++-- tests/sys/netpfil/pf/pflog.sh | 71 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 8 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index e00f3b77c74c..3c340b376433 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -521,11 +521,6 @@ ip_input(struct mbuf *m) goto bad; } } - /* The unspecified address can appear only as a src address - RFC1122 */ - if (__predict_false(ntohl(ip->ip_dst.s_addr) == INADDR_ANY)) { - IPSTAT_INC(ips_badaddr); - goto bad; - } if (m->m_pkthdr.csum_flags & CSUM_IP_CHECKED) { sum = !(m->m_pkthdr.csum_flags & CSUM_IP_VALID); @@ -641,6 +636,17 @@ tooshort: } } passin: + /* + * The unspecified address can appear only as a src address - RFC1122. + * + * The check is deferred to here to give firewalls a chance to block + * (and log) such packets. ip_tryforward() will not process such + * packets. + */ + if (__predict_false(ntohl(ip->ip_dst.s_addr) == INADDR_ANY)) { + IPSTAT_INC(ips_badaddr); + goto bad; + } /* * Process options and, if not destined for us, diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c index 08531cee05bf..0ed313bd49a5 100644 --- a/sys/netinet6/ip6_fastfwd.c +++ b/sys/netinet6/ip6_fastfwd.c @@ -107,6 +107,7 @@ ip6_tryforward(struct mbuf *m) IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_dst) || IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) || + IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) || in6_localip(&ip6->ip6_dst)) return (m); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index ec819a12628d..68e4be66537b 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -621,10 +621,10 @@ ip6_input(struct mbuf *m) IP_PROBE(receive, NULL, NULL, ip6, rcvif, NULL, ip6); /* - * Check against address spoofing/corruption. + * Check against address spoofing/corruption. The unspecified address + * is checked further below. */ - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src) || - IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst)) { + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src)) { /* * XXX: "badscope" is not very suitable for a multicast source. */ @@ -749,6 +749,17 @@ ip6_input(struct mbuf *m) } passin: + /* + * The check is deferred to here to give firewalls a chance to block + * (and log) such packets. ip6_tryforward() will not process such + * packets. + */ + if (__predict_false(IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst))) { + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(rcvif, ifs6_in_addrerr); + goto bad; + } + /* * Disambiguate address scope zones (if there is ambiguity). * We first make sure that the original source or destination address diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index 968d165f3dcb..8288d1d263e8 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -195,9 +195,80 @@ state_max_cleanup() pft_cleanup } +atf_test_case "unspecified_v4" "cleanup" +unspecified_v4_head() +{ + atf_set descr 'Ensure that packets to the unspecified address are visible to pfil hooks' + atf_set require.user root +} + +unspecified_v4_body() +{ + pflog_init + + vnet_mkjail alcatraz + jexec alcatraz ifconfig lo0 inet 127.0.0.1 + jexec alcatraz route add default 127.0.0.1 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz "block log on lo0 to 0.0.0.0" + + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog0 >> pflog.txt & + sleep 1 # Wait for tcpdump to start + + atf_check -s not-exit:0 -o ignore -e ignore \ + jexec alcatraz ping -S 127.0.0.1 -c 1 0.0.0.0 + + atf_check -o match:".*: block out on lo0: 127.0.0.1 > 0.0.0.0: ICMP echo request,.*" \ + cat pflog.txt +} + +unspecified_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "unspecified_v6" "cleanup" +unspecified_v6_head() +{ + atf_set descr 'Ensure that packets to the unspecified address are visible to pfil hooks' + atf_set require.user root +} + +unspecified_v6_body() +{ + pflog_init + + vnet_mkjail alcatraz + jexec alcatraz ifconfig lo0 up + jexec alcatraz route -6 add ::0 ::1 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + pft_set_rules alcatraz "block log on lo0 to ::0" + + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog0 >> pflog.txt & + sleep 1 # Wait for tcpdump to start + + atf_check -s not-exit:0 -o ignore -e ignore \ + jexec alcatraz ping -6 -S ::1 -c 1 ::0 + + cat pflog.txt + atf_check -o match:".*: block out on lo0: ::1 > ::: ICMP6, echo request,.*" \ + cat pflog.txt +} + +unspecified_v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "malformed" atf_add_test_case "matches" atf_add_test_case "state_max" + atf_add_test_case "unspecified_v4" + atf_add_test_case "unspecified_v6" } From nobody Thu Jan 16 17:33:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYqhR6dSHz5kj2r; Thu, 16 Jan 2025 17:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYqhR5m3pz3NlV; Thu, 16 Jan 2025 17:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737048791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GeoFUnum3GqjyFnCkI1IrDq9LegW05589futcJsIwJg=; b=JNFo55TOuTpkjSyLGJKyTnJOkB/SvsEACkC749FS5+XipZVOH+3boVG+aN+VdxDm8MgEwE lwKGcSFLuO7o8lQSB61gb6E1esaPdrA6t+r63tQI6QlcMNgmK+pqAvhYcFiXVa39ArEKCy pMq14ryefcqb7arAewE5GltzA37vvXQMBdGwxNqXdWdf8GneYuWM+sdGZW5FQMxykSular 0nD7XXCsHE/GARoF95Bn/VoK941MGVUtVgL4UkIMa8nArxgc6vBI4RiCh4DPeMgdkINx1b XHWm1lnm8q0feDCWaq0H0Bt5hJ+4wKlNqc4UiHer9mM5uKicCcDtDoSFMq40Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737048791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GeoFUnum3GqjyFnCkI1IrDq9LegW05589futcJsIwJg=; b=v7ejl8upPB+66PjCE6FmBBaC0h+KdcgbH240yJImI0t1AS+0aU1mWFJKL56m33dQIwzheC V/I3msenX62Nn1/U1MNB0nrx61FOjaTWb4ZyoL+h/iY4slhch55YPPFZ8EdrOSqxXof/lz CvFUA4XK2E+fzBRPqZQ7tRnFOQPFRcA3lTXFcX0HdAQLwkWfYXp3vimxjERHBSxVdVOwJ1 bwIeDSrGWiJw/lHKTtw1CQT4R36qrTYNVW/7pVAJDv3ijmFFvlm/vPFMhCGZKZHM2areHr 71+bPoo7S+OyTHCsf1jTfn9XVF9dW6UzNfnXbitk6EbXOBL7bGdUdcdHL9WrTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737048791; a=rsa-sha256; cv=none; b=u3AcoHA+LNKKVK0tTQh7BXCgmD3KyLlPZBFT1wy22AVzQQp0dRFHTznMWYW3XzB9Bp1MeR tCK3yJNyLdv0dC8uTflHnUY6dpgkMNkECdtrcxKxHS0RsL2fiNdd8LKKuyyXwBt20W3EBT FdmE1PH+6bLTbFbEqqtww/ps5TnD1Tq05WFuM9OdQcm97p6vSwyvAc9kbAbUEYwPhwUBZ3 4dLkJBd21iAQA9Zkrw5pjUU2nBK7HBXBTmF2cGg4m1recqYfNN0/DpPucVpMS8+Rs4KVVZ OiGC8jmNUbI9k7PxgK4cAOFHm9OTfrOczXaZCg+8+IHEFIqM9xfyJKT3I87kMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYqhR5FfTzhtG; Thu, 16 Jan 2025 17:33: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 50GHXBUG033546; Thu, 16 Jan 2025 17:33:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GHXBV9033543; Thu, 16 Jan 2025 17:33:11 GMT (envelope-from git) Date: Thu, 16 Jan 2025 17:33:11 GMT Message-Id: <202501161733.50GHXBV9033543@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 6f2775548278 - main - armada38x: implement gateclk clkdev methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f2775548278c76e7c33b15aaaaa759270a8dcd5 Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=6f2775548278c76e7c33b15aaaaa759270a8dcd5 commit 6f2775548278c76e7c33b15aaaaa759270a8dcd5 Author: Mitchell Horne AuthorDate: 2024-04-15 20:18:25 +0000 Commit: Mitchell Horne CommitDate: 2025-01-16 17:27:00 +0000 armada38x: implement gateclk clkdev methods Implement basic clkdev methods required by the generic clk_gate device. This should make it functional, and prevent panics when invoking the clock's CLKNODE_GET_GATE method (e.g. with `sysctl -a`). Additionally, we need to fill in other key fields of the clk_gate_def structure before registering each clk. PR: 278188 Reported by: solo_code@protonmail.com Tested by: solo_code@protonmail.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48419 --- sys/arm/mv/clk/armada38x_gateclk.c | 99 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/sys/arm/mv/clk/armada38x_gateclk.c b/sys/arm/mv/clk/armada38x_gateclk.c index 24355d9c9dac..0cc91b447199 100644 --- a/sys/arm/mv/clk/armada38x_gateclk.c +++ b/sys/arm/mv/clk/armada38x_gateclk.c @@ -43,11 +43,22 @@ #include "clkdev_if.h" +#define ARMADA38X_GATECLK_MAXREG 0 + +static struct resource_spec armada38x_gateclk_specs[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define RD4(_sc, addr) bus_read_4(_sc->res, addr) +#define WR4(_sc, addr, val) bus_write_4(_sc->res, addr, val) + struct armada38x_gateclk_softc { - struct clkdom *clkdom; - struct mtx mtx; - const char* parent; + struct resource *res; + struct clkdom *clkdom; + struct mtx mtx; + const char* parent; }; static struct clk_gate_def gateclk_nodes[] = @@ -219,10 +230,75 @@ static struct clk_gate_def gateclk_nodes[] = static int armada38x_gateclk_probe(device_t dev); static int armada38x_gateclk_attach(device_t dev); +static int +armada38x_gateclk_write_4(device_t dev, bus_addr_t addr, uint32_t val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + WR4(sc, addr, val); + return (0); +} + +static int +armada38x_gateclk_read_4(device_t dev, bus_addr_t addr, uint32_t *val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + *val = RD4(sc, addr); + return (0); +} + +static int +armada38x_gateclk_modify_4(device_t dev, bus_addr_t addr, uint32_t clr, + uint32_t set) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + uint32_t reg; + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + reg = RD4(sc, addr); + reg &= ~clr; + reg |= set; + WR4(sc, addr, reg); + + return (0); +} + +static void +armada38x_gateclk_device_lock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_lock(&sc->mtx); +} + +static void +armada38x_gateclk_device_unlock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_unlock(&sc->mtx); +} + static device_method_t armada38x_gateclk_methods[] = { DEVMETHOD(device_probe, armada38x_gateclk_probe), DEVMETHOD(device_attach, armada38x_gateclk_attach), + /* clkdev interface */ + DEVMETHOD(clkdev_write_4, armada38x_gateclk_write_4), + DEVMETHOD(clkdev_read_4, armada38x_gateclk_read_4), + DEVMETHOD(clkdev_modify_4, armada38x_gateclk_modify_4), + DEVMETHOD(clkdev_device_lock, armada38x_gateclk_device_lock), + DEVMETHOD(clkdev_device_unlock, armada38x_gateclk_device_unlock), + DEVMETHOD_END }; @@ -254,6 +330,7 @@ static int armada38x_gateclk_attach(device_t dev) { struct armada38x_gateclk_softc *sc; + struct clk_gate_def *defp; phandle_t node; int i, error; clk_t clock; @@ -261,6 +338,11 @@ armada38x_gateclk_attach(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + if (bus_alloc_resources(dev, armada38x_gateclk_specs, &sc->res) != 0) { + device_printf(dev, "Cannot allocate resources.\n"); + return (ENXIO); + } + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->clkdom = clkdom_create(dev); @@ -276,8 +358,15 @@ armada38x_gateclk_attach(device_t dev) sc->parent = clk_get_name(clock); for (i = 0; i < nitems(gateclk_nodes); ++i) { - gateclk_nodes[i].clkdef.parent_names = &sc->parent; - error = clknode_gate_register(sc->clkdom, &gateclk_nodes[i]); + /* Fill clk_gate fields. */ + defp = &gateclk_nodes[i]; + defp->clkdef.parent_names = &sc->parent; + defp->offset = 0; + defp->mask = 0x1; + defp->on_value = 1; + defp->off_value = 0; + + error = clknode_gate_register(sc->clkdom, defp); if (error != 0) { device_printf(dev, "Cannot create gate nodes\n"); return (error); From nobody Thu Jan 16 17:53:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYr7X3TTLz5kjw6; Thu, 16 Jan 2025 17:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYr7X2lS9z3QKs; Thu, 16 Jan 2025 17:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737049992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6wrK5to06BYBV2wG4RDNiPgaAFNeQ/hn8k/7fO5FDM=; b=PPV2/iEuqcwmGgvG4oqsthUSYWyqDY1wB3TzaK6JwQMCqB/g+j9xdFeobbJ2LT+o4itKRI dlBZQXIM+e5lFDQ0Ijgbi73cGA+WzMKkZrEsqCbRgHLAijXxP2Ny6KlLIt4zkqlA4FtxEK wa/QhTelwWveFbXYs6SlCDOnkibJRcFtfcIBfBeywrjJiVb5uKEwD9rqDHS+NJsinVno9x ABiUIFTDkxGzwKG2Yf2d4tWRrf12pOQhhNH5EjjcOqvHS4FJjxqkxB9ou0nd7FMvv/jcD7 kaC8ZDuY4u9zN2j+RBBwv5iRQ617FaiKhMpQIbbZB3dTewgYpuMzlQNhyXAkyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737049992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N6wrK5to06BYBV2wG4RDNiPgaAFNeQ/hn8k/7fO5FDM=; b=RrIi9fFRO+i9CeZrvJkZYf+GIzYikTnEry0KKbCpm38ml3aa/ZrCEHUnLumgR8Ha1xtSuR yEr1PkbrQfjhija5KM9dE2cau4SPl7s05I1OFLRrIpv748IXKbMMh9zcjamMnlJU5VpEtV 4CurvEiCrg3CskYxlbyFKI+VTxf7KkQ1m/3DlaMCprav83gqPFihi5yFe3AvDC4/H0cowO IFv6ekyc02frvDqu15527vsSCtmi2dP58GnoLfKwRd7786NJppDaEv1tiDjxn5iveyCgtn 1AC+OKt+Eg/50XmKPZsQKdr+yqRStLuiErWDjEZANDFH/LGOo+nvubeM1SyjRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737049992; a=rsa-sha256; cv=none; b=rbZsf9n0Rnyn6PpbjBPl61aIS7SPDlmR8ime3PZusJO52PHgoHrR1qxIlVkl8MKyCNGmMt +D9Q8bbzHYo+2c+v/m3R7ykvbSfUMrTgBGmO5c3E/Joy/NPW7Dy4BigzezEmice2cZDTAX LN/oGzbfWN7P0acSbDO6jh+fHbZ2UwDWBKkDK8IEZ+/2uWcNkdHoKEXlN21mlRfT2/fQPF MBp2uQyhqRXExWiTCep3M/EwUPlSP6AJ+KzJrAoMMPpxajeiuOcM1e5SA9ntNLF0WCsZ2W lxZKsV3td5XYmCeEkexrBPjsC3PkHzUSK8AMQ6Yl6gWzD9cCDDlbEnCmftCUFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYr7X2B2xzk7N; Thu, 16 Jan 2025 17:53: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 50GHrCNi069993; Thu, 16 Jan 2025 17:53:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GHrCWD069990; Thu, 16 Jan 2025 17:53:12 GMT (envelope-from git) Date: Thu, 16 Jan 2025 17:53:12 GMT Message-Id: <202501161753.50GHrCWD069990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 724e383bd4c4 - main - munmap.2: Add STANDARDS and note about portability List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 724e383bd4c40ea7db4bf2f1e9b8d2c741c6b481 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=724e383bd4c40ea7db4bf2f1e9b8d2c741c6b481 commit 724e383bd4c40ea7db4bf2f1e9b8d2c741c6b481 Author: Ed Maste AuthorDate: 2025-01-15 21:43:49 +0000 Commit: Ed Maste CommitDate: 2025-01-16 17:50:47 +0000 munmap.2: Add STANDARDS and note about portability POSIX used to specify that munmap shall fail with EINVAL if the addr argument is not a multiple of the page size, but that was changed to may fail. Note that we conform to contemporary POSIX and include a brief note for portable programs. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48481 --- lib/libsys/munmap.2 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libsys/munmap.2 b/lib/libsys/munmap.2 index d6b53f1bcf19..5c587d652a42 100644 --- a/lib/libsys/munmap.2 +++ b/lib/libsys/munmap.2 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 15, 2025 +.Dd January 16, 2025 .Dt MUNMAP 2 .Os .Sh NAME @@ -66,6 +66,15 @@ valid address range for a process. .Xr mprotect 2 , .Xr msync 2 , .Xr getpagesize 3 +.Sh STANDARDS +The +.Fn munmap +system call conforms to +.St -p1003.1-2024 . +Portable programs should ensure that +.Fa addr +is a multiple of the page size as returned by +.Xr sysconf 3 . .Sh HISTORY The .Fn munmap From nobody Thu Jan 16 18:07:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSZ30C1z5kktJ; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSZ2H1Pz3R9V; Thu, 16 Jan 2025 18: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=1737050878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUxlhvxX4K6KBFbwK7UmY+pl/7Bas3LHF2FFftMbMW0=; b=TvCH6USAJf1zpB6T8sGXC8lOYz4AbNZBAbFp8OdYLt3FVhKX0dYqMQw5Cc70CPuK68C1WA 26qeDTDpQljcehpL3L+7PnL4QdJhpfrgvr8xlsgPVeutMhgnzedmB3USZBd06kxLTsOFZz TvxOB2oP3sYIpapzzrZSBL8s+tr6vJuncnLZ/hzW8jubTpBHaH2XPqZ9rzULdfz/VKTVUK iC3JzkaCoo0bk+v9Vj77csUYpw9OQ6wRKCUOEkEsX/sqaI2VngQhup01lTBR7NuOOdr755 ZqMtFyAag9VMLvGFB9uFTliXYtiLOu+I4py7s0AxujgVnBwxe7ZglNSSm/2AaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUxlhvxX4K6KBFbwK7UmY+pl/7Bas3LHF2FFftMbMW0=; b=isYpEEKm2bd3H503Nbo86uk0hm6V8IK05ETPnpJn+KiSCgaEwhuFkecqpN8P71C+gD15Er NjXgZyxiM4LSKyaWqaBkDxVbGTq+3BdFfb3EccdcxuJbnN2mbChvqt8Gcf5IVVLtfftDEr ScEfQ+TrEIyYvVXSwgxIDs+qtkeFH6NYBZBfpKmsJIGtEj5IwhjN/KVN5Gjt5fw4dbxPGg zJ3n/+0idSyEQrtf3HJWcyyzUfnaR8m1L2L5nuXwQ191+x0xQgvSf6kEqy31xuVFvnhM0v 0CixvK2zXycTUhWIcLwTKoZg8UfCuBTixxwSK34cpILILp/zd04mRzLtMwbjAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050878; a=rsa-sha256; cv=none; b=KXQb6OrI57ctC4N2IisW7TFulqZQuIlGRq+LLv/uTGUAribfIqwki+clq9o0u3LoFMdmPy E7u2THN12WaYFQ6S2NLcWdlVYcO0YUgcdSB6B6M5c6usRDfUe4nKGi8aCQ8gmwzcbSBc6/ 5VMF6QTT0XlTanD1U5QlS0SeEMTRjl0/kuYsvynzihd+HCoJCmqJl9lgTYZM/jLrQalz4N pOMDFwRPqJDcSm/lDJsA3wNBZgeYG7xSnBc96fh4T2kNgJZrVW6DiNdUNW/vtDR/sUVmD1 JmYiAtS24Fp40l9WDMgCHQKHngdxkXWxb5hGNVQ0D66pCvhNY2LJ5I83kOzenQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSZ1lsRzjbv; Thu, 16 Jan 2025 18: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 50GI7wFv090957; Thu, 16 Jan 2025 18: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 50GI7wkO090954; Thu, 16 Jan 2025 18:07:58 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:07:58 GMT Message-Id: <202501161807.50GI7wkO090954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1ae0a4f52af6 - stable/14 - Open-code proc_set_cred_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ae0a4f52af67d345d9829422b3c7cf9e704da0e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae0a4f52af67d345d9829422b3c7cf9e704da0e commit 1ae0a4f52af67d345d9829422b3c7cf9e704da0e Author: Olivier Certner AuthorDate: 2023-09-25 08:48:49 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:46 +0000 Open-code proc_set_cred_init() This function is to be called only when initializing a new process (so, 'proc0' and at fork), and not in any other circumstances. Setting the process' 'p_ucred' field to the result of crcowget() on the original credentials is the only thing it does, hiding the fact that the process' 'p_ucred' field is crushed by the call. Moreover, most of the code it executes is already encapsulated in crcowget(). To prevent misuse and improve code readability, just remove this function and replace it with a direct assignment to 'p_ucred'. Reviewed by: markj (earlier version), kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42255 (cherry picked from commit 92541c12bc25c59333d7f3b0721b6b16aaff3644) --- sys/kern/init_main.c | 2 +- sys/kern/kern_fork.c | 2 +- sys/kern/kern_prot.c | 11 ----------- sys/sys/ucred.h | 1 - 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 23a1eb944b7b..5835db44b853 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -562,7 +562,7 @@ proc0_init(void *dummy __unused) curthread->td_ucred = NULL; newcred->cr_prison = &prison0; newcred->cr_users++; /* avoid assertion failure */ - proc_set_cred_init(p, newcred); + p->p_ucred = crcowget(newcred); newcred->cr_users--; crfree(newcred); #ifdef AUDIT diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 9bbe7c8a8153..8054f93c2c9d 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1060,7 +1060,7 @@ fork1(struct thread *td, struct fork_req *fr) * XXX: This is ugly; when we copy resource usage, we need to bump * per-cred resource counters. */ - proc_set_cred_init(newproc, td->td_ucred); + newproc->p_ucred = crcowget(td->td_ucred); /* * Initialize resource accounting for the child process. diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 85c38c474df5..44a1f26767ed 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2278,17 +2278,6 @@ cru2xt(struct thread *td, struct xucred *xcr) xcr->cr_pid = td->td_proc->p_pid; } -/* - * Set initial process credentials. - * Callers are responsible for providing the reference for provided credentials. - */ -void -proc_set_cred_init(struct proc *p, struct ucred *newcred) -{ - - p->p_ucred = crcowget(newcred); -} - /* * Change process credentials. * Callers are responsible for providing the reference for passed credentials diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index e7f8d7328dda..8724cfcdc1e6 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -158,7 +158,6 @@ void crcopy(struct ucred *dest, struct ucred *src); struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); -void proc_set_cred_init(struct proc *p, struct ucred *cr); void proc_set_cred(struct proc *p, struct ucred *cr); void proc_unset_cred(struct proc *p); void crfree(struct ucred *cr); From nobody Thu Jan 16 18:07:59 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSb4ZWNz5kkWw; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSb3cFqz3RGM; Thu, 16 Jan 2025 18: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=1737050879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UNAjDgARKpDhEiqlbfGoIaW3EplE1kOe1pYXDA1UI04=; b=dO7CMhY8YRQKlJKiN6k4teCIGMPCl530qYFuQ0WSkDK9sFR1XItDTZcscXrdwb7f1g/Nsq J52OETUdqpqcvulpUolM8u7aJkSgSQbMWweIyXxf81AHlvJZy3GgqOTMsGsQmKrAFbeQy0 4cxChmS85p7ikyPpKRyTWQ/uUKZTUI8Askd7+6VyAneaavqCQhVkGybPr5AUSk+QPKku4Q a7y2nDMfz5x0V4l87qzn6VKGOXWx4fnU+hnJzKNauAUV7YGzKUE18X+yIrUMM+fU8Ngjkk NgVp5fTYEH+JDam+kxGHFnQRdUMVn9aY82U8lMY8e1+Yce8aNV69tjtNC84aew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UNAjDgARKpDhEiqlbfGoIaW3EplE1kOe1pYXDA1UI04=; b=ynb/NDhADN+Xo68KPtcC4HUy/IL/aaiWWMY4ERbzTHO5a4/i073IAxIwEOWpzObG7Wz/Sa Ie2RzAXMuv1vb1s8CC+eeLhkEG4LRY1VMR0Ihp42EEFomtai2PVKzsdUPeW9x08MFEoHru F+Wigx3ZDChydX2rQMwPDjwuYkq1NCjtQoQZi6OgrfBWidLSWMoUSW5hyl0tUswZyFbeA+ vwog51XkS/8cJS/+AdY8EGzPR/8YrG6j30gvRMcNIcoYrroMnAB2+ad2Inzn8kiRNnlmu3 LvN7qpoWXRclC/N9bShZlrdJnPKupP24wBgY3W2qYUDLSHFczux+A+xHoJHWew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050879; a=rsa-sha256; cv=none; b=fpDXzGX9Tnd0qOfN1kszgprP+yZxycugaJnDd8sKjX2x/64ODq/MWRMFKrcmlCHGhk3KRi Kj1ndOjz7Hf6ADi+NEfFHz7D09SgiZQQbrHgUByrYw77QxGqnytvur26vPj+ia7THvH912 RNMAiEksTLOGUKP+QrbCHUTvuh722Q9R6h9RP62PtEUqH4Ewu5ZFA/24RpGoF1SqHm+0B8 4V4quyZ7ebAKFEh07nAuIDnTmnmu0xToskA9AkWpVSoxAsvjSxX0TyR2YQorCd4uHDWbrj ALOP2pnJ1UlABT3T/zOaTEkUhCYpbtiNykF4n2lWoHh6FKBagb1Am/rIOpTTZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSb35l9zjVn; Thu, 16 Jan 2025 18: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 50GI7xS6091022; Thu, 16 Jan 2025 18: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 50GI7x2n091018; Thu, 16 Jan 2025 18:07:59 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:07:59 GMT Message-Id: <202501161807.50GI7x2n091018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 3e496c9f10fc - stable/14 - Add function to OSD to get values without taking the lock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e496c9f10fc8add74722d9bd5b892a1149f31d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3e496c9f10fc8add74722d9bd5b892a1149f31d8 commit 3e496c9f10fc8add74722d9bd5b892a1149f31d8 Author: Stephen J. Kiernan AuthorDate: 2024-04-04 00:12:57 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:52 +0000 Add function to OSD to get values without taking the lock. There are some cases of OSD use where the value is only initialized once at a point where successive access of the value can be done so safely without the need to take the lock. Reviewed by: markj Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D44631 (cherry picked from commit 56b274213024957cea378d27393304ae5cc8ded9) --- sys/kern/kern_osd.c | 23 ++++++++++++++++------- sys/sys/osd.h | 5 +++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 1f93f7021201..9f5803847d24 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -279,25 +279,34 @@ osd_free_reserved(void **rsv) } void * -osd_get(u_int type, struct osd *osd, u_int slot) +osd_get_unlocked(u_int type, struct osd *osd, u_int slot) { - struct rm_priotracker tracker; void *value; - KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); - KASSERT(slot > 0, ("Invalid slot.")); - - rm_rlock(&osdm[type].osd_object_lock, &tracker); KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); if (slot > osd->osd_nslots) { value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); } else { - value = osd->osd_slots[slot - 1]; + value = atomic_load_ptr(&osd->osd_slots[slot - 1]); OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", type, slot, value); } + return (value); +} + +void * +osd_get(u_int type, struct osd *osd, u_int slot) +{ + struct rm_priotracker tracker; + void *value; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + + rm_rlock(&osdm[type].osd_object_lock, &tracker); + value = osd_get_unlocked(type, osd, slot); rm_runlock(&osdm[type].osd_object_lock, &tracker); return (value); } diff --git a/sys/sys/osd.h b/sys/sys/osd.h index 1c58c4fff8de..498cad5064f9 100644 --- a/sys/sys/osd.h +++ b/sys/sys/osd.h @@ -64,6 +64,7 @@ int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value); void osd_free_reserved(void **rsv); void *osd_get(u_int type, struct osd *osd, u_int slot); +void *osd_get_unlocked(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); int osd_call(u_int type, u_int method, void *obj, void *data); @@ -79,6 +80,8 @@ void osd_exit(u_int type, struct osd *osd); osd_set_reserved(OSD_THREAD, &(td)->td_osd, (slot), (rsv), (value)) #define osd_thread_get(td, slot) \ osd_get(OSD_THREAD, &(td)->td_osd, (slot)) +#define osd_thread_get_unlocked(td, slot) \ + osd_get_unlocked(OSD_THREAD, &(td)->td_osd, (slot)) #define osd_thread_del(td, slot) do { \ KASSERT((td) == curthread, ("Not curthread.")); \ osd_del(OSD_THREAD, &(td)->td_osd, (slot)); \ @@ -98,6 +101,8 @@ void osd_exit(u_int type, struct osd *osd); osd_set_reserved(OSD_JAIL, &(pr)->pr_osd, (slot), (rsv), (value)) #define osd_jail_get(pr, slot) \ osd_get(OSD_JAIL, &(pr)->pr_osd, (slot)) +#define osd_jail_get_unlocked(pr, slot) \ + osd_get_unlocked(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_del(pr, slot) \ osd_del(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_call(pr, method, data) \ From nobody Thu Jan 16 18:08:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSf311Gz5kktL; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSd5N6Xz3R9s; Thu, 16 Jan 2025 18: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=1737050881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hLwfgWId9MPLMCZJrlany1YrC1SxsExd26oTjEZ4ljA=; b=PtQL0nl+mvPmWdxI/TqzuR6FcuGxLt0ienIEDaEqJWYjv7OZ219doO1rhotZ6OhD672/nL 2HzdGc7Pk8U4QvDNge2PAovFdMQ0vQklhPwImlxN3U2CDsCZ1B4zho6UDJaaFEOP90vF7C CQ4FYr0FRioBR+mRV9m4hkw45Nvb70OkGtnZ9fL6xmmqjP9bMMuWl39MYnBz411L0HWiSM a++FPJzHkmSmRCvE/InvfFftDpI2FtiGrwCcV+SQBLhgsNnsE/+YDFUNuHi6cElZ9olcVO gESM3Yq8PD/TQ9/FDdqxuTCFDKco1WBft7/rlqtseEdwR6kBbC5x1XQD2yVhHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hLwfgWId9MPLMCZJrlany1YrC1SxsExd26oTjEZ4ljA=; b=MvF3WPnA7W9hteuKtsFtFEl6bjmPfLA8xTuqd2YXnex9nBrr14Wl/eSmxuIQwW1J5Q/Xg/ KAhbUXL+kQgobPsHPUxO4Idi72x2y8hSHuEHcbRm/tUdIY+rCI9NycFB3C2b1i0JJ6c5cA s51YZnl32mHAewLZlKcvIzd5vHKLO42X739h6IEar4xr6YydCwYVVXRTvVoXRKadsVWKmk wfhDb64MkrfGLZtwhMISM2HWNhKId5sDm9IdKaYYiSX1Xt4DL3gzW4cvFyS2Ryh3+9oPbi Ri3UNMy6tUwERxKG8Ioty+xzj3C3gj1eMXCiy35jwxQimPwPhyTwHIZzF/aP3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050881; a=rsa-sha256; cv=none; b=CY56fgrGNZrue7SVeZjvLioxTzBbwZmJ6ltfsR8YG3i6NgjQyuKrAlzFzDdZgXmhPwj4qy 4axDJ9B626F18qhIXzDquEzr8+T7ms2FvQGTtjYMQEnNP9iSOAZ/4UPs5yfTbjO3wU9DM2 XVtaYEJmAW4MQfyF7qJqtGofOvlRrzDO5XEpMKjnL5VcdvIM80oU1ls34eIpq1wPKcJAUQ tf/qlNgI85zofzF63TqKHjEjY9uTkPA1RrAe3sScpFR9ZcxQihPqZny+iZoRnmvujs6UG6 LB1A6VTQlbiE8oSQublbIpxEJNcDr38139KjpX+g2qJWTEEZcLYMVMh6cl6hLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSd4xNFzkMx; Thu, 16 Jan 2025 18: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 50GI81AJ091110; Thu, 16 Jan 2025 18: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 50GI816N091107; Thu, 16 Jan 2025 18:08:01 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:01 GMT Message-Id: <202501161808.50GI816N091107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 63abb6a3b5d4 - stable/14 - osd: Constify signature of osd_register() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 63abb6a3b5d499f4fcd7d10e891900ae09bfbb06 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=63abb6a3b5d499f4fcd7d10e891900ae09bfbb06 commit 63abb6a3b5d499f4fcd7d10e891900ae09bfbb06 Author: Olivier Certner AuthorDate: 2024-07-01 17:10:47 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:52 +0000 osd: Constify signature of osd_register() This makes it clear that 'methods' (if not NULL) points to an array that won't be modified. Internally, this array is indeed copied into the given OSD type's larger array of all methods for all slots. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46886 (cherry picked from commit 4a26b63145a5e18610aa9050262e3b4f75aa7117) --- share/man/man9/osd.9 | 4 ++-- sys/kern/kern_osd.c | 2 +- sys/sys/osd.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man9/osd.9 b/share/man/man9/osd.9 index 95547f5211c2..5e0e482914c3 100644 --- a/share/man/man9/osd.9 +++ b/share/man/man9/osd.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 26, 2016 +.Dd October 07, 2024 .Dt OSD 9 .Os .Sh NAME @@ -49,7 +49,7 @@ .Fo osd_register .Fa "u_int type" .Fa "osd_destructor_t destructor" -.Fa "osd_method_t *methods" +.Fa "const osd_method_t *methods" .Fc .Ft void .Fo osd_deregister diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 9f5803847d24..7073ee564301 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -91,7 +91,7 @@ osd_default_destructor(void *value __unused) } int -osd_register(u_int type, osd_destructor_t destructor, osd_method_t *methods) +osd_register(u_int type, osd_destructor_t destructor, const osd_method_t *methods) { void *newptr; u_int i, m; diff --git a/sys/sys/osd.h b/sys/sys/osd.h index 498cad5064f9..5d59ce5a3d9a 100644 --- a/sys/sys/osd.h +++ b/sys/sys/osd.h @@ -55,7 +55,7 @@ typedef void (*osd_destructor_t)(void *value); typedef int (*osd_method_t)(void *obj, void *data); int osd_register(u_int type, osd_destructor_t destructor, - osd_method_t *methods); + const osd_method_t *methods); void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); From nobody Thu Jan 16 18:08:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSd0DB3z5kkpK; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSc4qLtz3RK8; Thu, 16 Jan 2025 18: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=1737050880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qGTA4cNG5FMyw6uGuLHY+qGL763939l/w/S+JCDZwxo=; b=UVS4RyhApQYkR8lQ8pw+x8nCXqqGcfAn0oNS9IeHlx36XLYxNYHbxxwj/nuw4s5SbR0da/ hEcSGGeVYBt7xfbuvhJV9ngfyQ1Bxeh68MlscTOOoz9RyOM84+5dSc1xKMIWlkCkpt4o9/ wpSw/tjjbbwhveIT8IXNRGmCLvBvwLFi9+bSWvzlzcq27gIA9bq+EspSxTOxd+yeg18uDy Z1pUEqOUjUFIDTHEXmYaUZXz2JY3kZYZdOCGb00hwi7bcMHQMvugGmdPNHMaKOEs9uxZFa e6ITh14kiErOrdZtzGFzIyDaNGGuxxLtjkLeP3Ho6XuJ150NZ49pWS0rlckzJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qGTA4cNG5FMyw6uGuLHY+qGL763939l/w/S+JCDZwxo=; b=s7HS/lhx873dAmz+vyFcTgWDumVRgWQJxd0OIR+98nXKzf0kV4l+41F99p1QcwMAgOkasa LwMfS3mts7M9ebsLMEMtBPmjOUcGELMArJyNEbo7O/M8DQtvywEfir9owDiU/av6cg9+TL 7X0jXW59CcqVnm3AHORNBZnAFchBbOZxNkhvRuedO5CLby03krXsmjE6hQiV+zP++gU7yw 9P+57oP0rJL7bo02meR+Hw7xhy0lCQIZOQZ4MPGhZxM/4UNmO8IkblC/oF1965D/7hNvI6 mbQ4B4R5LaxwuWMoMyq1Nb5bC6qMBH5ic+FLAxK1MqVywqHgEEqsrv87v76b0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050880; a=rsa-sha256; cv=none; b=irfikmIVPLeGILYfT+JCV9sch2EoIZ4+nDLwVlil3JfypcbV5bIgdzQUQ1Pwy5nodjNfeT BOh8VFSmCIpwtFU4gBF3jRnhNdZvvPzCiqOyHYDJThIa519DzORstSxxr/w9Y6Rtl7a344 CC09OGFGY+rPgX2v14agSSIEijSyB+oDvygAAA+BxVE2fV1OHZaxqfJL2NFvkGLTpDqjVM 4eoH0Bq80skrA3MtSpey9stQzxHGL7Ak0toHYZOluLED01Vjqb36oinsnQVrStFYBXhl66 ccbCKYLBimSS8ydQEkUCh+CVx2b0LheiWCIJ/3jBITgQBAO1OrdXLYVdPtkR8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSc3xPZzjs0; Thu, 16 Jan 2025 18: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 50GI80Ku091068; Thu, 16 Jan 2025 18: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 50GI80aZ091065; Thu, 16 Jan 2025 18:08:00 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:00 GMT Message-Id: <202501161808.50GI80aZ091065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0635f5eeacbf - stable/14 - riscv: Implement atomic operations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0635f5eeacbfccff227dc5722cad62ca11abd47b Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0635f5eeacbfccff227dc5722cad62ca11abd47b commit 0635f5eeacbfccff227dc5722cad62ca11abd47b Author: Ruslan Bukin AuthorDate: 2024-05-22 15:07:27 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:52 +0000 riscv: Implement atomic operations Implement atomic_load_acq_16, atomic_store_rel_16. These are needed by bhyve(8) PCIe bus emulation code. Group 16-bit atomic functions similarly to 32 and 64-bit. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D45228 (cherry picked from commit 2183004e14a863d65ca9192df1bea2625e3fdfb3) --- sys/riscv/include/atomic.h | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index fee82e6a6bc9..aaa7add6894b 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2024 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -105,8 +105,6 @@ atomic_fcmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ ATOMIC_CMPSET_ACQ_REL(8); ATOMIC_FCMPSET_ACQ_REL(8); -ATOMIC_CMPSET_ACQ_REL(16); -ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_cmpset_char atomic_cmpset_8 #define atomic_cmpset_acq_char atomic_cmpset_acq_8 @@ -116,11 +114,40 @@ ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_fcmpset_rel_char atomic_fcmpset_rel_8 #define atomic_cmpset_short atomic_cmpset_16 -#define atomic_cmpset_acq_short atomic_cmpset_acq_16 -#define atomic_cmpset_rel_short atomic_cmpset_rel_16 #define atomic_fcmpset_short atomic_fcmpset_16 + +ATOMIC_CMPSET_ACQ_REL(16); +ATOMIC_FCMPSET_ACQ_REL(16); + +#define atomic_load_acq_16 atomic_load_acq_16 +static __inline uint16_t +atomic_load_acq_16(volatile uint16_t *p) +{ + uint16_t ret; + + ret = *p; + + fence(); + + return (ret); +} + +static __inline void +atomic_store_rel_16(volatile uint16_t *p, uint16_t val) +{ + + fence(); + + *p = val; +} + +#define atomic_cmpset_acq_short atomic_cmpset_acq_16 #define atomic_fcmpset_acq_short atomic_fcmpset_acq_16 +#define atomic_load_acq_short atomic_load_acq_16 + +#define atomic_cmpset_rel_short atomic_cmpset_rel_16 #define atomic_fcmpset_rel_short atomic_fcmpset_rel_16 +#define atomic_store_rel_short atomic_store_rel_16 static __inline void atomic_add_32(volatile uint32_t *p, uint32_t val) From nobody Thu Jan 16 18:08:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSg2Krqz5kktP; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSf6L26z3RMS; Thu, 16 Jan 2025 18: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=1737050882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mOzOscrZCZ0OXFyYaQXkmND++MvMj6vbVDzG3pZPhEc=; b=ejQ7dGBaXMJ80rEiQk2aRPLn/ROrOhNNnJgVV94e9x0ykQxuhvofWWIY/lHvZ778QWxPXV 6W/A1cnJOwp9aXu5BORdERtDZ1qLZf3nq6PfyCVCupbYidfURJrawQzl8P/iIUknotOmUP 5KLf2sGI8L3y1CKgBzyX7bBNvmiFp848xj/i4zRtcfDVsIJHh0VvAnIMvhdAwmLxANKLFL 1s3/xBDUvi8voMsYapLhUhn3B4acyFalIzGm+6OXGVIOKGSvf+APeX/bTdDZlIz9FqzCFL sAZYSlz4wg62Ci39Le4GzwojkvLuxeakbRXyKVSUExOiFaw93CesMJA5trxtoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mOzOscrZCZ0OXFyYaQXkmND++MvMj6vbVDzG3pZPhEc=; b=huiPn6xBUb7zLFjqyegrCJDulK44U/6URd7F4wz9Ey4/J4WaaUkRH+wDS9vbjqdgKZq+NX rHRPZdzwidrZcyD/e/E7/kh4/Wz3NNupEz5b8I/A6B+z3nwlT+2k0e7KtsIF5IvHIDg67/ AQ1PcrStlGu2hcK5OAfWQM5SNG5l9MG/P1h/1p9F2uFYdIylng+oVFQZYESAHi40+5RSq+ jQgG67/51TKyg+VmqztnAxt/W0gzfMwpklKFKwDdtKKlSTHba0CGzbqTfzaALe8iwxN1fY NTyRzLtP07V/CuTcYXtADJpuZ/IixCJcg65cknD9QsSuexyIQ55tupHjVaaYmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050882; a=rsa-sha256; cv=none; b=RNQxKsVIyxb1vLEcyIGOlbIv9exQ+dxJ5LG9igwFO/wqUMLMZAjRucSMr31N9nKpRsFPlL pu62EGu0Rc2Kp/lPF2G/sbz/Pjx1zKepUGH5WxGyl0g9AxjGp2l7mvgQcElCbUJ9ET7c0m T8nzGbRy2O56rd9TIqZTqMz+OBIJtlC83TNUhnlA70lQEjM3jzz9GZ1E2CQz8APRmYAooq j5Kvc5ZbQc7gUrXa3OkscNYHDgqG+olIfkDi7aLP3WuDwuq3fcu3lZ63yf9cLKwojyfIWr AOe9fsEiNQ8qPnChGHRerdnhOmRjBVmVXG8f2MUA50Syb5Ts3Lj2h7QtIVeytg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSf5whnzkKd; Thu, 16 Jan 2025 18: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 50GI82B2091158; Thu, 16 Jan 2025 18: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 50GI82RY091155; Thu, 16 Jan 2025 18:08:02 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:02 GMT Message-Id: <202501161808.50GI82RY091155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1fc5db8e9f4b - stable/14 - atomics: Constify loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1fc5db8e9f4b10fed01fc1c07d0e5725c4089b97 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc5db8e9f4b10fed01fc1c07d0e5725c4089b97 commit 1fc5db8e9f4b10fed01fc1c07d0e5725c4089b97 Author: Olivier Certner AuthorDate: 2024-07-19 15:23:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:53 +0000 atomics: Constify loads In order to match reality, allow using these functions with pointers on const objects, and bring us closer to C11. Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm statement's constraint for '*p' (the value to load). CMPXCHG8B always writes back some value, even when the value exchange does not happen in which case what was read is written back. atomic_load_acq_64_i586() further takes care of the operation atomically writing back the same value that was read in any case. All in all, this makes the inline asm's write back undetectable by any other code, whether executing on other CPUs or code on the same CPU before and after the call to atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will trigger a #GP(0) if the memory address is part of a read-only mapping. This unfortunate property is however out of scope of the C abstract machine, and in particular independent of whether the 'uint64_t' pointed to is declared 'const' or not. Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46887 (cherry picked from commit 5e9a82e898d55816c366cfa3ffbca84f02569fe5) --- sys/amd64/include/atomic.h | 2 +- sys/arm/include/atomic.h | 8 ++++---- sys/arm64/include/atomic.h | 2 +- sys/i386/include/atomic.h | 28 ++++++++++++++++------------ sys/powerpc/include/atomic.h | 6 +++--- sys/riscv/include/atomic.h | 4 ++-- sys/sys/_atomic64e.h | 2 +- sys/sys/_atomic_subword.h | 4 ++-- sys/sys/atomic_common.h | 20 ++++++++++---------- 9 files changed, 40 insertions(+), 36 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 8eb3fddb0478..91a4398a0815 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -304,7 +304,7 @@ __storeload_barrier(void) #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE res; \ \ diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index 73e769885f71..a7b5ed76c0ad 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -614,7 +614,7 @@ atomic_fetchadd_long(volatile u_long *p, u_long val) } static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) +atomic_load_acq_32(const volatile uint32_t *p) { uint32_t v; @@ -624,7 +624,7 @@ atomic_load_acq_32(volatile uint32_t *p) } static __inline uint64_t -atomic_load_64(volatile uint64_t *p) +atomic_load_64(const volatile uint64_t *p) { uint64_t ret; @@ -643,7 +643,7 @@ atomic_load_64(volatile uint64_t *p) } static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +atomic_load_acq_64(const volatile uint64_t *p) { uint64_t ret; @@ -653,7 +653,7 @@ atomic_load_acq_64(volatile uint64_t *p) } static __inline u_long -atomic_load_acq_long(volatile u_long *p) +atomic_load_acq_long(const volatile u_long *p) { u_long v; diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index f7018f2f9e0b..998a49c02e60 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -465,7 +465,7 @@ _ATOMIC_TEST_OP(set, orr, set) #define _ATOMIC_LOAD_ACQ_IMPL(t, w, s) \ static __inline uint##t##_t \ -atomic_load_acq_##t(volatile uint##t##_t *p) \ +atomic_load_acq_##t(const volatile uint##t##_t *p) \ { \ uint##t##_t ret; \ \ diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 71aa09c57007..e68af0454130 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -249,7 +249,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE res; \ \ @@ -302,8 +302,8 @@ atomic_thread_fence_seq_cst(void) #ifdef WANT_FUNCTIONS int atomic_cmpset_64_i386(volatile uint64_t *, uint64_t, uint64_t); int atomic_cmpset_64_i586(volatile uint64_t *, uint64_t, uint64_t); -uint64_t atomic_load_acq_64_i386(volatile uint64_t *); -uint64_t atomic_load_acq_64_i586(volatile uint64_t *); +uint64_t atomic_load_acq_64_i386(const volatile uint64_t *); +uint64_t atomic_load_acq_64_i586(const volatile uint64_t *); void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64_i386(volatile uint64_t *, uint64_t); @@ -353,12 +353,12 @@ atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src) } static __inline uint64_t -atomic_load_acq_64_i386(volatile uint64_t *p) +atomic_load_acq_64_i386(const volatile uint64_t *p) { - volatile uint32_t *q; + const volatile uint32_t *q; uint64_t res; - q = (volatile uint32_t *)p; + q = (const volatile uint32_t *)p; __asm __volatile( " pushfl ; " " cli ; " @@ -447,8 +447,12 @@ atomic_fcmpset_64_i586(volatile uint64_t *dst, uint64_t *expect, uint64_t src) return (res); } +/* + * Architecturally always writes back some value to '*p' so will trigger + * a #GP(0) on read-only mappings. + */ static __inline uint64_t -atomic_load_acq_64_i586(volatile uint64_t *p) +atomic_load_acq_64_i586(const volatile uint64_t *p) { uint64_t res; @@ -456,9 +460,9 @@ atomic_load_acq_64_i586(volatile uint64_t *p) " movl %%ebx,%%eax ; " " movl %%ecx,%%edx ; " " lock; cmpxchg8b %1" - : "=&A" (res), /* 0 */ - "+m" (*p) /* 1 */ - : : "memory", "cc"); + : "=&A" (res) /* 0 */ + : "m" (*p) /* 1 */ + : "memory", "cc"); return (res); } @@ -514,7 +518,7 @@ atomic_fcmpset_64(volatile uint64_t *dst, uint64_t *expect, uint64_t src) } static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +atomic_load_acq_64(const volatile uint64_t *p) { if ((cpu_feature & CPUID_CX8) == 0) @@ -842,7 +846,7 @@ atomic_swap_long(volatile u_long *p, u_long v) #define atomic_subtract_rel_ptr(p, v) \ atomic_subtract_rel_int((volatile u_int *)(p), (u_int)(v)) #define atomic_load_acq_ptr(p) \ - atomic_load_acq_int((volatile u_int *)(p)) + atomic_load_acq_int((const volatile u_int *)(p)) #define atomic_store_rel_ptr(p, v) \ atomic_store_rel_int((volatile u_int *)(p), (v)) #define atomic_cmpset_ptr(dst, old, new) \ diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index 0c3a57698342..015a283e2de7 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -502,7 +502,7 @@ atomic_readandclear_long(volatile u_long *addr) */ #define ATOMIC_STORE_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE v; \ \ @@ -534,10 +534,10 @@ ATOMIC_STORE_LOAD(long) #define atomic_store_rel_ptr atomic_store_rel_long #else static __inline u_long -atomic_load_acq_long(volatile u_long *addr) +atomic_load_acq_long(const volatile u_long *addr) { - return ((u_long)atomic_load_acq_int((volatile u_int *)addr)); + return ((u_long)atomic_load_acq_int((const volatile u_int *)addr)); } static __inline void diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index aaa7add6894b..bf9c42453d8b 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -121,7 +121,7 @@ ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_load_acq_16 atomic_load_acq_16 static __inline uint16_t -atomic_load_acq_16(volatile uint16_t *p) +atomic_load_acq_16(const volatile uint16_t *p) { uint16_t ret; @@ -312,7 +312,7 @@ ATOMIC_CMPSET_ACQ_REL(32); ATOMIC_FCMPSET_ACQ_REL(32); static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) +atomic_load_acq_32(const volatile uint32_t *p) { uint32_t ret; diff --git a/sys/sys/_atomic64e.h b/sys/sys/_atomic64e.h index f7245dafb98a..82fe817f307b 100644 --- a/sys/sys/_atomic64e.h +++ b/sys/sys/_atomic64e.h @@ -55,7 +55,7 @@ int atomic_fcmpset_64(volatile u_int64_t *, u_int64_t *, u_int64_t); u_int64_t atomic_fetchadd_64(volatile u_int64_t *, u_int64_t); -u_int64_t atomic_load_64(volatile u_int64_t *); +u_int64_t atomic_load_64(const volatile u_int64_t *); #define atomic_load_acq_64 atomic_load_64 void atomic_readandclear_64(volatile u_int64_t *); diff --git a/sys/sys/_atomic_subword.h b/sys/sys/_atomic_subword.h index dad23383f642..dee5a3bed871 100644 --- a/sys/sys/_atomic_subword.h +++ b/sys/sys/_atomic_subword.h @@ -176,7 +176,7 @@ atomic_fcmpset_16(__volatile uint16_t *addr, uint16_t *old, uint16_t val) #ifndef atomic_load_acq_8 static __inline uint8_t -atomic_load_acq_8(volatile uint8_t *p) +atomic_load_acq_8(const volatile uint8_t *p) { int shift; uint8_t ret; @@ -189,7 +189,7 @@ atomic_load_acq_8(volatile uint8_t *p) #ifndef atomic_load_acq_16 static __inline uint16_t -atomic_load_acq_16(volatile uint16_t *p) +atomic_load_acq_16(const volatile uint16_t *p) { int shift; uint16_t ret; diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 83e0d5af583d..e03cd93c2d4a 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -36,18 +36,18 @@ #include -#define __atomic_load_bool_relaxed(p) (*(volatile _Bool *)(p)) +#define __atomic_load_bool_relaxed(p) (*(const volatile _Bool *)(p)) #define __atomic_store_bool_relaxed(p, v) \ (*(volatile _Bool *)(p) = (_Bool)(v)) -#define __atomic_load_char_relaxed(p) (*(volatile u_char *)(p)) -#define __atomic_load_short_relaxed(p) (*(volatile u_short *)(p)) -#define __atomic_load_int_relaxed(p) (*(volatile u_int *)(p)) -#define __atomic_load_long_relaxed(p) (*(volatile u_long *)(p)) -#define __atomic_load_8_relaxed(p) (*(volatile uint8_t *)(p)) -#define __atomic_load_16_relaxed(p) (*(volatile uint16_t *)(p)) -#define __atomic_load_32_relaxed(p) (*(volatile uint32_t *)(p)) -#define __atomic_load_64_relaxed(p) (*(volatile uint64_t *)(p)) +#define __atomic_load_char_relaxed(p) (*(const volatile u_char *)(p)) +#define __atomic_load_short_relaxed(p) (*(const volatile u_short *)(p)) +#define __atomic_load_int_relaxed(p) (*(const volatile u_int *)(p)) +#define __atomic_load_long_relaxed(p) (*(const volatile u_long *)(p)) +#define __atomic_load_8_relaxed(p) (*(const volatile uint8_t *)(p)) +#define __atomic_load_16_relaxed(p) (*(const volatile uint16_t *)(p)) +#define __atomic_load_32_relaxed(p) (*(const volatile uint32_t *)(p)) +#define __atomic_load_64_relaxed(p) (*(const volatile uint64_t *)(p)) #define __atomic_store_char_relaxed(p, v) \ (*(volatile u_char *)(p) = (u_char)(v)) @@ -124,7 +124,7 @@ __atomic_store_generic(p, v, int64_t, uint64_t, 64) #endif -#define atomic_load_ptr(p) (*(volatile __typeof(*p) *)(p)) +#define atomic_load_ptr(p) (*(const volatile __typeof(*p) *)(p)) #define atomic_store_ptr(p, v) (*(volatile __typeof(*p) *)(p) = (v)) /* From nobody Thu Jan 16 18:08:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSh3Yfdz5kkx6; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSh0JNjz3RKc; Thu, 16 Jan 2025 18: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=1737050884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81ky+eIuB2NJiY95GpvXc4e85tuDY3er5xsQDWBpmtw=; b=lBxQ0vaFGuHTSGxVJnpXMqeDBzfGXSj7OLsq+C4In3BWNcdklE0QeMngN7UN5XDPtWpMSH VdDu2kDjuyy4IXLSd4I68AlUdBpaE9bVtiLhBQu8lyyhFXIeQNqoDq0rnzQm+rTYSV6Qlg TZYOs/Pl3GYx8TiIaJqnpsrexc6INrVAP3UFvp1x6sCZoWj95EIfynu/mKARo5w9uRqINW HUuCpVe6VZzg1mgS/tOyR6ndoKVuLu5HehjCxU09rv14cuUwy7MLjJlhkvGoEItS0idoDV sJGf8faqRcdBkGr8UP0u+j6JY1ukM5KlfyGcmO45nPdAgrBjjZcp1Q0/lC6iMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81ky+eIuB2NJiY95GpvXc4e85tuDY3er5xsQDWBpmtw=; b=EzNnuKY9Q5HuK6EigevNcOJGoSaLSxK1ZywlASGeZ/C3ork4o39jKAHNdkZlS/subXBQdE JkF07z4CEzTuB4mZZ2wX8VU7MsablStNQbEJo3lMKw0OZyYt57n795LTlkUlqqEuRyFo3+ OULV94/XUY4tnVuUrVuJi7EoytTfKbMEcN/0L41B3TmY5eTicYpMD4Ra+c7q8anc3CEEf2 dKJJKtMo7M8LVSmpAp+JFeGZA2MMS+2zpb6DRYBBEs+IyCG6T3CmblEsDkeQqIm8+OSuPL 386lGBu/ZmEA8DuqCP/1+ah9sjbmK5aA9QxjDZlAlRcnPOPjYXDJoWs7GtCtZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050884; a=rsa-sha256; cv=none; b=Duhkm4mrS/L4S5A/arJsKj8wxfATrbcn+BBvMA8d0cvhf5v3wFu2vUFQeGGmUgJ8HC6JHI Zy2TxbNbu/azxsTUH9ghV8i4PMtaBcR9Ud9UCHDOi7LmxQwyfUtDRgcJHIreHboYsnm4hr 43y6yQBKZt3chOP58U8CC7te94HdoRGgpsXkXHjATdU+OC+dqqgHKWpfnSdvJSzHclueYV +da9cP7iUY6jkJyEm8yr4NzI2kkNDpmX61qoJrhYxw0hSTc312EtzBKipz61uJV9MxLaRT kz9nvC30FSQLz0i3m7W6JRD8otdEx5VDyvm5f8X4k9g63Z7IBBFtC4aIuDilBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSg6wBQzk0w; Thu, 16 Jan 2025 18: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 50GI83g3091205; Thu, 16 Jan 2025 18: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 50GI83rJ091202; Thu, 16 Jan 2025 18:08:03 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:03 GMT Message-Id: <202501161808.50GI83rJ091202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2e866a1ea99e - stable/14 - refcount: Constify refcount_load() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e866a1ea99ebc14568a8d8ded8d88958a1f011a Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2e866a1ea99ebc14568a8d8ded8d88958a1f011a commit 2e866a1ea99ebc14568a8d8ded8d88958a1f011a Author: Olivier Certner AuthorDate: 2024-07-19 15:23:45 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:53 +0000 refcount: Constify refcount_load() Reviewed by: markj Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46888 (cherry picked from commit 9dc5b3dbb063f55543ff8a0619eee2e294fb7dc5) --- sys/sys/refcount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h index 212e8e516271..58d4ec573931 100644 --- a/sys/sys/refcount.h +++ b/sys/sys/refcount.h @@ -65,7 +65,7 @@ refcount_init(volatile u_int *count, u_int value) } static __inline u_int -refcount_load(volatile u_int *count) +refcount_load(volatile const u_int *count) { return (atomic_load_int(count)); } From nobody Thu Jan 16 18:08:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSk3VF3z5kkxC; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSk1tw4z3RQZ; Thu, 16 Jan 2025 18: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=1737050886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7Qy8ViZpZOwFYLq2TNuqdkkDJgPFOuL/u02RdR1MWc=; b=Rqpanf8TIbvJHa7hcUkylTOJPiAE37njxM7aLqUUbmKm41u3un8HiDNnFtJ6DiNZzAIauQ Kr4+4LIC+Fcxx35TOjbCeBpmFLBAOEyVrCDYbMdPIIS0clwElD5IJyfSS6cZaQU4prjn9d 8SRsmQcGH2j/MU/9pyjPwAI+LqwU6z783uESXX+9VZxS+zWHkWOLZfR5aEuOLJtBC0BEgJ rjGe36I0GZFdRT1Oq0INVHrsk/Myf/Ivh4JgW2oN6M35PVTeZKkCrh9/GcqevS5RQsyVhc 9ndu5itb8a7vBAArWyBGjRmSzZvumShhYbLtJKeGemSRFIQPZaBxIRrMnSqTnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y7Qy8ViZpZOwFYLq2TNuqdkkDJgPFOuL/u02RdR1MWc=; b=Lw9v8vTjT4E+m7cHT9uilDD1iJiooNNdyi8f1m+cLWc4vejxNH5khO9CgztSnpnwrcmVk0 fzGV0fHapUtobf22SezpYx6jtyK1nPwxB0/lfNHyoNLOqM6Cz7bozcSHiARhdtI2ijrMSA OTFUsQwsv+/e0Zt90cmqgZ+QvQ0o+idZQQuoQesQVc6pn1f058a5fhAlVURLKZFhNQJKfR sV2JQJid2oJZ7q50oIBXSMae5YkMTy/K10rlQPgM3pwF7l0lFo/WC6tSjzK4lm9XnWj/NH 5X+3T6fGQzu5eDyQJOf0K7qpQY8XiT72non4R8/pXh/xgfl1pJB5Uf8PvKfpiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050886; a=rsa-sha256; cv=none; b=XcAEotReyUJoeLshkkvG4DGhIvMO2Uf1oafU5L+UuTcgMfjtLnq0E6toR9PlfV2b2wJF2D qfbsYOvJ1GtrGnCEDRKXrZLmg/AeLr7qA3jrEwIDqEJbmGZUGg4z306wwZuNIFcyM2AS6k HGfaXuTLnDtrfiHbtQCv36eWpIGIPFj/SGt1fdR0bSYITjB+FT1utPdexNsbVMYv0w9Yng PFa++LdogVsb7ja1IlPrGmyb6PsWwpicqdZmjz5ikp8rfG/xWn2OiXpTXi0aQWWmTOt+Gj Ek7KtodMHcyxZJUIMo1IoldCV8m029D0MZWSEEXYcsrWyzJZIr0V+pdBNzll/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSk1RHCzjbw; Thu, 16 Jan 2025 18: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 50GI86QF091311; Thu, 16 Jan 2025 18:08:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI86PJ091308; Thu, 16 Jan 2025 18:08:06 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:06 GMT Message-Id: <202501161808.50GI86PJ091308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b1fe5eac37ba - stable/14 - MAC: mac.h: Fix missing includes/typedefs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b1fe5eac37bab5bb2606bb4e0b1eee4877b3b367 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b1fe5eac37bab5bb2606bb4e0b1eee4877b3b367 commit b1fe5eac37bab5bb2606bb4e0b1eee4877b3b367 Author: Olivier Certner AuthorDate: 2024-07-29 14:21:52 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:53 +0000 MAC: mac.h: Fix missing includes/typedefs This fixes inclusion from userspace, and also kernel inclusion for source files not including explicitly nor implicitly . Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46896 (cherry picked from commit 5140ccf2268b0e771c89e46f46c60e1fee7637c3) --- sys/sys/mac.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/sys/mac.h b/sys/sys/mac.h index facdc14c332d..ae8d8d38f17b 100644 --- a/sys/sys/mac.h +++ b/sys/sys/mac.h @@ -47,6 +47,13 @@ #ifndef _SYS_MAC_H_ #define _SYS_MAC_H_ +#include + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + #ifndef _POSIX_MAC #define _POSIX_MAC #endif @@ -72,6 +79,13 @@ typedef struct mac *mac_t; #ifndef _KERNEL +#include /* For __BEGIN_DECLS and __END_DECLS. */ + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; /* process id */ +#define _PID_T_DECLARED +#endif + /* * Location of the userland MAC framework configuration file. mac.conf * set defaults for MAC-aware applications. From nobody Thu Jan 16 18:08:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSj5lN2z5kkZM; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSj1jfzz3RKt; Thu, 16 Jan 2025 18:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+IWgXEuPorjn7ZVBhA7gqH2wBKlNX8R9Ge8Okk/V4Y8=; b=G9piMxNB/EtK6B1KHIICV8ZjHig1Fp2jsc9F+MWmNFWNIH/wAujXNwfK7leyXdVrSkZJWM l5xlHqM1knzKO/iutfZIpRV5whtUlqmz9vNnpBuvOQLhe7WQ/jBjxn4ZRUzWwHJBqsGcx4 sudVOGgyOyEE+gC0OR3ruXLEMwveJzDWKLIN5gZtcihlgVrOpTwETgTcT9N3w8XCg90r7K Zoia1C5zgUEnimTh7dVmumhzq74v5bm6IlRwN4NAZkZ+AcaWjXWBKaXM0bAhFY9qXFvNob Ucc4sVNPjct2zsYtUfAy/RJPx+81v7tZ4bz87/XT/8dyHEzZt3X9as3rUihQOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+IWgXEuPorjn7ZVBhA7gqH2wBKlNX8R9Ge8Okk/V4Y8=; b=eeak7B5UEEj7dP/r6DZaZhU03VwhRmD7KaQim8ZdycvFtvdaOp6lgtTxEPszzru2F0H3hv jeLTSM5/Yt1yoYHMwrbyhugf1LiQ6/z+jAhLkjVgTZv8lexqDzy39dPGBDQgA23cxWFxPN zN8yA3QyyCWC8eNig6QH5GoUvARWjMV6M0L8o0oeKW3m+B2nQN6vgafB7BoPO1Tc/hg95j kbeiaIQ8eGz4I/aa4sVw11j64lQleZNXj+a5TVxnrk3Y+CqtXP0wDf88tBIuN2QFof8xYm 19wK1opQ42tPdULSmGNHdmeVC0lu1y1gvIZo2ifgTd3Co8A0+c8izrxXmmjb3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050885; a=rsa-sha256; cv=none; b=E2tSMjRk9gL81s+RXUcrO33OEgyJVeRWjuVjOnk8zmlNVqkwf1s7dCiLl5NeVpOVN4oZlk Ym2N7m6qI9uNSidYOw8yg4t3SbP6r7RTFTmH2b1qPRwk0uFakG9tqmcWfg6BDA3hHjdRrC +hKcPU9bJeRNqJoD9hG8TnzaE1QDjO4aER7xzUz+GJpIK1x1SIXC96S1pBuuCd4n3GsXHQ Gv3zYB3P79ccvpQ/lxrIKHdkQKRC99DuHbwv5LLOuGP3LCHu9oeb6UfNFA8CWwaOI7bkqO T5bjKK3zRWnzEt5RNylsiVAgif9cBIPbkxrrMHnI0Oa+rkhu7HfRoKNSItmclg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSj0qf2zkKf; Thu, 16 Jan 2025 18:08: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 50GI85pP091254; Thu, 16 Jan 2025 18: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 50GI85rP091251; Thu, 16 Jan 2025 18:08:05 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:05 GMT Message-Id: <202501161808.50GI85rP091251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fa940dd2bf03 - stable/14 - queue: New debug macros for STAILQ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fa940dd2bf034a294f6638bd0def2022c7746fd5 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fa940dd2bf034a294f6638bd0def2022c7746fd5 commit fa940dd2bf034a294f6638bd0def2022c7746fd5 Author: Olivier Certner AuthorDate: 2024-07-08 16:15:49 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:53 +0000 queue: New debug macros for STAILQ The new STAILQ_ASSERT_EMPTY() macro allows callers to assert that some STAILQ is empty. It leverages the new QMD_STAILQ_CHECK_EMPTY() internal macro. QMD_STAILQ_CHECK_EMPTY() is a check for empty STAILQ, where heads's 'stqh_last' field must point to the 'stqh_first' one. Use it in STAILQ_ASSERT_EMPTY(). QMD_STAILQ_CHECK_TAIL() checks that the tail pointed by 'head' does not have a next element. It is similar to the already existing QMD_TAILQ_CHECK_TAIL(), but without the superfluous 'field' argument and clearer documentation. Use it in STAILQ_INSERT_TAIL(). Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46889 (cherry picked from commit 34740937f7a46c7475bb57e804701ba8830bf6ed) --- sys/sys/queue.h | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 9bdfd497b165..fee6618ee88c 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -341,6 +341,40 @@ struct { \ /* * Singly-linked Tail queue functions. */ +#if (defined(_KERNEL) && defined(INVARIANTS)) +/* + * QMD_STAILQ_CHECK_EMPTY(STAILQ_HEAD *head) + * + * Validates that the stailq head's pointer to the last element's next pointer + * actually points to the head's first element pointer field. + */ +#define QMD_STAILQ_CHECK_EMPTY(head) do { \ + if ((head)->stqh_last != &(head)->stqh_first) \ + panic("Empty stailq %p->stqh_last is %p, not head's " \ + "first field address", (head), (head)->stqh_last); \ +} while (0) + +#define STAILQ_ASSERT_EMPTY(head) do { \ + if (!STAILQ_EMPTY((head))) \ + panic("stailq %p is not empty", (head)); \ +} + +/* + * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) + * + * Validates that the stailq's last element's next pointer is NULL. + */ +#define QMD_STAILQ_CHECK_TAIL(head) do { \ + if (*(head)->stqh_last != NULL) \ + panic("Stailq %p last element's next pointer is %p, " \ + "not NULL", (head), *(head)->stqh_last); \ +} while (0) +#else +#define QMD_STAILQ_CHECK_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) +#define QMD_STAILQ_CHECK_TAIL(head) +#endif /* (_KERNEL && INVARIANTS) */ + #define STAILQ_CONCAT(head1, head2) do { \ if (!STAILQ_EMPTY((head2))) { \ *(head1)->stqh_last = (head2)->stqh_first; \ @@ -349,7 +383,11 @@ struct { \ } \ } while (0) -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_EMPTY(head) ({ \ + if (STAILQ_FIRST(head) == NULL) \ + QMD_STAILQ_CHECK_EMPTY(head); \ + STAILQ_FIRST(head) == NULL; \ +}) #define STAILQ_FIRST(head) ((head)->stqh_first) @@ -391,6 +429,7 @@ struct { \ } while (0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ + QMD_STAILQ_CHECK_TAIL(head); \ STAILQ_NEXT((elm), field) = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ From nobody Thu Jan 16 18:08:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSn0H7Qz5kkZR; Thu, 16 Jan 2025 18:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSm3bRSz3RR5; Thu, 16 Jan 2025 18: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=1737050888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8h/VaN5aQy9ElMBtDIyVZNG9nKBCpQp4eLxLh2kk/Y=; b=yu7xfPZ6tIaq5g81kjZAWQ8hw6ThcOcNjNbs4/gxRAf3mTsS2QgdhFyKH3vPTs9nugRqC6 pMoG6CJg71mudCvbnq5wuZagzuVOF9uFDk7INpSJFcidQJ2oJkqWPcbejS/Or9YGXaT8+D TXpIMLJDg0r02dHthFIzbUKXDyYoHFi3sxbGdivvedv6o9UeNcJF4c+8d1JMOt+Zjer6oF 9vCrBWMBHZoRa0xH6s9/RsYHf+e7B30Y0ZJqUoSSPWcAgQpwykUmy2SQbWxUpda2CS3DkU xSEvDIFr10Vcez/q/hXziCGBvTojfHi7CtuxkyNnZpZCyxz3/G+L4tQcMHTPGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v8h/VaN5aQy9ElMBtDIyVZNG9nKBCpQp4eLxLh2kk/Y=; b=ca2dg/JavaWCpmAQ1yiphYWq6jpl3HRqB/Hx4xr0o54OH0H4S5EE2EHaQECk646vabqwly LQO8qu1WHgP7cGCkCJ8niUuWso/en6NNvFQ5Qigr0fd4p4uwjirj7wbQK9JxmLRsYVLS5z 00ORBAPw0FD3Z6En6glV3EX2nP2JuSZNuJVKI7nmQ/potu1Y9YsxRoHskqu5xBwDLF0iz2 PArs4HYzL03eodB2uotPqvMZ5O6oBP4VbU6436147q97ZCWs1zA0r9Ycs0a5IL+X81Mcuv CLY7NxaIzahrfSNbar5CyA/zZUqlNKIJDJ9rYdR6cy8Dn81ivk2WOnqc1pq7sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050888; a=rsa-sha256; cv=none; b=jbSuD9YbPE3IJxCOs4mjOKHOYvbgZwUwH7o8ttH4XKAd145tjmAH0xiJIQEF7V46m4CtO3 6NbggOoWFp+1jtzyB079b0NBN5MoDY1zR+RGetaFbRULc/OmA+PiKjK92tRx7/R5OrBA6R owj1NdkyE6dbXqfheOhNR3mS4e8lfIGgXXkUwg9qyKgdoJrBWMxCfzLKpUX0wlFcYnhwtE qA2nA6VU6v7i6J8RAmrxW1OIcM6n99mfYyYy2wdNe+NNMq/UZx+ZaZ31YfEfYqdc0BZ0hN C20zJqmnFLFWPLSyg6Z8PD+3l/+PUkH1fi3K+C7++FrhysdwNQ1G+x3uTX0R2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSm39tqzk0y; Thu, 16 Jan 2025 18: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 50GI883k091426; Thu, 16 Jan 2025 18: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 50GI884A091423; Thu, 16 Jan 2025 18:08:08 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:08 GMT Message-Id: <202501161808.50GI884A091423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f878893bdc59 - stable/14 - MAC: 'kernel_mac_support' module: Make an outdated comment more generic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f878893bdc59de2d6db9275713c3876150028de6 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f878893bdc59de2d6db9275713c3876150028de6 commit f878893bdc59de2d6db9275713c3876150028de6 Author: Olivier Certner AuthorDate: 2024-07-03 14:23:38 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:54 +0000 MAC: 'kernel_mac_support' module: Make an outdated comment more generic No functional change. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46898 (cherry picked from commit 90678c892d7b3a90339b7fc19fde16c64fe3cb70) --- sys/security/mac/mac_framework.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 8f1aa37d45b3..7fdb7b4ed2d2 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -106,7 +106,7 @@ SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD MAC policy controls"); /* - * Declare that the kernel provides MAC support, version 3 (FreeBSD 7.x). + * Declare that the kernel provides a specific version of MAC support. * This permits modules to refuse to be loaded if the necessary support isn't * present, even if it's pre-boot. */ From nobody Thu Jan 16 18:08:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSl70mdz5kkTw; Thu, 16 Jan 2025 18:08:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSl2v3Zz3R8X; Thu, 16 Jan 2025 18: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=1737050887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nh0F/syJZLCjNXKfDBENMckeMqWgKcpG+uCfbRKyi68=; b=C80+cVhyx9NLgGPoK7qZ+OC4jLI74YtACtebXQYcSoFO6JISYT/OyFDMBVtEcRTYihckC9 ottl5sasTBtwT7y5kwPGUkNxxbyRPOtAgtDSZJBRq7XQ49ayEEXtjYiedNS0yH8ArtBOS/ pL+KsrlMjWRjrjFiZhC/m4ARFtD06+u8KyHVJP/mMPOgsOP7pCzQw6y5nBAv7cFg+8kT7G SmBj90qcwjoMQ5FEOKoBT6tr+q6P2SxEUw6/Pr/7U0VrqdGnmwbnsVKeanrvkn8/qnE0C6 Gxe0LyJMpNN7JGUcaE8DlNJ5xfcqQnHXAlKKoqEKkuLP7Cm5yrhy1DjhZ6YW0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Nh0F/syJZLCjNXKfDBENMckeMqWgKcpG+uCfbRKyi68=; b=iv1gfjmFBgoeWt6TyVdwNgetYKB9rQgrwSQD08iQLM1tTalNNDssc/F9uxvNQhyf62y6PX m+MuopRsIkZP1qDiQk4AfEfayz56aVH4N42qrVvzo/LbOYQLh6X9sdzJ6OEgJLfsI/1mwF 7x9DccVNtWKEhaMcIRuBtQSZqNaEqht4n/ahiZ6MoqfY4a7HuWpwAihrTUCGIXwEMOSwN6 wq2LUDQLqhnhilyyLSfO7YPRw4dG/i7GfOdQG71Jnutek96tK5D3AMaEIuV0tkZCKZP3BJ 0xekljGlFrdTIbbqmvh1122Ye3uFYe4DhT541FRYBY4yu6kgBxaRkIZd78t+sA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050887; a=rsa-sha256; cv=none; b=KWx5dRWM+TE/tBdqCb+OwE4JYukoZDYeAdgJMoFu83dpsNaI50v8K1X2+0fg0mCScGOrak FiKEN6qZcPPBZ/AKosnFTELbxzvRwbHBlSyuHaYcLTqkG29T8PRRA9FEV/M0mYYVrYj6um MDE49FT274q2w/N8r44yqP70N7SEMiXB8JHf5IN5TtTd+kC9I0wWauSuGkOaMCw697M1QF TCQYs53uu6q7JyylZe9n9SnbAlA+59BJfTQaGWOZa7Ehhb9PJnvhEt1rR7/BoQdXEnP6Cd 4KQSJNykOJEeWi98rx8pEaV3lGCwpwdUIgrW0zF5TNvi+EVqmI4WTtu37Tl69g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSl2RtGzk0x; Thu, 16 Jan 2025 18: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 50GI87O1091367; Thu, 16 Jan 2025 18: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 50GI8723091364; Thu, 16 Jan 2025 18:08:07 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:07 GMT Message-Id: <202501161808.50GI8723091364@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1bd029729e45 - stable/14 - MAC: mac.h: Separately test inclusion from userspace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1bd029729e4537aae2b5e946e9c569034eabeef2 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1bd029729e4537aae2b5e946e9c569034eabeef2 commit 1bd029729e4537aae2b5e946e9c569034eabeef2 Author: Olivier Certner AuthorDate: 2024-07-31 08:52:50 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:54 +0000 MAC: mac.h: Separately test inclusion from userspace Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46897 (cherry picked from commit b47f4718c0725f4ea2e8f88359e86661e8dc4a38) --- tools/build/test-includes/badfiles.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/build/test-includes/badfiles.inc b/tools/build/test-includes/badfiles.inc index eb0cd05cb39f..21657bfef4ed 100644 --- a/tools/build/test-includes/badfiles.inc +++ b/tools/build/test-includes/badfiles.inc @@ -75,7 +75,6 @@ BADHDRS= \ sys/lockf.h \ sys/lockmgr.h \ sys/loginclass.h \ - sys/mac.h \ sys/mbuf.h \ sys/md4.h \ sys/md5.h \ From nobody Thu Jan 16 18:08:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSp16mjz5kkXJ; Thu, 16 Jan 2025 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSn5vsJz3RRJ; Thu, 16 Jan 2025 18: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=1737050889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zspZVsmQa41VUK4wf/BYYW5umtJgQzisuEeQD1WdVpU=; b=ipWmmANUzn3fjgp22SqjGJmUg0EQd9AI0ltw/Avwq/Xjqbve3iY23cHaZ9y0qYQyIMpVAc Xoi0YG6eB2NyV//EDtxRxH2W9MKEBeeBV71mDB+72sszOeDd9CNj11OUN8FyVkyG6LUfHN XEYmnpjY/d28h0b6uiv3LWRfPt2neyZMDyfJqWE69Drfjdso4R+lRmf52LUlIiFO0ZLdwD AlUrlCOZ//VoUs+s1hF6Am6Ojp27lhaPDoK3kzEXbuMQpqgQ+AX2AKPVz+W4b6GFOIHBfW ERRLBhFu0yifCcycXge+Dmd+ZOcfXDojyqQOWuN/ePlX+AtNggm6umqhPAddKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zspZVsmQa41VUK4wf/BYYW5umtJgQzisuEeQD1WdVpU=; b=cNP3VeeRz8HLf+Yo2wNty+5sBGi2GfWle2T1CeIb4QF0/BbM5rLr0++kDuwGxYiMueqjby GiPcrOoz9cM9H9dVFbidNH9bjrAMzRgUCxnx138JlLUOa3xz7XyMX5bCgKYhXg2Hv9e9p4 13N3rC/Px+kC69p4iZNrl2zwhbK9L5Z1KNXlgDrUT0eOO/UVbuE6JCkT7R8zQyPwUFAVtC /hbdIDSe36njPyCivDpO7JZ5erp7r1p1jhAu6xzuthTvwbB8lCaMFbqDKqKqd+MNyoxq/W 3cpXI1/teb4bTTrx6YgTIzC4Vt3ujPAF65XvG8Vs7hvTvtv8LVWSY/HKkePMSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050889; a=rsa-sha256; cv=none; b=CJgdWqmUwRG0KyNa3yfLRXzhPP6ykBIu8iEAxtiyKBQUEHBKRWXeym6t5HEvDKuS/2cCFU Luy/vZpn+QEmM2JPNx7ALfNQMqOTx6FsJyTWxyljbO7uPMpBRf10+xqJxZBLrIsdsitWya EWXpsV6OvLbGRPq8DsGS6Brk1hG0fFAAhpH7RCWqQo2WZU7K2amwIPjkt15CuqNxmezG1T twC/GL7+pJwoUcO05yNqDPVbpcPmVw68x0/zgDUM53ZE64TftgFZirY1OZ67YEDuRBlAyy Fqti9FvcEJXStPF2wT1IzRwDlwI+L+M1nPSh4BmGYRmWtbf89h8tEJ4yYDYKDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSn4Z3XzjVp; Thu, 16 Jan 2025 18: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 50GI89nu091508; Thu, 16 Jan 2025 18: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 50GI89mb091505; Thu, 16 Jan 2025 18:08:09 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:09 GMT Message-Id: <202501161808.50GI89mb091505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 66fb52a27279 - stable/14 - MAC: Define a common 'mac' node for MAC's jail parameters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 66fb52a27279235d0c42b605355afe3227feacee Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=66fb52a27279235d0c42b605355afe3227feacee commit 66fb52a27279235d0c42b605355afe3227feacee Author: Olivier Certner AuthorDate: 2024-07-03 14:30:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:54 +0000 MAC: Define a common 'mac' node for MAC's jail parameters To be used by MAC/do. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46899 (cherry picked from commit 5041b20503dbb442cc9ebd0a6e4db26905102c72) --- sys/security/mac/mac_framework.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 7fdb7b4ed2d2..b5eb1620300a 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -105,6 +106,11 @@ SDT_PROBE_DEFINE1(mac, , policy, unregister, SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD MAC policy controls"); +/* + * Root sysctl node for MAC modules' jail parameters. + */ +SYSCTL_JAIL_PARAM_NODE(mac, "Jail parameters for MAC policy controls"); + /* * Declare that the kernel provides a specific version of MAC support. * This permits modules to refuse to be loaded if the necessary support isn't From nobody Thu Jan 16 18:08:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSq48Wpz5kkXS; Thu, 16 Jan 2025 18:08:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSp6RxQz3RCD; Thu, 16 Jan 2025 18:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYq6GJXhTttgZICrPgQg8ntlai+yBZMcVp+9mq3nZFw=; b=QjKkuSG4xKyM3xrbdOPiPVAo9eWxtcgE0VAFCB6bu/df8D4w2RH9P0uqeiyiv3cExW/az2 j37MgmFfIum/mRzdfaf3ZExDi1CcqEALLYv2HOktkjn4xFgXQYbsVK0yVq/x2gtrvjLXH3 ZuQw0/IBYdMdBnEPbkzh38IwFOuO4dTkxKnNddXNwQbS7xjv4T6C+QyNbIPQmDW8NPDE2f hPk+ij1QGDRLS6zH5XUSWevUQG3FWPAP8JWDBWOETBgmU0/uR7AgCr1quW9R1yPKU+tctw Ry+ITxujRavxoxP5BnLnKFdaMjON1mXMQ38cbA+XRRS5ByMzFCA7y3T+5KZ7iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yYq6GJXhTttgZICrPgQg8ntlai+yBZMcVp+9mq3nZFw=; b=wf64xKaUf01aiXIteBmaIbp+6WF4wwbexruz35U/PQptBwwCAbFLuvnqm26rGeIJjSiUXG cbYg0Qv3z+nl1YxW5WET+6nIRAfm2/gH3hohuHBmCnb1ZyROSZyhgbpiJ8InpaW3BUd0pi YLnC625/VQNHEdKxzAwsbyyQuPu1rnrL7INhoz3CbDq0peTEMNy6fsGz2Ldy0rb8mWk09H IXhdEMscLvaxusTlVFokBlbEsJcWtk8WT9g7om3/zu0jTj81dMrdkjt+bhtycGHqnucQwz FWsvF0VHdb9cW7K98Gz+UgbeBLtfcjtSqPvRlGw3TSkThFz/3getch84alfPXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050890; a=rsa-sha256; cv=none; b=hemVrwdGyM/V/wddieFg7CuWx8Vd9xrEBleRaeniZbKq7BApBueVMqYHVYYkVlkqM4/dT9 3Lk/W9ovY9c0NdQXebEgFBKO9jagB7Jdjh/oMopfGtOoNwQW3OSNQ0dnQFrJBLRUpaqT9r chReMOvXs3QLsntZknS2Ep6kysuIAa/yQrCOTw34GknC7H+I7WwWtYuNgYFOyvLL6sCZjK w1iQYI6mNWNk4JEKU9x0i3EhURIl/0psl7QqivQZW48wW576GuLKcDLu10yEo3JZeGfFIH S1rjpTp0BYIoXwuGtb2kBUQwg8s0bQniKHEjJNIgR+RzJJyAVZqO1Hmjib6QXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSp5Zy0zkMy; Thu, 16 Jan 2025 18:08: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 50GI8Agl091565; Thu, 16 Jan 2025 18:08:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8A5x091562; Thu, 16 Jan 2025 18:08:10 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:10 GMT Message-Id: <202501161808.50GI8A5x091562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ec661f29c3e3 - stable/14 - jail.h: Fix whitespace in the param macros declaration block List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec661f29c3e350c7a54ed95af5b110d427e830cd Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ec661f29c3e350c7a54ed95af5b110d427e830cd commit ec661f29c3e350c7a54ed95af5b110d427e830cd Author: Olivier Certner AuthorDate: 2024-07-04 09:01:10 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:54 +0000 jail.h: Fix whitespace in the param macros declaration block Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46900 (cherry picked from commit f8fe6bc73bbbced506a02ed88783c0c0bb9b49e4) --- sys/sys/jail.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 088a0bc33d6d..fa30a363340e 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -376,26 +376,26 @@ extern struct sx allprison_lock; SYSCTL_DECL(_security_jail_param); #define SYSCTL_JAIL_PARAM(module, param, type, fmt, descr) \ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_STRING(module, param, access, len, descr) \ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), NULL, len, \ - sysctl_jail_param, "A", descr) -#define SYSCTL_JAIL_PARAM_STRUCT(module, param, access, len, fmt, descr)\ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ - sysctl_jail_param, fmt, descr) + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), NULL, len, \ + sysctl_jail_param, "A", descr) +#define SYSCTL_JAIL_PARAM_STRUCT(module, param, access, len, fmt, descr) \ + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ + sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_NODE(module, descr) \ - SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_MPSAFE, \ - 0, descr) + SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_MPSAFE, \ + 0, descr) #define SYSCTL_JAIL_PARAM_SUBNODE(parent, module, descr) \ - SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, \ - CTLFLAG_MPSAFE, 0, descr) + SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, \ + CTLFLAG_MPSAFE, 0, descr) #define SYSCTL_JAIL_PARAM_SYS_NODE(module, access, descr) \ - SYSCTL_JAIL_PARAM_NODE(module, descr); \ - SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ - descr) + SYSCTL_JAIL_PARAM_NODE(module, descr); \ + SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ + descr) /* * Kernel support functions for jail(). From nobody Thu Jan 16 18:08:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSv0Lq6z5kkrw; Thu, 16 Jan 2025 18:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSt2mF4z3RYf; Thu, 16 Jan 2025 18:08:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TNu8LMTD3PUy5/+p+IwHnHkE8j9YaspnJAXRaVxZxWM=; b=jTk5rxuCs3ABlk7ZKWgw+2jaKNg+JIO+EfeYGwGZZqNrXyZVtRLdwbKbXjfv6rkk2KC/jL yLWlXnI1AOjcDP5zzIfySebUdfHul57+QSIl4TPpacF2T7bvTTAvf/gReAjx1fOy0q/CCj HqLK8ujLmnEsP3u6206ZulntjHFJQVrmidr75fRmjeOBp+jq7KUUPzSMYc6gabZQ0MMUNC CxXWH45qcW4NbxENwUn+44M6xA54ekyUJnUjOBlRxcMmsZN4i1B/wTtVy82FS2ncy5dfmo O+lzfAPblKxG6l+n1SwubLWS5F/NOrUtJLTBQVn0vqGgkUueMgkMOAqBd3LtXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TNu8LMTD3PUy5/+p+IwHnHkE8j9YaspnJAXRaVxZxWM=; b=gxUndV80XRPzROu/u7oCwU887TAS4WOJoS6N7KhiD4tmAhPzuLaXoO5a3NvajxVc2JKUFP 2v5N3/KN0pLR8s9a3Neu+g2EvtJkLDl7Gjxu+BDC9PHl/tL9jtES2f7lmTy+9MQx10Bpdv /u8zhaSiIpRZGboWxxVS1azwP55Iwcp2oPHvPA+W+5i/bn1Y4JZjdzg3zrDhyp/b3J2Xj7 t5noL96Vofd5DECOglsIhnYQyqY9coHw+N1lvrqvpC3hVbe2Zq6+/qn61SiEnnKNqyRraU JyEE91gTjgXv4Lh/C1r8tiHoPvoeh1wUOqM9SUvtPEzU8OENOkX4cTVzzTXzng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050894; a=rsa-sha256; cv=none; b=fduK1++wswzjme5lT55lVViqULkLlj2WvtfM6dcSxhyDdvZkpbaYXXD0clUUMlbWjvIC0q oWvrfreaX4BXQk/wH5b8wfTjlYEftE1bxcnX8TvwJvtkStJAy4/cQk/shm/XDc3gaICFFl sdS1IMl2jQdDS2VhWWZJ6iwx79hyKO64qGzFwegw7yXz3ySu4xlqNNnbv+xIB5n3SaWFQF booqcvBtCeDXdesFhWAa0ZRTT8PTj6AcASvNbAM66yl0dAJddMQmNjJLK0bveI2g38xHee wb04QddOL2Ue0bSNh6HN3ZCpUs34U3duPT6hhLazDEDg9y7ERRc7N6hwClbXGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSt1XC6zk11; Thu, 16 Jan 2025 18:08: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 50GI8EsO091701; Thu, 16 Jan 2025 18:08:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8EVg091698; Thu, 16 Jan 2025 18:08:14 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:14 GMT Message-Id: <202501161808.50GI8EVg091698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 62d3e81935c6 - stable/14 - MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 62d3e81935c6b642bc6a3ffb0b909c14d15efbed Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=62d3e81935c6b642bc6a3ffb0b909c14d15efbed commit 62d3e81935c6b642bc6a3ffb0b909c14d15efbed Author: Olivier Certner AuthorDate: 2024-07-04 14:08:20 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:55 +0000 MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes Do this only when the headers for these functionalities were included prior to this one. Indeed, if they need to be included, style(9) mandates they should have been so before this one. Remove the common MAC sysctl declaration from , as it is now redundant (all its includers also include ). Remove local such declarations from all policies' files. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46903 (cherry picked from commit db33c6f3ae9d1231087710068ee4ea5398aacca7) The original changes in 'sys/security/mac_grantbylabel/mac_grantbylabel.c' were removed as MAC/grantbylabel has not been MFCed. --- sys/security/mac/mac_internal.h | 7 ------- sys/security/mac/mac_policy.h | 15 +++++++++++++++ sys/security/mac_biba/mac_biba.c | 2 -- sys/security/mac_bsdextended/mac_bsdextended.c | 2 -- sys/security/mac_ifoff/mac_ifoff.c | 2 -- sys/security/mac_ipacl/mac_ipacl.c | 2 -- sys/security/mac_lomac/mac_lomac.c | 2 -- sys/security/mac_mls/mac_mls.c | 2 -- sys/security/mac_ntpd/mac_ntpd.c | 2 -- sys/security/mac_partition/mac_partition.c | 2 -- sys/security/mac_pimd/mac_pimd.c | 2 -- sys/security/mac_portacl/mac_portacl.c | 2 -- sys/security/mac_priority/mac_priority.c | 2 -- sys/security/mac_seeotheruids/mac_seeotheruids.c | 2 -- sys/security/mac_stub/mac_stub.c | 2 -- sys/security/mac_test/mac_test.c | 2 -- sys/security/mac_veriexec/mac_veriexec.c | 2 -- 17 files changed, 15 insertions(+), 37 deletions(-) diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index 4b2be98b4e03..c35504e04ea9 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -56,13 +56,6 @@ #include #include -/* - * MAC Framework sysctl namespace. - */ -#ifdef SYSCTL_DECL -SYSCTL_DECL(_security_mac); -#endif /* SYSCTL_DECL */ - /* * MAC Framework SDT DTrace probe namespace, macros for declaring entry * point probes, macros for invoking them. diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h index cf101bc4414e..084684e57497 100644 --- a/sys/security/mac/mac_policy.h +++ b/sys/security/mac/mac_policy.h @@ -1064,4 +1064,19 @@ int mac_policy_modevent(module_t mod, int type, void *data); intptr_t mac_label_get(struct label *l, int slot); void mac_label_set(struct label *l, int slot, intptr_t v); +/* + * Common MAC Framework's sysctl and jail parameters' sysctl nodes' declarations. + * + * Headers and normally have to be included before + * this header as style(9) hints to. If they weren't, just forego the + * corresponding declarations, assuming they are not needed. + */ +#ifdef SYSCTL_DECL +SYSCTL_DECL(_security_mac); +#endif + +#ifdef SYSCTL_JAIL_PARAM_DECL +SYSCTL_JAIL_PARAM_DECL(mac); +#endif + #endif /* !_SECURITY_MAC_MAC_POLICY_H_ */ diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 5d66e2fd4b9b..e991e05311df 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -88,8 +88,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, biba, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_biba policy controls"); diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c index 95efc537735a..8a6549214380 100644 --- a/sys/security/mac_bsdextended/mac_bsdextended.c +++ b/sys/security/mac_bsdextended/mac_bsdextended.c @@ -68,8 +68,6 @@ static struct mtx ugidfw_mtx; -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD extended BSD MAC policy controls"); diff --git a/sys/security/mac_ifoff/mac_ifoff.c b/sys/security/mac_ifoff/mac_ifoff.c index d84b9c85a5be..cffe93b4d9a9 100644 --- a/sys/security/mac_ifoff/mac_ifoff.c +++ b/sys/security/mac_ifoff/mac_ifoff.c @@ -58,8 +58,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, ifoff, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_ifoff policy controls"); diff --git a/sys/security/mac_ipacl/mac_ipacl.c b/sys/security/mac_ipacl/mac_ipacl.c index 5bcb9d652a13..69802845252a 100644 --- a/sys/security/mac_ipacl/mac_ipacl.c +++ b/sys/security/mac_ipacl/mac_ipacl.c @@ -70,8 +70,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, ipacl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_ipacl policy controls"); diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index aa9abf458721..23acc7b7a592 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -89,8 +89,6 @@ struct mac_lomac_proc { struct mtx mtx; }; -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, lomac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_lomac policy controls"); diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index a22b504c3362..54a32b6d564d 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -89,8 +89,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, mls, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_mls policy controls"); diff --git a/sys/security/mac_ntpd/mac_ntpd.c b/sys/security/mac_ntpd/mac_ntpd.c index 3125bc057be8..1aeaeb032bb8 100644 --- a/sys/security/mac_ntpd/mac_ntpd.c +++ b/sys/security/mac_ntpd/mac_ntpd.c @@ -34,8 +34,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, ntpd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_ntpd policy controls"); diff --git a/sys/security/mac_partition/mac_partition.c b/sys/security/mac_partition/mac_partition.c index 2cff042cb33a..2f0189b79ace 100644 --- a/sys/security/mac_partition/mac_partition.c +++ b/sys/security/mac_partition/mac_partition.c @@ -61,8 +61,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, partition, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_partition policy controls"); diff --git a/sys/security/mac_pimd/mac_pimd.c b/sys/security/mac_pimd/mac_pimd.c index 19ee307c918d..a9276a73b433 100644 --- a/sys/security/mac_pimd/mac_pimd.c +++ b/sys/security/mac_pimd/mac_pimd.c @@ -35,8 +35,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, pimd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_pimd policy controls"); diff --git a/sys/security/mac_portacl/mac_portacl.c b/sys/security/mac_portacl/mac_portacl.c index 184ec4b4738c..b3a5e06c0e2a 100644 --- a/sys/security/mac_portacl/mac_portacl.c +++ b/sys/security/mac_portacl/mac_portacl.c @@ -79,8 +79,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, portacl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_portacl policy controls"); diff --git a/sys/security/mac_priority/mac_priority.c b/sys/security/mac_priority/mac_priority.c index f460e5195cb9..1e5bfb5386cb 100644 --- a/sys/security/mac_priority/mac_priority.c +++ b/sys/security/mac_priority/mac_priority.c @@ -35,8 +35,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, priority, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_priority policy controls"); diff --git a/sys/security/mac_seeotheruids/mac_seeotheruids.c b/sys/security/mac_seeotheruids/mac_seeotheruids.c index 1677b092daad..9cd2e0f3c0fc 100644 --- a/sys/security/mac_seeotheruids/mac_seeotheruids.c +++ b/sys/security/mac_seeotheruids/mac_seeotheruids.c @@ -59,8 +59,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, seeotheruids, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_seeotheruids policy controls"); diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c index 9a2650ea32f4..c602c639ec95 100644 --- a/sys/security/mac_stub/mac_stub.c +++ b/sys/security/mac_stub/mac_stub.c @@ -88,8 +88,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, stub, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_stub policy controls"); diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c index 267666555f22..7a6a76ce23cc 100644 --- a/sys/security/mac_test/mac_test.c +++ b/sys/security/mac_test/mac_test.c @@ -78,8 +78,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, test, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_test policy controls"); diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c index 7ac09e2acf0f..36217b5c6f4d 100644 --- a/sys/security/mac_veriexec/mac_veriexec.c +++ b/sys/security/mac_veriexec/mac_veriexec.c @@ -81,8 +81,6 @@ static int sysctl_mac_veriexec_state(SYSCTL_HANDLER_ARGS); static int sysctl_mac_veriexec_db(SYSCTL_HANDLER_ARGS); static struct mac_policy_ops mac_veriexec_ops; -SYSCTL_DECL(_security_mac); - SYSCTL_NODE(_security_mac, OID_AUTO, veriexec, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "MAC/veriexec policy controls"); From nobody Thu Jan 16 18:08:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSt0MJQz5kkxS; Thu, 16 Jan 2025 18:08:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSs47ZFz3RWZ; Thu, 16 Jan 2025 18:08:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhSXOCvawuutJFZoN1YiFbznfrdpetwJ3n0xy3YfTIg=; b=wZJE1Ojh6xR2PAwr+1GkSV5VFgcKeYep8bBuqCoWKyTNp0/oKbZQ/fxwHE+oD9vu7IGr40 oJ8vN0UCbg9RXuY2TwfNml4QisFHk4MFiRjQve7XZviR9Y+pJGVjCQ6EntUDGNrUzLAKtI pm6Quok66wAKndVNLOd3gx0gCtDMPDNMzC98lYU0W+i6+W5rjLjlbs/A8NJT65HpQXizVt MTgpKAl1zsf61ofWe+qFxHr6324aedgzfvfmGMW9FbBdlDZIpMz6y6tNvbxLovFhn+eB3i I8YyeeliTeS8sgTOgc8lkSnpY/dJlo0WJ/rl4p7qDLzdMOCp0HGspjLrO3KjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZhSXOCvawuutJFZoN1YiFbznfrdpetwJ3n0xy3YfTIg=; b=FfsOMXEl0EN550Ajqj0S+/gGIIT0VOzQ9darxtdkOt5XI3WkYbdJLd+Kfyc1cnJue3JzpL SL0Tg4fkO6sbCYshrPVVPPfZkL6yjATHw/suYth2PjcXMXsqJpwXn28pgZoTWD28/wRlWv SFqeVcxMj4QoxCu2LkdqCfGNvgIAeswMN/Izide22JDD3KxPvp44urGOhG0G8inPrzAVaG 8RdunPE1bzE5vaZxTnFiRgDkDvr6TWcM/3YWsgrGHeFgcX0EN5TPBvg4Hog2yxXLlWYuny DDIrdC2MuvEya8y0P3oOeptIMUSGDWms+MkHPRKWImvZUhWfpGkEFuY/bL/6wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050893; a=rsa-sha256; cv=none; b=eNe8E8R+BO4qwnqWnOQAT+s4Kv+Dt4jIs2duFosbEWJBHkivZb9Xm1bz1EieMikoesWkHq Mh+F3+KTixZ2VBz7ehYXtGpRxnfCOQsR+EinJKJS+oS9ZWfqJOPiJrgVh1S8g6ZSysSB8B PR12+eo9NbB1j1VXbCvIlMrGupqSLfUDKn4i7KD9NpdNNh8fWajDVOoJ/BO+odn/0SKiw8 hjN9LBOgnckkToXdX2+T3XUAiREDoYFlRtxsm8wvuK3EejlAdwZ1UFr1srUXbGI7SR9nat CZfUa2bPYtr1LtG3VuJeOBCsragJQW8u6yONP0rF0bErquGJBcdntViHxbJ2SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSs0PBVzjVq; Thu, 16 Jan 2025 18:08: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 50GI8CbZ091644; Thu, 16 Jan 2025 18:08:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8CDU091641; Thu, 16 Jan 2025 18:08:12 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:12 GMT Message-Id: <202501161808.50GI8CDU091641@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4ccba65f9190 - stable/14 - jail.h: New SYSCTL_JAIL_PARAM_DECL() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ccba65f91907df7bfe6b2e447eb0d28519f4125 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4ccba65f91907df7bfe6b2e447eb0d28519f4125 commit 4ccba65f91907df7bfe6b2e447eb0d28519f4125 Author: Olivier Certner AuthorDate: 2024-07-04 09:50:04 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:55 +0000 jail.h: New SYSCTL_JAIL_PARAM_DECL() Like SYSCTL_DECL(), additionally prepending the well-known jail parameters' sysctl prefix. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46902 (cherry picked from commit f7bda491ef05717fb4fe6c89083485599db951b8) --- sys/sys/jail.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 053f68a36735..0b0ee9cdde0f 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -375,6 +375,8 @@ extern struct sx allprison_lock; */ SYSCTL_DECL(_security_jail_param); +#define SYSCTL_JAIL_PARAM_DECL(name) \ + SYSCTL_DECL(_security_jail_param_##name) #define SYSCTL_JAIL_PARAM(module, param, type, fmt, descr) \ SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) From nobody Thu Jan 16 18:08:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSr3VTJz5kktY; Thu, 16 Jan 2025 18:08:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSr1lcMz3RCN; Thu, 16 Jan 2025 18:08:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynclcVoDOshjXnnXiCkj14KlEyF9CnY52KuX+kzQhV0=; b=l80+k5bng7/SD+JsltMY0tPylyubBLFYPn5elChy5iIRAytk6GeheMx5weQ+KpcHmf9p2P OAXkpv0RIwKRP60popcg+ydpZRDDBq526aOLE9as65wupLKcPeZ9Z512SLp+OBNPPUsDzT 0wSdr3Ev9RFggAlF8dz+RZkuQE+7K7sHXTicX++3OJOi4eIudzq6fN4i7tZ7o7ek7+fAiD UpCFwDgtSPoG/owKvstXGVe2PAzDsvf0NQapJB8GL6CracvQ2Ojq6eB5dboL23tmK1Hy3W Mut/ROeJ8Jdp7BtoenPEE8+V9vHimmdqm3Xf/uU6SgQlTlkoPdLWSshv8Ku/gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ynclcVoDOshjXnnXiCkj14KlEyF9CnY52KuX+kzQhV0=; b=THt0IhLLRAtEnQVm8Wsi2XyEu6mVjezzZuA/3qGc9kKIhKn4+vT7exbIxXdPHlGwzBS+zJ VJdka0PGN8A1l36cZ5ybqO4Et9px8wmj+VLsFFXOXiTqGi6ZIM9I5k28KyFIIt/pl3omDy CFjjrUVfz9/3OHSU45j8yFYw1jPhbg8656yQiHHH5Br3rA8osefDs3C4RY18d3Gj6jzO1k tgfzhJZcZeBKSbhOj+gfIxa/j2RVl2VfEMNV9MEnVUWY0TBFxNECKMryqgk5EM36pY0bDg STtu9UdJBIrk0JsfZvN1Cr/XK4K928Vml4ImRL0s72wdTmrJbHPNyHzcw/LZlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050892; a=rsa-sha256; cv=none; b=N4mf/hUhLvfXbvTRmfybWCFEmJzqtWXf645Z6kSYBHm7wiqjrw0VFxz0/qNVhSq8/1GTk+ W4Hpx9e0HzXFHOcGpgS/muR4EtL//CWKl9S7/YN5zbDRHNpHFobcAUavN9/qhE1Yu97B2S TvaNs++l439DfSnVo+RYRY/PxLayYzh2H7WYbvvnhLwONjvBafE7PW3lLc4Idiw4ENeMVs voPr8yWN/XJFXgrZkvw4oWFB92L0YpQvyJj/j3/GT6ErldCRWpVia8ON8ZhcK1DbCNjykS Wpdm/yByL4/bp1OtIxZC4ErtnBzE2NDy/NLKromgQ9biLtftyVqtlXX/aX77DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSq6W6tzk10; Thu, 16 Jan 2025 18:08: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 50GI8BEU091601; Thu, 16 Jan 2025 18:08:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8BuG091598; Thu, 16 Jan 2025 18:08:11 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:11 GMT Message-Id: <202501161808.50GI8BuG091598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 7340eb44087f - stable/14 - jail.h: New SYSCTL_JAIL_PARAM_SYS_SUBNODE() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7340eb44087fe067b0bac9f32cbc07342b5261e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7340eb44087fe067b0bac9f32cbc07342b5261e1 commit 7340eb44087fe067b0bac9f32cbc07342b5261e1 Author: Olivier Certner AuthorDate: 2024-07-04 09:05:44 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:55 +0000 jail.h: New SYSCTL_JAIL_PARAM_SYS_SUBNODE() Same as SYSCTL_JAIL_PARAM_SYS_NODE() but allowing another level of hierarchy. To be used with MAC policies, so that they can have their own node under "security.jail.param.mac". Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46901 (cherry picked from commit 9f8020e65ba8f2398bf79505037b75670340e5fa) --- sys/sys/jail.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index fa30a363340e..053f68a36735 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -396,6 +396,10 @@ SYSCTL_DECL(_security_jail_param); SYSCTL_JAIL_PARAM_NODE(module, descr); \ SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ descr) +#define SYSCTL_JAIL_PARAM_SYS_SUBNODE(parent, module, access, descr) \ + SYSCTL_JAIL_PARAM_SUBNODE(parent, module, descr); \ + SYSCTL_JAIL_PARAM(_##parent##_##module, , CTLTYPE_INT | (access), \ + "E,jailsys", descr) /* * Kernel support functions for jail(). From nobody Thu Jan 16 18:08:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSw6R2Nz5kkpt; Thu, 16 Jan 2025 18:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSw3jq1z3RfY; Thu, 16 Jan 2025 18:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AC2N3Fo7YF4gDnI73YdcDc+RGr/G/dr0h5vttmR+4CQ=; b=ZZqZ323a59Irzf+t0Se33pjnMZoWjKVJk3HMQUdKBxp1zLvZW0q9L7CdmjkoJTIVVBhUS1 OAbefX92YuXMwU1msnYLGr/+X18OGEdQKxDLiGd9e6yUR81BTYQbH1LFPUaqJAszZfJxRk NjdXmWBXgiYTQzb0QReZIcpwApDXdfYcAIPHEISHvk9PYfV+cJ6wMBoaN/vhxqibwSuuA7 LYLn8sAiPwKf4GF127CpWAxVBJbHi1rLTjKauuPBV2mdz5JCtQa0CVFO/RT0a3vS1IiLqa 7GzA87fS4RgSQZkWapS0cOaPQTVMv74O17BfGlBhYKNQGGkQMep69HDhHJeWuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AC2N3Fo7YF4gDnI73YdcDc+RGr/G/dr0h5vttmR+4CQ=; b=UD/GvycrBP/f+qmuk8qc79SVi2jLnYstonfzlNPBOj41PL9XwPDsVZ5/Fpr7CUNwPh7NDF J4w5Voru1Z8hN+8tKD4CnTFKXsGJXN5gDq4EDE06cPlDOZoMHMG+rh359ZFwfISBFGp8/6 lHIU/g1YZ8C37STS59RarwTO6pmJVimPGxCvvE/uOTiFCjPXYWlzCxwEsPIe/mzl+uMp3i tMQBIRqX8F87iXO3HlTJolfMuFipXDDRm4xjQNr61FqRGzZ75r4AKFQKraEuys//3xGFn2 UDl5m2i6u/TvuH8PMLXxVfKWKTUf+YSqSlSbO5fiYnzbWfspVxSwmBCmprMQsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050896; a=rsa-sha256; cv=none; b=GPsdTMCrP5LaTZAdrL0qnnz+6qJQBz/iAmIgxOuy4S4XupJBytKT7GI84mDTNo1YFSTkxp v2ddV1Fnq+W1cJE/CUMTteBzoyhQdPL6jbVhAH+DSJ9g5EL5Ca5PTsIfIfDa61Te8lTYwG MLKoaatOPtMK21CFFyrA8PCRgT9tiBumTK5RRM6Pf2IKLTC7O38/loNhQAxZ0rGggfnKxR O84kE2uh6kfrWxiCnFPkP1MuP+DyuPMCQBCTlYolr65pdPG86f5QNmwrJLVkCJ/aRNO53G 0gJmW3m6/hhUGZXTz58T3OuTP/fH4ulFT1FzBoYVS4ZpMZraKIbW4IQrsnTkyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSw33LLzk7n; Thu, 16 Jan 2025 18:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GI8GaL091845; Thu, 16 Jan 2025 18:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8G54091842; Thu, 16 Jan 2025 18:08:16 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:16 GMT Message-Id: <202501161808.50GI8G54091842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: c2bf375d1023 - stable/14 - MAC: syscalls: Split mac_set_proc() into reusable pieces List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c2bf375d102329723f5e2fd45429bc4d92878a51 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c2bf375d102329723f5e2fd45429bc4d92878a51 commit c2bf375d102329723f5e2fd45429bc4d92878a51 Author: Olivier Certner AuthorDate: 2024-07-27 08:31:16 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:56 +0000 MAC: syscalls: Split mac_set_proc() into reusable pieces This is in preparation for enabling the new setcred() system call to set a process' MAC label. No functional change (intended). MFC after: 2 weeks Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46905 (cherry picked from commit 8a4d24a39098ed8170a37ca2aa83bf1da1976de1) --- sys/security/mac/mac_syscalls.c | 115 +++++++++++++++++++++++++++++++++------- sys/security/mac/mac_syscalls.h | 33 ++++++++++++ 2 files changed, 128 insertions(+), 20 deletions(-) diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 74db8625114e..e97a7dc09700 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -68,6 +68,7 @@ #include #include #include +#include #ifdef MAC @@ -85,7 +86,7 @@ static int kern___mac_set_path(struct thread *td, const char *path_p, * after use by calling free_copied_label() (which see). On success, 'u_string' * if not NULL is filled with the userspace address for 'u_mac->m_string'. */ -static int +int mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, char **const u_string) { @@ -115,7 +116,7 @@ mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, return (0); } -static void +void free_copied_label(const struct mac *const mac) { free(mac->m_string, M_MACTEMP); @@ -183,52 +184,126 @@ sys___mac_get_proc(struct thread *td, struct __mac_get_proc_args *uap) return (error); } +/* + * Performs preparation (including allocations) for mac_set_proc(). + * + * No lock should be held while calling this function. On success, + * mac_set_proc_finish() must be called to free the data associated to + * 'mac_set_proc_data', even if mac_set_proc_core() fails. 'mac_set_proc_data' + * is not set in case of error, and is set to a non-NULL value on success. + */ int -sys___mac_set_proc(struct thread *td, struct __mac_set_proc_args *uap) +mac_set_proc_prepare(struct thread *const td, const struct mac *const mac, + void **const mac_set_proc_data) { - struct ucred *newcred, *oldcred; struct label *intlabel; - struct proc *p; - struct mac mac; int error; + PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); + if (!(mac_labeled & MPC_OBJECT_CRED)) return (EINVAL); + intlabel = mac_cred_label_alloc(); + error = mac_cred_internalize_label(intlabel, mac->m_string); + if (error) { + mac_cred_label_free(intlabel); + return (error); + } + + *mac_set_proc_data = intlabel; + return (0); +} + +/* + * Actually sets the MAC label on 'newcred'. + * + * The current process' lock *must* be held. This function only sets the label + * on 'newcred', but does not put 'newcred' in place on the current process' + * (consequently, it also does not call setsugid()). 'mac_set_proc_data' must + * be the pointer returned by mac_set_proc_prepare(). If called, this function + * must be so between a successful call to mac_set_proc_prepare() and + * mac_set_proc_finish(), but calling it is not mandatory (e.g., if some other + * error occured under the process lock that obsoletes setting the MAC label). + */ +int +mac_set_proc_core(struct thread *const td, struct ucred *const newcred, + void *const mac_set_proc_data) +{ + struct label *const intlabel = mac_set_proc_data; + struct proc *const p = td->td_proc; + int error; + + MPASS(td == curthread); + PROC_LOCK_ASSERT(p, MA_OWNED); + + error = mac_cred_check_relabel(p->p_ucred, intlabel); + if (error) + return (error); + + mac_cred_relabel(newcred, intlabel); + return (0); +} + +/* + * Performs mac_set_proc() last operations, without the process lock. + * + * 'proc_label_set' indicates whether the label was actually set by a call to + * mac_set_proc_core() that succeeded. 'mac_set_proc_data' must be the pointer + * returned by mac_set_proc_prepare(), and its associated data will be freed. + */ +void +mac_set_proc_finish(struct thread *const td, bool proc_label_set, + void *const mac_set_proc_data) +{ + struct label *const intlabel = mac_set_proc_data; + + PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); + + if (proc_label_set) + mac_proc_vm_revoke(td); + mac_cred_label_free(intlabel); +} + +int +sys___mac_set_proc(struct thread *td, struct __mac_set_proc_args *uap) +{ + struct ucred *newcred, *oldcred; + void *intlabel; + struct proc *const p = td->td_proc; + struct mac mac; + int error; + error = mac_label_copyin(uap->mac_p, &mac, NULL); if (error) return (error); - intlabel = mac_cred_label_alloc(); - error = mac_cred_internalize_label(intlabel, mac.m_string); - free_copied_label(&mac); + error = mac_set_proc_prepare(td, &mac, &intlabel); if (error) - goto out; + goto free_label; newcred = crget(); - p = td->td_proc; PROC_LOCK(p); oldcred = p->p_ucred; + crcopy(newcred, oldcred); - error = mac_cred_check_relabel(oldcred, intlabel); + error = mac_set_proc_core(td, newcred, intlabel); if (error) { PROC_UNLOCK(p); crfree(newcred); - goto out; + goto finish; } setsugid(p); - crcopy(newcred, oldcred); - mac_cred_relabel(newcred, intlabel); proc_set_cred(p, newcred); - PROC_UNLOCK(p); - crfree(oldcred); - mac_proc_vm_revoke(td); -out: - mac_cred_label_free(intlabel); + crfree(oldcred); +finish: + mac_set_proc_finish(td, error == 0, intlabel); +free_label: + free_copied_label(&mac); return (error); } diff --git a/sys/security/mac/mac_syscalls.h b/sys/security/mac/mac_syscalls.h new file mode 100644 index 000000000000..37445eafe364 --- /dev/null +++ b/sys/security/mac/mac_syscalls.h @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Olivier Certner at + * Kumacom SARL under sponsorship from the FreeBSD Foundation. + */ + +/* + * Prototypes for functions used to implement system calls that must manipulate + * MAC labels. + */ + +#ifndef _SECURITY_MAC_MAC_SYSCALLS_H_ +#define _SECURITY_MAC_MAC_SYSCALLS_H_ + +#ifndef _KERNEL +#error "no user-serviceable parts inside" +#endif + +int mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, + char **const u_string); +void free_copied_label(const struct mac *const mac); + +int mac_set_proc_prepare(struct thread *const td, + const struct mac *const mac, void **const mac_set_proc_data); +int mac_set_proc_core(struct thread *const td, struct ucred *const newcred, + void *const mac_set_proc_data); +void mac_set_proc_finish(struct thread *const td, bool proc_label_set, + void *const mac_set_proc_data); + +#endif /* !_SECURITY_MAC_MAC_SYSCALLS_H_ */ From nobody Thu Jan 16 18:08:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSv54TRz5kklr; Thu, 16 Jan 2025 18:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSv2YgKz3RZ3; Thu, 16 Jan 2025 18:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HOOG+/TBIUbNvsoyc/Vm/wnwmrJYeO8TaPatIIEDg70=; b=nkkvnYXAjNNX7GJgEpcfYvX/EcItrVD/66WOeYoEHHYZVvCtWeBBz7olpX5PBCqTTBxVlG GpW1wpvPTX4MRmlE0+7oXAeiGFGx1/76zRSPa1lVBiQ2EQ9aVU5EbYvvO/19mIHXC7tj0Q Kc1joZo1+NQkrft8CxSj/2GgzHVkz8MkJOLauQB3ZwwUSOLI3nTh+KoQfWAjgRnR19pOBM uKGrZyVwqUfGwAmEV/I95x/m/IClShKk1GHzoOR0cgl58hnWegwSJHx/8Xd4aL8svgf/P+ rk4MTJWAVqieoD5hIMEN1DuK21juAOrRU7OM5hSIJtRuFuJKBkYdFYUFmMLFgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HOOG+/TBIUbNvsoyc/Vm/wnwmrJYeO8TaPatIIEDg70=; b=gmAhzfIte3YVRUX11n5onZYvyhCc03hqjRoT7WLGjQG6xLBdX20TBzEkM/+Pi3FBIfcym1 bbx433tTL1GdRQ3J3+jqqN2fDK/JE4BqoJo/NWefL7ihdXLtGWAYqtppWIwnyO3pBLiclb FBm8K3CBwtb/aTaICg0gqLyv55IYlA2DMF30vRlKqy0VPc0F7cY9XvkLrp8mTxRaoiLmxG QKAng+jf2bipUZHpazgPHn8V+VJuzBK59Zt4PsOv5J9w7G5FkfKuy968MquiZ0zbSlRAF9 khI5SQfJ/GN4Mq8F/+L7Y7QjDJoNKZYZKRGz9dIe+lo1q6dexoQQZ+8BSjbh3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050895; a=rsa-sha256; cv=none; b=UKtzh70izVUIPgG4HreQHr4atR8A20ZhzGwew4S4Wj6wo0sG58I/BQApvC7v2dhNWM6NeK jeqcyJMohFMS0HprJjcEwLTJw+lAWKuMLRL0SIw1sZHOrZEfczslwcvB1HnHz8zbH6GJq2 eWorL2ynIYMEzx3MuDUA0wD5Pg+otvI3i/KWJkX5GB+M70nLBl/ikCf+2Oy+1cF6sM0x1U 7bDLKb1cQrj932ePgpO5Xax+U4Jdzoxh6+hhMeBzan0/BWzTSoUpCnArWCXypjYvrfDWx3 51+Yq1qUrBxR/yuuc//9OqYWNx6Z944Ws1WuxjV/cx7vWh6NGMRBTSpB/8a4yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSv1q0hzjbx; Thu, 16 Jan 2025 18:08: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 50GI8FnA091783; Thu, 16 Jan 2025 18:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8F3Y091778; Thu, 16 Jan 2025 18:08:15 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:15 GMT Message-Id: <202501161808.50GI8F3Y091778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f0bd9df3e6ad - stable/14 - MAC: syscalls: Factor out common label copy-in code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f0bd9df3e6ad3687a8d7bd3648d333488a6a1206 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f0bd9df3e6ad3687a8d7bd3648d333488a6a1206 commit f0bd9df3e6ad3687a8d7bd3648d333488a6a1206 Author: Olivier Certner AuthorDate: 2024-07-26 14:40:22 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:56 +0000 MAC: syscalls: Factor out common label copy-in code Besides simplifying existing code, this will later enable the new setcred() system call to copy MAC labels. MFC after: 2 weeks Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46904 (cherry picked from commit 2e593dd3b5e1c515d57b3d3f929e544a6622b04a) --- sys/security/mac/mac_syscalls.c | 201 +++++++++++++++++----------------------- 1 file changed, 83 insertions(+), 118 deletions(-) diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index 56aaba935442..74db8625114e 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -78,26 +78,67 @@ static int kern___mac_get_path(struct thread *td, const char *path_p, static int kern___mac_set_path(struct thread *td, const char *path_p, struct mac *mac_p, int follow); +/* + * Copyin a 'struct mac', including the string pointed to by 'm_string'. + * + * On success (0 returned), fills '*mac', whose associated storage must be freed + * after use by calling free_copied_label() (which see). On success, 'u_string' + * if not NULL is filled with the userspace address for 'u_mac->m_string'. + */ +static int +mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, + char **const u_string) +{ + char *buffer; + int error; + + error = copyin(u_mac, mac, sizeof(*mac)); + if (error != 0) + return (error); + + error = mac_check_structmac_consistent(mac); + if (error != 0) + return (error); + + /* 'm_buflen' not too big checked by function call above. */ + buffer = malloc(mac->m_buflen, M_MACTEMP, M_WAITOK); + error = copyinstr(mac->m_string, buffer, mac->m_buflen, NULL); + if (error != 0) { + free(buffer, M_MACTEMP); + return (error); + } + + MPASS(error == 0); + if (u_string != NULL) + *u_string = mac->m_string; + mac->m_string = buffer; + return (0); +} + +static void +free_copied_label(const struct mac *const mac) +{ + free(mac->m_string, M_MACTEMP); +} + int sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { - char *elements, *buffer; + char *buffer, *u_buffer; struct mac mac; struct proc *tproc; struct ucred *tcred; int error; - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); + error = mac_label_copyin(uap->mac_p, &mac, &u_buffer); if (error) return (error); tproc = pfind(uap->pid); - if (tproc == NULL) - return (ESRCH); + if (tproc == NULL) { + error = ESRCH; + goto free_mac_and_exit; + } tcred = NULL; /* Satisfy gcc. */ error = p_cansee(td, tproc); @@ -105,58 +146,40 @@ sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) tcred = crhold(tproc->p_ucred); PROC_UNLOCK(tproc); if (error) - return (error); - - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - crfree(tcred); - return (error); - } + goto free_mac_and_exit; buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); - error = mac_cred_externalize_label(tcred->cr_label, elements, + error = mac_cred_externalize_label(tcred->cr_label, mac.m_string, buffer, mac.m_buflen); if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); - + error = copyout(buffer, u_buffer, strlen(buffer)+1); free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); crfree(tcred); + +free_mac_and_exit: + free_copied_label(&mac); return (error); } int sys___mac_get_proc(struct thread *td, struct __mac_get_proc_args *uap) { - char *elements, *buffer; + char *buffer, *u_buffer; struct mac mac; int error; - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = mac_label_copyin(uap->mac_p, &mac, &u_buffer); if (error) return (error); - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - return (error); - } - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); error = mac_cred_externalize_label(td->td_ucred->cr_label, - elements, buffer, mac.m_buflen); + mac.m_string, buffer, mac.m_buflen); if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); + error = copyout(buffer, u_buffer, strlen(buffer)+1); free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); + free_copied_label(&mac); return (error); } @@ -167,30 +190,18 @@ sys___mac_set_proc(struct thread *td, struct __mac_set_proc_args *uap) struct label *intlabel; struct proc *p; struct mac mac; - char *buffer; int error; if (!(mac_labeled & MPC_OBJECT_CRED)) return (EINVAL); - error = copyin(uap->mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); + error = mac_label_copyin(uap->mac_p, &mac, NULL); if (error) return (error); - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, buffer, mac.m_buflen, NULL); - if (error) { - free(buffer, M_MACTEMP); - return (error); - } - intlabel = mac_cred_label_alloc(); - error = mac_cred_internalize_label(intlabel, buffer); - free(buffer, M_MACTEMP); + error = mac_cred_internalize_label(intlabel, mac.m_string); + free_copied_label(&mac); if (error) goto out; @@ -224,7 +235,7 @@ out: int sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) { - char *elements, *buffer; + char *u_buffer, *buffer; struct label *intlabel; struct file *fp; struct mac mac; @@ -234,21 +245,10 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) cap_rights_t rights; int error; - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = mac_label_copyin(uap->mac_p, &mac, &u_buffer); if (error) return (error); - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - return (error); - } - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_GET), &fp); @@ -267,7 +267,7 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); mac_vnode_copy_label(vp->v_label, intlabel); VOP_UNLOCK(vp); - error = mac_vnode_externalize_label(intlabel, elements, + error = mac_vnode_externalize_label(intlabel, mac.m_string, buffer, mac.m_buflen); mac_vnode_label_free(intlabel); break; @@ -282,7 +282,7 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) PIPE_LOCK(pipe); mac_pipe_copy_label(pipe->pipe_pair->pp_label, intlabel); PIPE_UNLOCK(pipe); - error = mac_pipe_externalize_label(intlabel, elements, + error = mac_pipe_externalize_label(intlabel, mac.m_string, buffer, mac.m_buflen); mac_pipe_label_free(intlabel); break; @@ -297,7 +297,7 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) SOCK_LOCK(so); mac_socket_copy_label(so->so_label, intlabel); SOCK_UNLOCK(so); - error = mac_socket_externalize_label(intlabel, elements, + error = mac_socket_externalize_label(intlabel, mac.m_string, buffer, mac.m_buflen); mac_socket_label_free(intlabel); break; @@ -306,12 +306,12 @@ sys___mac_get_fd(struct thread *td, struct __mac_get_fd_args *uap) error = EINVAL; } if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); + error = copyout(buffer, u_buffer, strlen(buffer)+1); out_fdrop: fdrop(fp, td); out: free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); + free_copied_label(&mac); return (error); } @@ -333,7 +333,7 @@ static int kern___mac_get_path(struct thread *td, const char *path_p, struct mac *mac_p, int follow) { - char *elements, *buffer; + char *u_buffer, *buffer; struct nameidata nd; struct label *intlabel; struct mac mac; @@ -342,21 +342,10 @@ kern___mac_get_path(struct thread *td, const char *path_p, struct mac *mac_p, if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(mac_p, &mac, sizeof(mac)); - if (error) - return (error); - - error = mac_check_structmac_consistent(&mac); + error = mac_label_copyin(mac_p, &mac, &u_buffer); if (error) return (error); - elements = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, elements, mac.m_buflen, NULL); - if (error) { - free(elements, M_MACTEMP); - return (error); - } - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); NDINIT(&nd, LOOKUP, LOCKLEAF | follow, UIO_USERSPACE, path_p); error = namei(&nd); @@ -365,18 +354,18 @@ kern___mac_get_path(struct thread *td, const char *path_p, struct mac *mac_p, intlabel = mac_vnode_label_alloc(); mac_vnode_copy_label(nd.ni_vp->v_label, intlabel); - error = mac_vnode_externalize_label(intlabel, elements, buffer, + error = mac_vnode_externalize_label(intlabel, mac.m_string, buffer, mac.m_buflen); vput(nd.ni_vp); NDFREE_PNBUF(&nd); mac_vnode_label_free(intlabel); if (error == 0) - error = copyout(buffer, mac.m_string, strlen(buffer)+1); + error = copyout(buffer, u_buffer, strlen(buffer)+1); out: free(buffer, M_MACTEMP); - free(elements, M_MACTEMP); + free_copied_label(&mac); return (error); } @@ -392,24 +381,12 @@ sys___mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) struct vnode *vp; struct mac mac; cap_rights_t rights; - char *buffer; int error; - error = copyin(uap->mac_p, &mac, sizeof(mac)); + error = mac_label_copyin(uap->mac_p, &mac, NULL); if (error) return (error); - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, buffer, mac.m_buflen, NULL); - if (error) { - free(buffer, M_MACTEMP); - return (error); - } - error = fget(td, uap->fd, cap_rights_init_one(&rights, CAP_MAC_SET), &fp); if (error) @@ -423,7 +400,7 @@ sys___mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) goto out_fdrop; } intlabel = mac_vnode_label_alloc(); - error = mac_vnode_internalize_label(intlabel, buffer); + error = mac_vnode_internalize_label(intlabel, mac.m_string); if (error) { mac_vnode_label_free(intlabel); break; @@ -447,7 +424,7 @@ sys___mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) goto out_fdrop; } intlabel = mac_pipe_label_alloc(); - error = mac_pipe_internalize_label(intlabel, buffer); + error = mac_pipe_internalize_label(intlabel, mac.m_string); if (error == 0) { pipe = fp->f_data; PIPE_LOCK(pipe); @@ -464,7 +441,7 @@ sys___mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) goto out_fdrop; } intlabel = mac_socket_label_alloc(M_WAITOK); - error = mac_socket_internalize_label(intlabel, buffer); + error = mac_socket_internalize_label(intlabel, mac.m_string); if (error == 0) { so = fp->f_data; error = mac_socket_label_set(td->td_ucred, so, @@ -479,7 +456,7 @@ sys___mac_set_fd(struct thread *td, struct __mac_set_fd_args *uap) out_fdrop: fdrop(fp, td); out: - free(buffer, M_MACTEMP); + free_copied_label(&mac); return (error); } @@ -505,30 +482,18 @@ kern___mac_set_path(struct thread *td, const char *path_p, struct mac *mac_p, struct nameidata nd; struct mount *mp; struct mac mac; - char *buffer; int error; if (!(mac_labeled & MPC_OBJECT_VNODE)) return (EINVAL); - error = copyin(mac_p, &mac, sizeof(mac)); + error = mac_label_copyin(mac_p, &mac, NULL); if (error) return (error); - error = mac_check_structmac_consistent(&mac); - if (error) - return (error); - - buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK); - error = copyinstr(mac.m_string, buffer, mac.m_buflen, NULL); - if (error) { - free(buffer, M_MACTEMP); - return (error); - } - intlabel = mac_vnode_label_alloc(); - error = mac_vnode_internalize_label(intlabel, buffer); - free(buffer, M_MACTEMP); + error = mac_vnode_internalize_label(intlabel, mac.m_string); + free_copied_label(&mac); if (error) goto out; From nobody Thu Jan 16 18:08:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT01TCzz5kl2s; Thu, 16 Jan 2025 18:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSz5s3cz3RZr; Thu, 16 Jan 2025 18:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uimoa9U4yfMVgQxZFBII0YiqaQkLZQr9msrSKcWkUpo=; b=B6PKHWBpKZ1Q1XH7ajNhdcWMXyHnHpmVbFrKW9A73jSXgXDHwLeGDgYNIdve4GBW5qLaA/ Gpteh/hzeQN32DcosrxKTUJFDTaEnUkZuUHYc+YgYuz06DRxStxC8WyGJLg0gQ94kuF+rx oB+UNrMCkLSFq4bno2OfOgDYsfiKY46Cl2pOCNcAH8m3S/tWwRx0Mg1BAbGr1R110++La4 WxY4Dmw+LsQEtmrxYbFpyPout74AgbcBLOgdvrRSmQwNKtNDDN1hyy7Jd97/V7fxUWAYIC J0YZwShKuGv/Ct6Gqs2rt2NkeOH0GYbGiBRhfGwkW399B7pLzJNJ76JCvLUU1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uimoa9U4yfMVgQxZFBII0YiqaQkLZQr9msrSKcWkUpo=; b=b/XzRxhdypeln6qXO9ZuAbfPKVGPBDz1SInGazcjb+fMTlzg9ZBwDH1qyDubivaVHiv1dH Bc6RrdLShWr6Dt0a+ark5IZ9k9betXeG7uWTR1NAE8+KeCWrObfBfppNJ3QjLjHW4DIJZQ cR3fcPTjCWuSTIw4mtojLIJd5U6LSEBcZA7XaieSI7eUBdPJp8fMZvtaPCJXMFYoEVEIKG tKTXK8fpbl7sou43LBqO3Ah1HiQB3ixLIQSHY2ljVXgVqCSPPPgxuo8VspL22rjKYVKKeb GBWkpD9k9yurGuZ7yjjWjN8dnFF2iJUVFkdfzUlqh4e9RjZwmJIa1psMYhe5og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050899; a=rsa-sha256; cv=none; b=iU9QBk/ODgnINTXcLwdABQ7wLFr33+h18QCSIThQ8rK7oqU+NM0olh7HyppG/xqfsIL4Pz Nw/jco/fFCXJX3LcrFVsnghlmlAe3xgQ/eD3ZCQxToPL+7i3Dc343vCr+yUJBsVZ84ykTl cZ33NBcdkAKK/ITF3X2ihvE0038QN/3H0URjgPdyQVZILJQpM+2+/s2D7pIz9zV1ooy8kp Q+IaThuKe0eJRXTTzOjqakEVL4T8z47I+oQ5+MeCmHql/zslf/iYSiWDGsB01is4kgyO4V dQ6PXDDKh08ao7rBuYASyeXLjZ0Rkgm/+I1ydeAGtQhIMzVXgLRoBGwd1a6HwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSz5G1yzkKg; Thu, 16 Jan 2025 18:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GI8JCt092009; Thu, 16 Jan 2025 18:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8JMG092006; Thu, 16 Jan 2025 18:08:19 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:19 GMT Message-Id: <202501161808.50GI8JMG092006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: aeff6867a4df - stable/14 - mountd(8): parsecred(): uid:gid:... loop: Simplify a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aeff6867a4df37bdb3058aa9530480c59699783a Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=aeff6867a4df37bdb3058aa9530480c59699783a commit aeff6867a4df37bdb3058aa9530480c59699783a Author: Olivier Certner AuthorDate: 2024-09-26 16:16:16 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:57 +0000 mountd(8): parsecred(): uid:gid:... loop: Simplify a bit No functional change intended. Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46919 (cherry picked from commit ae22a4bb7437019e34fc593e101a6ac14c9d7959) --- usr.sbin/mountd/mountd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index fa270f3a42d4..e01140593c11 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3686,7 +3686,9 @@ parsecred(char *namelist, struct expcred *cr) cr->cr_uid = name_ul; } cr->cr_ngroups = 0; - while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) { + while (names != NULL && *names != '\0') { + gid_t group; + name = strsep_quote(&names, ":"); name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) { @@ -3694,13 +3696,16 @@ parsecred(char *namelist, struct expcred *cr) syslog(LOG_ERR, "unknown group: %s", name); continue; } - groups[cr->cr_ngroups++] = gr->gr_gid; + group = gr->gr_gid; } else { - groups[cr->cr_ngroups++] = name_ul; + group = name_ul; + } + if (cr->cr_ngroups == NGROUPS_MAX) { + syslog(LOG_ERR, "too many groups"); + break; } + groups[cr->cr_ngroups++] = group; } - if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX) - syslog(LOG_ERR, "too many groups"); if (cr->cr_ngroups > SMALLNGROUPS) cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); From nobody Thu Jan 16 18:08:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSy0VYxz5kkZq; Thu, 16 Jan 2025 18:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSx42Ctz3RTy; Thu, 16 Jan 2025 18:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHwl0e7rlcS5uSSDm3RqfOCcyDQRlXzpE2X0L93kY38=; b=AfwL4xEy1/wIop3pV243HsWNPnBM45391DWlcm4ZpddU6MZ/dv8cW57b/YS56DeIqPCRf0 5s/Gbyd/yXWa8Maln26gkNdXidYGIYXqmagGWw556ZTckQiIFogAJjhNO2McJTurLU9Zhp pJl6fy+piYwy1haa2OmjvukvsMrSWeThFwAyb2uyq9Dvk2Mjv7fdEOwuC7iyIYVadSrEV7 0jgZE/ayva2HfUA856J+T/NcwwCTqNV6PbRq/e8jZJKN56KL8vLC/3imF1I3WiJ1xNaotL SJ8N7z2ac89sca6UpW2lLI/5LiXN3JiTJ0U8EyUXGqeAdOZYpeCksObv/VGXwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHwl0e7rlcS5uSSDm3RqfOCcyDQRlXzpE2X0L93kY38=; b=R61Il2bzQAR9+OxeidLphWrGWqOe0JAV/X/pSfncrdzGezBE5OSr4GQhnNrdBIgc4CBuZy fdch40or6Jeu/iB+6OzUztcvpKEBubnhGMlKBLly+ux2WQW3xGVeBGgmoGY2EeGJne7GwP rzdjmB9Xh4Wy7qzl8M4nVsvo+99WQ23Wn56zqcsKZ9cTTiOx7ZTYu0DyZhckyw4uumzY+M 17+YCooOgD5KLLxTb91PFcUKxGRqVTkgBaVmEDsmj3rnkt/sPpyVEky8mLs0njx74U57QJ VyrdVcbnIBjpuz71ME0st77iJWk3203zfn/ZKh87e5qyRnV//5b4KsjZ7Qa9wQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050897; a=rsa-sha256; cv=none; b=k5IrC6mIrp/1Vc8ahEXvjoV8A5CWndRlOmuwAI+ag6aosuw2VBGZwsnrwLUdSFXTjKEGGA r9+1DqBA99Lxcn0mj6oayxnHHrwjQILW+Wbaw21kmufmqtQF7aMA5yEvGZ0xueHcdLybE5 CPM/f0B9FYYevzM5Yz3/5ay3EAbbTpmqi1BHZguHxEFefChgPQVV8B6gyxYzCfbcx8269H kOVAN4hvdnXmLBs+SVnJxF2euS1Cincz6kIKypFBCzokn7rNVJCBbeVDidwhSJVXiNiZTM sBOek0/NRU2eSJmmu8U5xWunermngNzpTUBeGOBfy0y8F5AooPKCRMjgchYdfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSx3c4rzkN0; Thu, 16 Jan 2025 18:08: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 50GI8H6k091899; Thu, 16 Jan 2025 18:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8HSq091896; Thu, 16 Jan 2025 18:08:17 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:17 GMT Message-Id: <202501161808.50GI8HSq091896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 731dc8994cc8 - stable/14 - MAC: syscalls: mac_label_copyin(): 32-bit compatibility List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 731dc8994cc8a8bd31fe2cbfca7390fc7b1499bf Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=731dc8994cc8a8bd31fe2cbfca7390fc7b1499bf commit 731dc8994cc8a8bd31fe2cbfca7390fc7b1499bf Author: Olivier Certner AuthorDate: 2024-12-02 10:23:18 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:56 +0000 MAC: syscalls: mac_label_copyin(): 32-bit compatibility Needed by the upcoming setcred() system call. More generally, is a step on the way to support 32-bit compatibility for MAC-related system calls. Reviewed by: brooks Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47878 (cherry picked from commit 3bdc5ba2ac760634056c66c3c98b6b3452258a5b) --- sys/security/mac/mac_syscalls.c | 50 ++++++++++++++++++++++++++++++++++++----- sys/security/mac/mac_syscalls.h | 7 ++++++ 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/sys/security/mac/mac_syscalls.c b/sys/security/mac/mac_syscalls.c index e97a7dc09700..26181781a394 100644 --- a/sys/security/mac/mac_syscalls.c +++ b/sys/security/mac/mac_syscalls.c @@ -46,6 +46,7 @@ #include "opt_mac.h" #include +#include #include #include #include @@ -79,6 +80,13 @@ static int kern___mac_get_path(struct thread *td, const char *path_p, static int kern___mac_set_path(struct thread *td, const char *path_p, struct mac *mac_p, int follow); +#ifdef COMPAT_FREEBSD32 +struct mac32 { + uint32_t m_buflen; /* size_t */ + uint32_t m_string; /* char * */ +}; +#endif + /* * Copyin a 'struct mac', including the string pointed to by 'm_string'. * @@ -86,16 +94,30 @@ static int kern___mac_set_path(struct thread *td, const char *path_p, * after use by calling free_copied_label() (which see). On success, 'u_string' * if not NULL is filled with the userspace address for 'u_mac->m_string'. */ -int -mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, - char **const u_string) +static int +mac_label_copyin_impl(const void *const u_mac, struct mac *const mac, + char **const u_string, bool is_32bit) { char *buffer; int error; - error = copyin(u_mac, mac, sizeof(*mac)); - if (error != 0) - return (error); +#ifdef COMPAT_FREEBSD32 + if (is_32bit) { + struct mac32 mac32; + + error = copyin(u_mac, &mac32, sizeof(mac32)); + if (error != 0) + return (error); + + CP(mac32, *mac, m_buflen); + PTRIN_CP(mac32, *mac, m_string); + } else +#endif + { + error = copyin(u_mac, mac, sizeof(*mac)); + if (error != 0) + return (error); + } error = mac_check_structmac_consistent(mac); if (error != 0) @@ -116,12 +138,28 @@ mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, return (0); } +int +mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, + char **const u_string) +{ + return (mac_label_copyin_impl(u_mac, mac, u_string, false)); +} + void free_copied_label(const struct mac *const mac) { free(mac->m_string, M_MACTEMP); } +#ifdef COMPAT_FREEBSD32 +int +mac_label_copyin32(const struct mac32 *const u_mac, + struct mac *const mac, char **const u_string) +{ + return (mac_label_copyin_impl(u_mac, mac, u_string, true)); +} +#endif + int sys___mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap) { diff --git a/sys/security/mac/mac_syscalls.h b/sys/security/mac/mac_syscalls.h index 37445eafe364..4efeaf300d31 100644 --- a/sys/security/mac/mac_syscalls.h +++ b/sys/security/mac/mac_syscalls.h @@ -23,6 +23,13 @@ int mac_label_copyin(const struct mac *const u_mac, struct mac *const mac, char **const u_string); void free_copied_label(const struct mac *const mac); +#ifdef COMPAT_FREEBSD32 +struct mac32; + +int mac_label_copyin32(const struct mac32 *const u_mac, + struct mac *const mac, char **const u_string); +#endif /* COMPAT_FREEBSD32 */ + int mac_set_proc_prepare(struct thread *const td, const struct mac *const mac, void **const mac_set_proc_data); int mac_set_proc_core(struct thread *const td, struct ucred *const newcred, From nobody Thu Jan 16 18:08:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrSz2KbNz5kkZr; Thu, 16 Jan 2025 18:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrSy4fsHz3RV7; Thu, 16 Jan 2025 18:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1ZkTddVo7sQHYYdPAzIGYMkiy0PnWg5i4+K+8W0lSC4=; b=QCajwdgeoY+ROrJnUieUcLWWOuZ1kKl/sbaRo4aSFMnGdb3h/YE1AS6ZbUGBsUDsXZl/SQ AP4zg6P08sTJ6CrGqXfaAwOEKdASwx3kDxEsIO/IxNLnaBbup4LkhvZMA+uLfDWEJaFmxa f8JAoKCfnNbU1/HufpBey7gYaAsIsy7SoRt3/Mdz2exE8dgCWkw0fa8R4mHqS+Q6UxcK/l 7QUApnVzbawwRGjk52k7TvvdAbYw3L/9L93c4X+au6VV4dfVLSBctdwjynRDWgqm42BZ65 wMzi0W1Nm5LZ+0jB/TFv5gMgvU9o+Xf8GD0Czx4Ob3ueqmImmjjHu7Cz1q72uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1ZkTddVo7sQHYYdPAzIGYMkiy0PnWg5i4+K+8W0lSC4=; b=kKlbLu9sF8BwD0k2J6+NS/l8mGDt3Zf7ohRI1/RPtGk7iPFc59QY6Ym0vEQTtAN4vsEu+Y +0+BRyxnyAj1H0guBrURRY6Rj8D2ZFLZrXNiVE1au3CaSfGFElPaI8+ajK7bfzZSMMi63N VvFlWryh4ii+WwBy1c/meeORdB6Zw70d105BdmOc6hewrF4+FzAuh6X7QXzmd46GaqWQ0B WjqF3/R3GJPANBk9JKUctB9a+PjQ/mWfgvCXH+uj9FfH1lDOH83U2HL6JgmeeT4Qo/nnXu jPG1DBT4NjLSZrBN5tS0YZcw3T/WQ0SBF5XFmL2knnfCfeqqhBpWzR9rnzWHnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050898; a=rsa-sha256; cv=none; b=mYmik3OavZ6JpXTKgpndrBMkiJrW8gHsrR9modeCeFzQfrgonDxUL3JkM9hDKoUxdyLTvT zI8s9ebhIRGC0P35L8ExC4FemcxeerySHXKSPr0/qVm9CEWoqSJbLKdML7pSBUh+9eSsBE WR8DcShhNjz0qFK2j6aaPm3mWJ0pIkq9XY6XwEth9N3M0/QyUnuj5RSYqO25kxzx/25Ar/ NP0wL7Irzp4dDq38KRRQN9HC7m8ygRcOXGV39BuwQMwaixX0ZtW5nh2V4dma7bHXqKuhmJ bDEwlVpf2/j8KpQj3H/51GP+RWijwq3FnisJCmYlTZwvixSUFzKQm5Uybic/gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrSy4F1gzk12; Thu, 16 Jan 2025 18:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GI8IOt091948; Thu, 16 Jan 2025 18:08:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8Ign091945; Thu, 16 Jan 2025 18:08:18 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:18 GMT Message-Id: <202501161808.50GI8Ign091945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6a654950dd5f - stable/14 - cred: crget(): Compute initial 'cr_agroups' with nitems() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a654950dd5ff32efdaeb0f3e622a2f04212c51b Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6a654950dd5ff32efdaeb0f3e622a2f04212c51b commit 6a654950dd5ff32efdaeb0f3e622a2f04212c51b Author: Olivier Certner AuthorDate: 2024-07-16 20:32:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:56 +0000 cred: crget(): Compute initial 'cr_agroups' with nitems() No functional change (intended). Reviewed by: mhorne, emaste Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46910 (cherry picked from commit f5b46856918cc6cc3ea49e3ab95163d318563ece) --- sys/kern/kern_prot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 44a1f26767ed..3510dc16f731 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2119,8 +2119,7 @@ crget(void) mac_cred_init(cr); #endif cr->cr_groups = cr->cr_smallgroups; - cr->cr_agroups = - sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]); + cr->cr_agroups = nitems(cr->cr_smallgroups); return (cr); } From nobody Thu Jan 16 18:08:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT23wXHz5kktl; Thu, 16 Jan 2025 18:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT20f05z3RPX; Thu, 16 Jan 2025 18:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+4yyTVl72b2Fm3bjvMpkDs18T8aq//CxJmENLWptos=; b=EJCeRipBrmh/h84VuFBKc7EkRQrUvURMFRD/i3KpPRAMmYZfIy3zgKc4sws4vzWxSy5VVu 1Xd0YQeLgHsaz4IfkxiG67gPq7P2g07o75TAAELZ+4a8bcNFSbFHeM97ivMQ1P/Q0AjL01 DyiErnt4IJND134cdC5gk27Q5WnTmUjHPOU0ZAHVYYkDpV5uLP0wWzk5AXkW02Vr+YzBNI 1dy/qdoZ8sBUHxD1n2O0g+phjjjYeqZu3i4vw9qPgPy98A4+DyhgZo2PXvrzkKk995JqNi aALRR+e03J/kIEhS6Hj1NzRVDMgAwWeMpYumgxMmKREnOOKc7v/H7fZEoTHd7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+4yyTVl72b2Fm3bjvMpkDs18T8aq//CxJmENLWptos=; b=vmjZfsz7PPYky8BsbxhLu7MIBd6Cvt1CFFloI57ndHF1eD5w9GTYYCp7eUYi1NX6pcTl4a 2sT3h6WdSqmcgYZCkHK7/Py4tOgwrilBiABf08uZ/aalkHpK2KF5bxW++xpHpsEiIdZy22 M5I+qHqg36SlsSrWOcN7iMVR0X/SGX3cX7FWB+/bdxQZsiBeMQnVXhTxlt7CEJ6iEOXleE N+KysFJQVeGyThmVvGS9FkrmDOFL8Tc46VekOgm0y10zYfr3hSi9/F5Iwg0UMej4EYZ6Xw Mo+Hky6+rQ70EeUCLUNoJqrnWktxoVzSrVIR73YjqAFQxv6D2uuy8Wso3RCZkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050902; a=rsa-sha256; cv=none; b=EMXYuwjfpB207wrWtnugufMVQq+IwmpTQEb/YqSIjcpq+2hxroibyWz1wsrVW2NJ6tbe6O 8yLNPdmItoyXJtiy9TsOnLRrC3wxI0ffRw0Ti3SggYMQZRSQfHhakf5yd5F60V5YHaXagU 6pq5mbfgDBit7P+5K1nVkZqeHvmxSb9ZF4CvCu95Ux52NOxoB7jqAWfEme4NX7giQHJWDf cpUym4S0RiDt1NSv+yhhb4TJ1SBVaOZN1T2krl3aucF6s9vlx3jH0FSCdYfn/XYet4OZmW Nqr7B/Zq+0KEGq0SUU3XqXMNkNSWD6l5tYVGJdr4GoGZoLLIK9Q5up1hdcYbPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT206HKzjby; Thu, 16 Jan 2025 18:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GI8Lmw092105; Thu, 16 Jan 2025 18: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 50GI8LsE092102; Thu, 16 Jan 2025 18:08:21 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:21 GMT Message-Id: <202501161808.50GI8LsE092102@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fb651b231863 - stable/14 - mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb651b2318631eeceb08dc8ef88e868887ce362e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fb651b2318631eeceb08dc8ef88e868887ce362e commit fb651b2318631eeceb08dc8ef88e868887ce362e Author: Olivier Certner AuthorDate: 2024-10-08 09:21:17 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:57 +0000 mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP In the 'uid:gid:gid:...' case (for '-maproot' or '-mapall'), if no GID is specified at all (i.e., input is of the form 'uid:', with the colon at the end), mountd(8) would pass credentials with an empty array of groups to the kernel. For security reasons, we have put in place a kernel fallback a while ago, which is to use the single group GID_NOGROUP (see commits cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have at least one group") and 5169d4307eb9 ("nfs: Fallback to GID_NOGROUP on no groups")). Here, as we are in userland, we first try to find the GID number corresponding to "nogroup", and only then fall back to GID_NOGROUP, as nfsuserd(8) does. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47011 (cherry picked from commit bdc259ef382f76b1821d4356049d5b856c42901a) --- usr.sbin/mountd/mountd.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index f7ab5d6d696d..8ee8280b5d67 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -277,6 +277,8 @@ static int xdr_mlist(XDR *, caddr_t); static void terminate(int); static void cp_cred(struct expcred *, struct expcred *); +static gid_t nogroup(); + #define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) static struct exportlisthead *exphead = NULL; static struct exportlisthead *oldexphead = NULL; @@ -1589,7 +1591,7 @@ get_exportlist_one(int passno) anon.cr_groups = anon.cr_smallgrps; anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; - anon.cr_groups[0] = GID_NOGROUP; + anon.cr_groups[0] = nogroup(); exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; @@ -3625,7 +3627,7 @@ parsecred(char *namelist, struct expcred *cr) */ cr->cr_groups = cr->cr_smallgrps; cr->cr_uid = UID_NOBODY; - cr->cr_groups[0] = GID_NOGROUP; + cr->cr_groups[0] = nogroup(); cr->cr_ngroups = 1; /* * Get the user's password table entry. @@ -3694,6 +3696,11 @@ parsecred(char *namelist, struct expcred *cr) } groups[cr->cr_ngroups++] = group; } + if (cr->cr_ngroups == 0) { + /* cr->cr_groups[0] filled at start with nogroup(). */ + cr->cr_ngroups = 1; + return; + } if (cr->cr_ngroups > SMALLNGROUPS) cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); @@ -4079,3 +4086,19 @@ cp_cred(struct expcred *outcr, struct expcred *incr) memcpy(outcr->cr_groups, incr->cr_groups, incr->cr_ngroups * sizeof(gid_t)); } + +static gid_t +nogroup() +{ + static gid_t nogroup = 0; /* 0 means unset. */ + + if (nogroup == 0) { + const struct group *gr = getgrnam("nogroup"); + + if (gr != NULL && gr->gr_gid != 0) + nogroup = gr->gr_gid; + else + nogroup = GID_NOGROUP; + } + return (nogroup); +} From nobody Thu Jan 16 18:08:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT203x2z5kl2y; Thu, 16 Jan 2025 18:08:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT06dMtz3Rb7; Thu, 16 Jan 2025 18:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OGqb5dIkKYsfzBT8lUfFNJDA8E2b5B1QlKGNHITTliQ=; b=nxN9DR+4xFZytpM8f7NFm0vofDpZzKC56pbNRG8b4o6upT5tbwqtG/ism4xQS51BBHTxFr ZhzpLET04Gt9s+hkLrpTr/Ft9KkSSf5JbSm2ZFKu/OT1iGI/yqUi3FG1fKx+ND9WpyVHDd ORkcjxsuHq1y7Qp8OxLw/iC+/6TdOV0hjsF/Qr3/OCDYMxy1ycOZcAYLlTFKZiwcXH8Myh IeKMhR4WuecmgO/bVEHRYy+i7kOqHz+6dCVW+mKPuaqtBKYI+JRngikOYtoqe1UGwA8kjG r9IRy5HKdWV9dSm/5exXeIPhe5lBPOjdcRk+i3dRRmmfH1SE0owW5X+J3JK7qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OGqb5dIkKYsfzBT8lUfFNJDA8E2b5B1QlKGNHITTliQ=; b=FXvRi25PP/OCykliSELxQ0+xy3/KIQrQK/RJOnWXgCIUsPvliLTtpWM9WULoAGj2jJsxPB FG7rjQ5KJ6OjHRUyb92dhvCwhcr5kYkr2InkNx6aUxqKy8r/wyrYbr/0RZGypnaNKkmbqF PzBVFRdvJvpfDbKuY2z7g1NLcH0pLOVqKHoqoNwG8oedRiQ4qBQwBbpbEcHQnpow4Gaccy RHFYhxxV9/s015D7USQRzt8Tzx32ip6haKzYsQRRkpSR9gn3BupEsrCh3LDdbIL8AgmlQu igCCqGuxlP/LOw+OIugtX+QvnutuEO+CIY0d70h0vd9KDeqZakJ1xvjWoF590A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050900; a=rsa-sha256; cv=none; b=aYZX3PcDb+lOU7YZ/6ExajznIeyK/wzXsIFrywrtm8ikO8WEnTDBdCa2PwKm02HEdVIr3T a98Ld3ho4exyAzj6ucceOOo9WXi5tcXYfIue5KsBR12D7+VPvjcw2M3pNlCmB/dDxWrr+M mtOg1bytKPjNqnJ+koU3BIP3WIwtKgPtSP04T9RqOhcOX/U0xrPlvVRB5cqOrFERxim9mo cVFUAPxx7FiiufW2ei/S7tAWRnz7ikiymxJF8Jmtjo4PO35v7C9wgmOkE/H5Rm09uZgha4 L2TrBhwbznK/akKDe0TVRIwG+va6EsGvj6j8N95kUZqlvKgygMNJsQNpQnToZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT06DDfzkKh; Thu, 16 Jan 2025 18:08: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 50GI8KD4092057; Thu, 16 Jan 2025 18:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8Kms092054; Thu, 16 Jan 2025 18:08:20 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:20 GMT Message-Id: <202501161808.50GI8Kms092054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: a633b10e3d85 - stable/14 - mountd(8): parsecred(): Remove "duplicate compression" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a633b10e3d85345cfc80c1043825fa440fbc5753 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a633b10e3d85345cfc80c1043825fa440fbc5753 commit a633b10e3d85345cfc80c1043825fa440fbc5753 Author: Olivier Certner AuthorDate: 2024-09-26 17:00:26 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:57 +0000 mountd(8): parsecred(): Remove "duplicate compression" No functional change (intended). This code dates back to 4.4BSD, became wrong after some getgrouplist() (nssswitch-related) change in 2007, was fixed only in 2020 and since then underwent cosmetic changes. It is likely that in fact it never served any useful purpose in FreeBSD, except perhaps at the very beginning. It's most probably not the case today: NFS credentials are normally only used to check for file accesses, whose group is checked against all groups of a credentials indiscriminately (except for the real GID). Consequently, having a single duplicate, which the code would actually remove only if in the first supplementary group slot, doesn't change behavior. Moreover, we are going to regain one slot in a subsequent commit. Discussed with: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46920 (cherry picked from commit f2d2318fafbb16c8a7773fe20c724c986f424fa2) --- usr.sbin/mountd/mountd.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index e01140593c11..f7ab5d6d696d 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3612,7 +3612,6 @@ static void parsecred(char *namelist, struct expcred *cr) { char *name; - int inpos; char *names; struct passwd *pw; struct group *gr; @@ -3654,23 +3653,12 @@ parsecred(char *namelist, struct expcred *cr) ngroups = NGROUPS_MAX + 1; } - /* - * Compress out duplicate. - */ - if (ngroups > 1 && groups[0] == groups[1]) { - ngroups--; - inpos = 2; - } else { - inpos = 1; - } if (ngroups > NGROUPS_MAX) ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) cr->cr_groups = malloc(ngroups * sizeof(gid_t)); cr->cr_ngroups = ngroups; - cr->cr_groups[0] = groups[0]; - memcpy(&cr->cr_groups[1], &groups[inpos], (ngroups - 1) * - sizeof(gid_t)); + memcpy(cr->cr_groups, groups, ngroups * sizeof(gid_t)); return; } /* From nobody Thu Jan 16 18:08:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT35Vx7z5kktp; Thu, 16 Jan 2025 18:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT31hxmz3RkY; Thu, 16 Jan 2025 18:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=89qv+IAs8kR1jlKRLCHNB2e07QZt3B4Q3hWC77H95ok=; b=RfwoFcyr6oQKOUOu9wjVf5fwRSvEigkvZxoagDk8qt3DkX8K2PTZ6sMnjR9TbuuCKox9Yx VH9diU2QHsYLPZqgwhPjQbi1JF2w5utXYvc4eDiHxSNEFZvXdRD/FpqBcZ2iJbmySyriOH iTjhpZYRdhjn6dHuvAyTJG0CMOK9vRZEoOhRzE7bJH8fHOTcw/FwUiHmXqBC5PTdFZlgab RNR74Az+0jDoUlnvgGR7LETmE0PkPzirAPNZvGQ1BhJa6JELg0/7b1bzQwBhh31cJu8s0Y er/bt3D1Qhm1wM8Kov0tWKv5ixbu8QlPCQgg5KQ5Geea+IdF+O5rbDyqTNWuHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=89qv+IAs8kR1jlKRLCHNB2e07QZt3B4Q3hWC77H95ok=; b=RQfkrft2V57yl2q7eg3dK+0ADjTQDiPawU5OV1eX5GYrAMWF/51gUe+KQZTZzJIY8Ca3rP YPlOUD22oGJLqtgOafVigiwYQqI+x0v5z4/vaTt+deixq4e9BQCscHVnjCrYqkN9r/5HLT bU+MUfnNwsqQvchDxuXn99tyPGL7bmFteRO0hSzeBEJfHkgXQ3mTXO+hiJrp2Cf0GI8BM7 6WONLwKRNPbuv/WkM18Ks/k9alFYOlxTD1+KA8pxIZIJzMIG3Pk7ZWpKhlF9DeLtQaH8Yz F+JICZV4T+8k62WOAxlWIzy64ndFhLGpCzRobJDuP8K6UmpOqn7D5sNAssvaqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050903; a=rsa-sha256; cv=none; b=aOfsGse3sy0varUh0WL0e3dMGGcPOWPnTmMJ4+kETdHAOhjk+6e+rmKRp4YKebLrT1C0vC LPVkPtfY3u+6pMU1Vmmfkvz6pukGEEfUKtl68kNwRMTV22vsg0xUnZticgRZuqs0U9CaHF bQk0y/q2h6XRXMo+uwXPjia/KUOzqKPUJTPv1qUSHeI/nP7qKhFhDYfQMtBtLIP6hP7SvW VHCFCAAca3bXdJ0to3cHQmF5d+C77JPCO4rqxGJR6P4+KBGUUv8cwRmyOVojM+unugaWF3 bNLT9lHh3lDqtx5ggcYTFIRaPXuDRqWyxNETwz+aRDZq7xNiSv68ByzSnJ/ukw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT310srzk13; Thu, 16 Jan 2025 18:08:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50GI8NT3092163; Thu, 16 Jan 2025 18:08:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8Nam092160; Thu, 16 Jan 2025 18:08:23 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:23 GMT Message-Id: <202501161808.50GI8Nam092160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b82144e708d6 - stable/14 - exports(5): -maproot, -mapall: Explain the fallback on no group List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b82144e708d6c302e70d609a301b99795674cf69 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b82144e708d6c302e70d609a301b99795674cf69 commit b82144e708d6c302e70d609a301b99795674cf69 Author: Olivier Certner AuthorDate: 2024-10-08 09:34:44 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:57 +0000 exports(5): -maproot, -mapall: Explain the fallback on no group Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47012 (cherry picked from commit 2ef608de90629df37c29043afc638f8ff99ecfc4) --- usr.sbin/mountd/exports.5 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index c3a6af5a9f0e..6c18e910c116 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd April 16, 2024 +.Dd October 08, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -172,8 +172,23 @@ The user string may be quoted, or use backslash escaping. The colon separated list is used to specify the precise credential to be used for remote access by root. The elements of the list may be either names or numbers. -Note that user: should be used to distinguish a credential containing -no groups from a complete credential for that user. +Note that +.Cm user: +should be used to specify a credential containing no groups, in which case the +established credential will use +.Ql nogroup , +else 65533 +.Pq Dv GID_NOGROUP , +as the fallback group +.Pq a credential object must have at least one group internally . +Using just +.Cm user +.Pq without colon at end +falls into the +.Sm off +.Fl maproot Li = Sy user +.Sm on +case described above. The group names may be quoted, or use backslash escaping. .Pp .Sm off From nobody Thu Jan 16 18:08:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT44hpDz5kkm5; Thu, 16 Jan 2025 18:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT4278Vz3Rkh; Thu, 16 Jan 2025 18:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eu46sXwIH5XNLfwkBTs1YmP+Cz6NnP0Z7mshCJtt69w=; b=niGxpK+q2qrihropIyWnrWWxheXB+Gmwl+aqpn4VhZXi6Bi1YDqVWIiE0e2pqnm4gObleS XpJA3zI7RW1hcpAXII4aYQikmFVyv/HdWlq8X5mR5vxHj/E6t+d7elgc5P5oFPJeht06oT N+ZDmLtYbdvVmGg/nUpjkoxj2pBbaYEeMuQT/RWUpTDnkS24zP5iYErGo/lSpRbinNVvMC WvoTGF4gLMFR66tCuG/n5Puk0Z98glsTla+jfAR7aIg8GeYWS+hdOriwProtFt3jhUJMc5 gn8r3BQOpiPCcxHBxSX7sfLvx0XdCHKmqViykR9yVRucr5qsao14piGwzVPz2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eu46sXwIH5XNLfwkBTs1YmP+Cz6NnP0Z7mshCJtt69w=; b=diYeoHnmcUjZTw8Jc5sp+Z57Nh0IApMueJCiPmOsHPuv8IRHZhRb3C7ErAj8xgLifYl0U0 7bolKi/OfM2s3x6Wd6cMS4IC1B13A1Rq5gd+QZSqHSTOBL0mU5a2eopbviw6socFP5etMo xqgHAUoYGvkbD1GI5Ddd3ehPRqKcQm3tengucGd4bYK//3ah1B+21NvtR+iPHjGLU+o8jQ e6mDjX7s08DId85eYZedJP19odeBNIhjJVdab56yIZJ3lnVPauWf//MR6a89e4PH+6YKne 3IcZRwMbUjhMT0vuZiyHmu88myEDD2AussrdjW3mLb3ZQmfhTUS/pgUdls1RQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050904; a=rsa-sha256; cv=none; b=DbvOR48dOaped7AGUl0R10jNJuiDK5rBpZrxbwtsYM6ZVKG2NHIdXpBcviOUFljNjNVyJt Ro4AizFvlhlrtkNPhxj4gKXFeb9IXufqZrSitwqIxcRyb7iUkWIQzWnCIoiq0Gei90MnZo yQ8PebxaFqstYif9148TyeC44P4Jv0OeE3UCAPYZP2O+JgLLn7WklnZu9r2hS9bEBzcj40 y6FIl7X9nJlaMPVNVprSgGU1tZChcarLjmkNHz1BwB5dG/ELRPArCLA1LyBiJR2fGSrhPB OOH4mIxfvSnyFE3V5nEFgtIQ0PwLklYOFeupRe4aR9MKweIx3WP2leuoO7BiYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT41kfFzkKj; Thu, 16 Jan 2025 18:08: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 50GI8OYs092219; Thu, 16 Jan 2025 18:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8OhK092216; Thu, 16 Jan 2025 18:08:24 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:24 GMT Message-Id: <202501161808.50GI8OhK092216@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 3f0b888ae3d0 - stable/14 - mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3f0b888ae3d0b3a9bf520af9a5708d271a9198f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0b888ae3d0b3a9bf520af9a5708d271a9198f8 commit 3f0b888ae3d0b3a9bf520af9a5708d271a9198f8 Author: Olivier Certner AuthorDate: 2024-10-03 14:49:40 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:58 +0000 mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1 Lift this unnecessary limitation. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46921 (cherry picked from commit 7f7f3b6cafac6e8ab993a14386e34991224f86f3) --- usr.sbin/mountd/mountd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 8ee8280b5d67..55db501332bf 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3655,8 +3655,6 @@ parsecred(char *namelist, struct expcred *cr) ngroups = NGROUPS_MAX + 1; } - if (ngroups > NGROUPS_MAX) - ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) cr->cr_groups = malloc(ngroups * sizeof(gid_t)); cr->cr_ngroups = ngroups; @@ -3690,7 +3688,7 @@ parsecred(char *namelist, struct expcred *cr) } else { group = name_ul; } - if (cr->cr_ngroups == NGROUPS_MAX) { + if (cr->cr_ngroups == NGROUPS_MAX + 1) { syslog(LOG_ERR, "too many groups"); break; } From nobody Thu Jan 16 18:08:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT572GZz5kktt; Thu, 16 Jan 2025 18:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT53Sqtz3Rrt; Thu, 16 Jan 2025 18:08:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wFqvxJsurgCMGxUvWs464Ypc7esd5+73eePteIuqPc=; b=O3zH1MdNmNMiytNbS1NcKTtES36+MB+tA6nAJRa55pt+ozBxvh2ESWTX3RPpGpGPLiV5F8 iwHk1AzrOoKcrYMcdI3U999XMAyIaFlZGqaSOapjDdlyhLH2XAgHcqQjKhF3mqaXef/cEz ukkTpaNkvQlmopJ/IMp6mht7WA3dgGdgxhcAYQIoPHpH9/0mKvkrGexDOit3kytTYJWnnn ZT+wnki9gRdF6GkhYoPmtwks8lcHREZk8kmZDdEoahI8g0CDV5prRQn1+h4x7gP6Ai+Ev+ +6VCy/SwTO1nRXtsdvcZcDSbE+IV62+P7Xq3A1xDyAoWroEHTQwUGXnppm872A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wFqvxJsurgCMGxUvWs464Ypc7esd5+73eePteIuqPc=; b=gVxeQ2bHwaEf1bRyd/i2oeF2gSGUZuM+hlrr7Qrc4nRp57AVMV6dDSqBAxlF07kqARDkLz 9+LdOI1n6u2MiBfFw19cmuKRCOyJnS45lm7DodrUZ1Zo23YW/eb9Uf368galaTZEOVVc9s wE/+vosgnOObC7WF6YmCrZ8DteGpuNoBKvxP6Wam9Sr/OGLYg/b/hguDdL04+ecm9t06eg A30CareZNM7Yhc56UPE4sBlp4ttG+17/B1sDjtxaevWhoG1eh2XYyr7gsWu/NcNDL7Ramu 2//hNU/5VQrhi4GuaiVIwENAfD6e+EHaaMUSMF/4SEz4LqM5N08QjCAgUelaVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050905; a=rsa-sha256; cv=none; b=ZG3z8q96V1fipi7ReHBhXav/WOfwn53hBuDsHynQoxK4bhAbl/NYCYBVbXh0W+0u6Kzhmo ukwKZTBX3BSNUUNV07mzofMbyT2OZO8QtPHwB7ENZRY/FV/TcW4CWvTPOCSMzXJROvyuax sF1gU+gt84PpGowBgzwkpgJsEq24ixs5QcRvuzdrL41mLNgageLARMi7PjBGDJofCfY6pY k34tfvcfaY6m62dZBmXnSrXnNilhVf6hEGxzyZsI8ebvN880XIKZSL0rSOkQz+Y0qnhwZ+ jgkzc+q3jRtfnSyZUOElZ2ld8FI7tRFqDhbGSo7mzcOneweceGHxKkBm5Sm0ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT534VqzkN1; Thu, 16 Jan 2025 18:08: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 50GI8P1a092284; Thu, 16 Jan 2025 18:08:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8Pcv092281; Thu, 16 Jan 2025 18:08:25 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:25 GMT Message-Id: <202501161808.50GI8Pcv092281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: d8b77cc05ab2 - stable/14 - nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8b77cc05ab25500636d0d34f10a8a9091778914 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d8b77cc05ab25500636d0d34f10a8a9091778914 commit d8b77cc05ab25500636d0d34f10a8a9091778914 Author: Olivier Certner AuthorDate: 2024-10-08 09:39:08 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:58 +0000 nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials There is no technical reason to limit that to NGROUPS_MAX, which is off by one and just our minimum maximum value. Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47013 (cherry picked from commit 84337218786b13f0ebfa834d28de41dce02bc937) --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 206618b4ac6b..1990f3714ab6 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1498,7 +1498,7 @@ vfs_domount_update( bcopy(bufp, &export, len); grps = NULL; if (export.ex_ngroups > 0) { - if (export.ex_ngroups <= NGROUPS_MAX) { + if (export.ex_ngroups <= ngroups_max + 1) { grps = malloc(export.ex_ngroups * sizeof(gid_t), M_TEMP, M_WAITOK); export_error = copyin(export.ex_groups, From nobody Thu Jan 16 18:08:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT704rXz5kkq5; Thu, 16 Jan 2025 18:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT64nSmz3Rdd; Thu, 16 Jan 2025 18:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OHmadE6YVBYhbQZPak0ioc4haq/k6JYZ0AK0oYUxHBs=; b=mp0/ItfM2UtcbZry1pIKVpta90KKjwTKaqpiqVM86jvWEu+ekGTHvfVPL05BCJnDvwROfW W1mqYYIDaK/MQ34Z71/6Lym+qGBcYMgbwsZJZEaP0nxeJSZKS1P8nCeOPKB+iPhfmPALPK K2gz3pGZ6pvPYmbRPKTX5Y02xutCRRTCdLF++lMFiUY5GmHeIkwQfXNni7rfyjxa3U76sR qX+cTPJdAtwWpJVozp/nHfbYVF3hubNcGUK/Tl9iNLSVK7jdWlRzhDwHJU5j0+Qp5W3BZd 1uxmY17Bu5l0sN3/xfSazjxLM5IGoPZ/rqiXnzb1k9307fJ87/cvUYARTovf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OHmadE6YVBYhbQZPak0ioc4haq/k6JYZ0AK0oYUxHBs=; b=KAr6QZ2DVsX+nxmOv7FuhPJTm/bWHo9q2JerQcau5WVd1SBY5dA0vLuR6hsYizQhQkeJML NxlQWlfBt8jBOOCwJNmNVgur87hrxfGgobHpEUn0EmZFovHFcFR7g1WpLWBICN026r4aVn SJedtUyBOFeR5ztAvwo5TthnGRjV2HwTHoaIEPkXBe3Asstjuee5vRx6ZqWmo74YhpPCVQ B58sMqZzK7/g1G82VjVr7fex744BV6nvfHNyqAsRwtvTvysLPBt7GZrGxTZirajwSYmE5N N3w0x0z1zgSvciQyzEzvrjX8dOksDInZvrTodL/n+O5hGkhziLVF+8FYUyx0Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050906; a=rsa-sha256; cv=none; b=FlrJHlxD+DJwymuKDmDz39Wv1REGbOe6nUhK1DD9G4oIz8Siut4UgoKsCAmJc2Nz6DIc7q Y51RTX0FeBhJ84bjf+XJ+0uTup1Q1Htmxy7XKzJE6Qc17KNMHQvI28yT62ZojTtR+RqfjW ozXcDraNWrikqMh8HGOrCCjwihkIkjFNWX7w9Zq7BQIbnKbdFJY9EDgjHZMEi1hiK/3hVh H7uqCkHG5MwN7FK1EJLvDdMV6qMfh8qo57jgRmiwxnNZfz26m/hgTMzpaqUUgbQRLY68dO ooxdZ60zzah5k3/ab4codhDfK4yCfXBy32O4Wy/3P4b+q3CAVis6ARbKwrYYcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT6455xzjs1; Thu, 16 Jan 2025 18:08: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 50GI8QMX092338; Thu, 16 Jan 2025 18:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8QOY092335; Thu, 16 Jan 2025 18:08:26 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:26 GMT Message-Id: <202501161808.50GI8QOY092335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 42a885e6907c - stable/14 - mountd(8): parsecred(): Remove comment on non-existent bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 42a885e6907c44afd0d848c6f5c37f58f108e029 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=42a885e6907c44afd0d848c6f5c37f58f108e029 commit 42a885e6907c44afd0d848c6f5c37f58f108e029 Author: Olivier Certner AuthorDate: 2024-10-08 09:44:06 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:58 +0000 mountd(8): parsecred(): Remove comment on non-existent bug 'name' can never be NULL, as it is equal to 'names' and 'namelist', which was passed by do_cred() only if the actual parameter wasn't NULL. Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47014 (cherry picked from commit 0b011b5cddb5b17cf5b8f50ff580f3eb4abaeeef) --- usr.sbin/mountd/mountd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 55db501332bf..efc6e0ef6730 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3634,7 +3634,6 @@ parsecred(char *namelist, struct expcred *cr) */ names = namelist; name = strsep_quote(&names, ":"); - /* Bug? name could be NULL here */ name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) pw = getpwnam(name); From nobody Thu Jan 16 18:08:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTC2Rhzz5kksd; Thu, 16 Jan 2025 18:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTC18nyz3RhS; Thu, 16 Jan 2025 18:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWzCOOpCKArjYDfX1tpj0fbSL38UCi0ErbCwHNTZO6U=; b=C6mF28nreHpoz05XhKgxxOV9j/HWM4UCY4OQeEtiVw+EHUVSS2ODkRsF8kO3IjZFdWl92W seNNjWDe4u5XGK1Jgg/IpYQwqYarEnjrTgqm1vMrntjyrcfFWKz16QUf66d0MIk+4k+E9F HCjAYjig48ZvHeKWc6MdfotbnB+17UakchP2SZOlSJjR5jFEIlqtnNPFl3F/6yKZmTgx/u w9xXoT8z+dsrAEu1fg5Y+oUCbSgThFtkcvuEFq1Fq5fAz7cha/AwnXXV7aPnlFPQlQirqm c4EhY0YMWhccbS+7LXOT5d1veh0yCPugRx8p5touKgAThXqHRXxZatME+V9UDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BWzCOOpCKArjYDfX1tpj0fbSL38UCi0ErbCwHNTZO6U=; b=E7tRJYiyJ6nBBpMgvQVQDLtCVtq0FClWgwqKj7UYfylRJAKrUP1ijzFYleZfx2m86wLmK/ FyJ/bwE7/RU4+uULm0Gik2FHjUjWqqepHw15r1tLTUKu1N6rt2jTmhn7NAUga8hZ0bGrqS N2c0aGd8Jr/T/r2yxDxrLDSDJjipf+8Lk/jINOdwLeRZJ6b7dHGK00d9rxe0OyGE7XCLf5 DQpezDRUE0pl+gfpNt5Kl2q9CLQhjsymlY/HufhHwvAO0YcOgWXwzkyrNcz87PY8LtgRJ6 JkiQui0YMQB8hdrCwe1aa42iyE0nQ6JBE8SQxEgxhgnQnmwIZuRicL23hdEusw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050911; a=rsa-sha256; cv=none; b=TbLa1u41PM8fUvb0Ialeh0nuCNSHdu63Oh3NHQpwYfqcZeH7C+EYaoz4aXlTzsRdr9wLUL mhrd7STBbCqtI+1darVjw6IRaskPaeqBSmDLyRcCM2fFuh5hh+OSQy92SdSmT3QAI4Rv7J /nI1ArgjZp/5YsaWvdaGZvuDD3vvJzpCQ52klIsA1k8ovWav2UOVcahyFHcoyfmi1pnP/U mAIThp7l1MLLBzLV51zLavD160RXtIV0/OBsMTnbkU0SqB5kXMnqsjOZMf+gyq6VoHbgFZ b29GAs15quTiI9f0yxOHSYUVaCS8+fjKHmdmt552lJzbh2dmc0/jMUU7zY4BwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTC0TBzzjs2; Thu, 16 Jan 2025 18:08: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 50GI8UrV092531; Thu, 16 Jan 2025 18:08:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8UE7092528; Thu, 16 Jan 2025 18:08:30 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:30 GMT Message-Id: <202501161808.50GI8UE7092528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b6c9ff04fcb4 - stable/14 - cred: proc_set_cred(), proc_unset_cred(): Update user's process count List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b6c9ff04fcb4147f8071f421aa33099eaabe371a Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b6c9ff04fcb4147f8071f421aa33099eaabe371a commit b6c9ff04fcb4147f8071f421aa33099eaabe371a Author: Olivier Certner AuthorDate: 2024-08-02 15:57:51 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:59 +0000 cred: proc_set_cred(), proc_unset_cred(): Update user's process count As a process really changes credentials at the moment proc_set_cred() or proc_unset_cred() is called, these functions are the proper locations to perform the update of the new and old real users' process count (using chgproccnt()). Before this change, change_ruid() instead would perform that update, although it operates only on a passed credential which is a priori not tied to the calling process (or not to any process at all). This was arguably a flaw of commit b1fc0ec1a7a49ded, r77183, based on its commit message, and in particular the portion "(...) In each case, the call now acts on a credential not a process (...)". Fixing this makes using change_ruid() more natural when building candidate credentials that in the end are not applied to a process, e.g., because of some intervening privilege check. Also, it removes a hack around this unwanted process count change in unionfs. We also introduce the new proc_set_cred_enforce_proc_lim() so that callers can respect the per-user process limit, and will use it for the upcoming setcred(). We plan to change all callers of proc_set_cred() to call this new function instead at some point. In the meantime, both proc_set_cred() and the new function will coexist. As detailed in some proc_set_cred_enforce_proc_lim()'s comment, checking against the process limit is currently flawed as the kernel doesn't really maintain the number of processes per UID (besides RLIMIT_NPROC, this in fact also applies to RLIMIT_KQUEUES, RLIMIT_NPTS, RLIMIT_SBSIZE and RLIMIT_SWAP). The applied limit is currently that of the old real UID. Root (or a process granted with PRIV_PROC_LIMIT) is not subject to this limit. Approved by: markj (mentor) Fixes: b1fc0ec1a7a49ded MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46923 (cherry picked from commit d2be7ed63affd8af5fe6203002b7cc3cbe7f7891) --- sys/fs/unionfs/union_subr.c | 6 ---- sys/kern/kern_exit.c | 10 ++---- sys/kern/kern_fork.c | 2 +- sys/kern/kern_prot.c | 81 +++++++++++++++++++++++++++++++++++---------- sys/sys/ucred.h | 5 +-- 5 files changed, 71 insertions(+), 33 deletions(-) diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index ae2d417758f0..c294e9b70ad9 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -884,11 +884,6 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp, /* Authority change to root */ rootinfo = uifind((uid_t)0); cred = crdup(cnp->cn_cred); - /* - * The calls to chgproccnt() are needed to compensate for change_ruid() - * calling chgproccnt(). - */ - chgproccnt(cred->cr_ruidinfo, 1, 0); change_euid(cred, rootinfo); change_ruid(cred, rootinfo); change_svuid(cred, (uid_t)0); @@ -958,7 +953,6 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp, unionfs_mkshadowdir_abort: cnp->cn_cred = credbk; - chgproccnt(cred->cr_ruidinfo, -1, 0); crfree(cred); return (error); diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index f9445a481d92..788b58da450d 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1001,11 +1001,6 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) ruadd(&q->p_stats->p_cru, &q->p_crux, &p->p_ru, &p->p_rux); PROC_UNLOCK(q); - /* - * Decrement the count of procs running with this uid. - */ - (void)chgproccnt(p->p_ucred->cr_ruidinfo, -1, 0); - /* * Destroy resource accounting information associated with the process. */ @@ -1019,9 +1014,10 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) racct_proc_exit(p); /* - * Free credentials, arguments, and sigacts. + * Free credentials, arguments, and sigacts, and decrement the count of + * processes running with this uid. */ - proc_unset_cred(p); + proc_unset_cred(p, true); pargs_drop(p->p_args); p->p_args = NULL; sigacts_free(p->p_sigacts); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 8054f93c2c9d..8f11bc246593 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1098,7 +1098,7 @@ fail0: #endif racct_proc_exit(newproc); fail1: - proc_unset_cred(newproc); + proc_unset_cred(newproc, false); fail2: if (vm2 != NULL) vmspace_free(vm2); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index bf026593a3ee..7c5ce97fef93 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -568,7 +568,7 @@ sys_setuid(struct thread *td, struct setuid_args *uap) #endif { /* - * Set the real uid and transfer proc count to new user. + * Set the real uid. */ if (uid != oldcred->cr_ruid) { change_ruid(newcred, uip); @@ -594,6 +594,9 @@ sys_setuid(struct thread *td, struct setuid_args *uap) change_euid(newcred, uip); setsugid(p); } + /* + * This also transfers the proc count to the new user. + */ proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); @@ -2279,31 +2282,76 @@ cru2xt(struct thread *td, struct xucred *xcr) /* * Change process credentials. + * * Callers are responsible for providing the reference for passed credentials - * and for freeing old ones. + * and for freeing old ones. Calls chgproccnt() to correctly account the + * current process to the proper real UID, if the latter has changed. Returns + * whether the operation was successful. Failure can happen only on + * 'enforce_proc_lim' being true and if no new process can be accounted to the + * new real UID because of the current limit (see the inner comment for more + * details) and the caller does not have privilege (PRIV_PROC_LIMIT) to override + * that. */ -void -proc_set_cred(struct proc *p, struct ucred *newcred) +static bool +_proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) { - struct ucred *cr; + struct ucred *const oldcred = p->p_ucred; - cr = p->p_ucred; - MPASS(cr != NULL); + MPASS(oldcred != NULL); PROC_LOCK_ASSERT(p, MA_OWNED); KASSERT(newcred->cr_users == 0, ("%s: users %d not 0 on cred %p", __func__, newcred->cr_users, newcred)); - mtx_lock(&cr->cr_mtx); - KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p", - __func__, cr->cr_users, cr)); - cr->cr_users--; - mtx_unlock(&cr->cr_mtx); + KASSERT(newcred->cr_ref == 1, ("%s: ref %ld not 1 on cred %p", + __func__, newcred->cr_ref, newcred)); + + if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) { + /* + * XXXOC: This check is flawed but nonetheless the best we can + * currently do as we don't really track limits per UID contrary + * to what we pretend in setrlimit(2). Until this is reworked, + * we just check here that the number of processes for our new + * real UID doesn't exceed this process' process number limit + * (which is meant to be associated with the current real UID). + */ + const int proccnt_changed = chgproccnt(newcred->cr_ruidinfo, 1, + enforce_proc_lim ? lim_cur_proc(p, RLIMIT_NPROC) : 0); + + if (!proccnt_changed) { + if (priv_check_cred(oldcred, PRIV_PROC_LIMIT) != 0) + return (false); + (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); + } + } + + mtx_lock(&oldcred->cr_mtx); + KASSERT(oldcred->cr_users > 0, ("%s: users %d not > 0 on cred %p", + __func__, oldcred->cr_users, oldcred)); + oldcred->cr_users--; + mtx_unlock(&oldcred->cr_mtx); p->p_ucred = newcred; newcred->cr_users = 1; PROC_UPDATE_COW(p); + if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) + (void)chgproccnt(oldcred->cr_ruidinfo, -1, 0); + return (true); +} + +void +proc_set_cred(struct proc *p, struct ucred *newcred) +{ + bool success = _proc_set_cred(p, newcred, false); + + MPASS(success); +} + +bool +proc_set_cred_enforce_proc_lim(struct proc *p, struct ucred *newcred) +{ + return (_proc_set_cred(p, newcred, true)); } void -proc_unset_cred(struct proc *p) +proc_unset_cred(struct proc *p, bool decrement_proc_count) { struct ucred *cr; @@ -2318,6 +2366,8 @@ proc_unset_cred(struct proc *p) KASSERT(cr->cr_ref > 0, ("%s: ref %ld not > 0 on cred %p", __func__, cr->cr_ref, cr)); mtx_unlock(&cr->cr_mtx); + if (decrement_proc_count) + (void)chgproccnt(cr->cr_ruidinfo, -1, 0); crfree(cr); } @@ -2602,8 +2652,7 @@ change_egid(struct ucred *newcred, gid_t egid) /*- * Change a process's real uid. * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo - * will be updated, and the old and new cr_ruidinfo proc - * counts will be updated. + * will be updated. * References: newcred must be an exclusive credential reference for the * duration of the call. */ @@ -2611,12 +2660,10 @@ void change_ruid(struct ucred *newcred, struct uidinfo *ruip) { - (void)chgproccnt(newcred->cr_ruidinfo, -1, 0); newcred->cr_ruid = ruip->ui_uid; uihold(ruip); uifree(newcred->cr_ruidinfo); newcred->cr_ruidinfo = ruip; - (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); } /*- diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 8724cfcdc1e6..5aceb28e5940 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -158,8 +158,9 @@ void crcopy(struct ucred *dest, struct ucred *src); struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); -void proc_set_cred(struct proc *p, struct ucred *cr); -void proc_unset_cred(struct proc *p); +void proc_set_cred(struct proc *p, struct ucred *newcred); +bool proc_set_cred_enforce_proc_lim(struct proc *p, struct ucred *newcred); +void proc_unset_cred(struct proc *p, bool decrement_proc_count); void crfree(struct ucred *cr); struct ucred *crcowsync(void); struct ucred *crget(void); From nobody Thu Jan 16 18:08:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTB59xHz5kkqC; Thu, 16 Jan 2025 18:08:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT974C1z3Rq6; Thu, 16 Jan 2025 18:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rAf2kUJ+8J4w9KdCPr31RtF3mEMHtBDPqpJoltY9Kso=; b=gzaSMiNMebE7BUuYaOhmSLDooikWtvuRiuz3vPBHswclVIDYIZOyuG1d+l+J9dbDrrH6t3 7QCl0ZwzBDWOFl8mlXqx8G8ZaoZVcgkIZsOquip2IsSLwFPHjDF90/doAK95N3bA9UTMU4 SOc0zxLoaxdiFqp0kxmtiB2lQ0VE6x+SW3JpTkc5wg0ZrAgUu6OOkyL7Qyr9NJzLb4K2q6 HL2GEoDcJ88Y2olzVGS2KUeT8fAzVBpAUx8NxrTygNrQ2bx1zkFzty+BrXY1Pa6T/4FX+H n6nscoe2D+TEC5x7zDIwSwsfDiVD3mSSqDjNPrNO/ybv465bK0ytWNVQ1eds0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rAf2kUJ+8J4w9KdCPr31RtF3mEMHtBDPqpJoltY9Kso=; b=m8fJ1mDcGSRKJQG8y+o+uDKbtMFKAgrkFZjSw3QBpJibj5GORlBj+zH7Sho4EB4+jphJiV XGn415KCmGTV4gyBoY4xZew6rQhryWCMNSW/LwBJ37wVXiQQ7xCj3YIIumbzZZtTp7aCaJ MuHBRtUCsnSK56ZNwcIbX0xfalanOgittQI+Svhluhza/UhXEaAGyB3QJUu6ItdJG3RnLH mTdwaZoMUeNsevxWd1FVU4Gcq+i+qx6GaeB+xdG75tqOSGDYmGfmELWKmV0qL4z+5KbrFV OMiOgnF00kUtlyqw1ysEF6B3L4Pvi07duhKxRkSarJMJpFLbvTf1tuHm1GlJ0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050910; a=rsa-sha256; cv=none; b=YmLI4vzozElJ7gRLsOzX5YSrUdxdCO60haT++2xXta47K4PJKnW69syRFZuZfsKZu8S1FA TC/jrbzufYU5XdmTwqfjbnpoDXrpU5Srh9eU7Tip/mpGeRaXVOtZIbbSL4syfxKW/CKk7J k7Xaj3abddx2Q9vp3uGG3xeRG0cl4OVD6wsyb/h2ifOcqbEFQDmIT7MLMfPMc4akdr6+qD Nrek8GiQr2M4fYWfEtDCZYSG5PtYCLueWLQbHFJcXjIjA0EivgK89z+GiU++Z/FtbnNHCP JKfjXma2LMF1kbzX/7JzxLjU5b1SU+1CgmInmePVfABMjtCC5h07h3a7Ocn+iA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT96TcGzk15; Thu, 16 Jan 2025 18:08: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 50GI8TAo092482; Thu, 16 Jan 2025 18:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8TFn092479; Thu, 16 Jan 2025 18:08:29 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:29 GMT Message-Id: <202501161808.50GI8TFn092479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: d1830c75865c - stable/14 - cred: proc_set_cred(): Remove obsolete comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d1830c75865c880c895c289e049c6649b20b9a4b Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d1830c75865c880c895c289e049c6649b20b9a4b commit d1830c75865c880c895c289e049c6649b20b9a4b Author: Olivier Certner AuthorDate: 2024-08-01 10:19:52 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:59 +0000 cred: proc_set_cred(): Remove obsolete comments These have been obsoleted since they were first written (in commit "cred: add proc_set_cred helper", daf63fd2f9a8d040, r280130) by some subsequent commits ("proc: refactor clearing credentials into proc_unset_cred", 5a90435ccfed8e1e, r361448; "cred: distribute reference count per thread", 1724c563e62fa800, r361993). No functional change. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46922 (cherry picked from commit 07c9edac7bcd75095724ff3c91d0aeec792a4f26) --- sys/kern/kern_prot.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 3510dc16f731..bf026593a3ee 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2281,11 +2281,6 @@ cru2xt(struct thread *td, struct xucred *xcr) * Change process credentials. * Callers are responsible for providing the reference for passed credentials * and for freeing old ones. - * - * Process has to be locked except when it does not have credentials (as it - * should not be visible just yet) or when newcred is NULL (as this can be - * only used when the process is about to be freed, at which point it should - * not be visible anymore). */ void proc_set_cred(struct proc *p, struct ucred *newcred) From nobody Thu Jan 16 18:08:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrT93VNZz5kl3B; Thu, 16 Jan 2025 18:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrT85h9mz3Rpm; Thu, 16 Jan 2025 18:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcOyTTeb6kYAp6S1fpWCz9WVxwjKvLIm2ZMmbi4aqhA=; b=gJWoo40nDPEtNcC4g8ZYXo5Lnlrg1mY5JxIidOwBEtqxn2wJJn2gzxJQtmKbh0i4cUfVt7 7i9DJCtM8zfovNY6NdbqMRwJp6rZAuKc/Ii0L4SQiykPyITSLeVj+3GekZUPkwe6FCTbqZ WHyw7xbUfopoxDqGSyS2gVn16+e4uzFIwqwDu6SXGqtNWQ/9BqevCkJZTzjAYg/6jCudK5 QzLS+iTPg6wxEvM3tKa6/NFU60RvDxCV5rJiOsarHzwkoUzf845AxAyqn8AvGmAaWG3+gS Axtgvpbwn06yNeNt7X5EfxuAgq99NHAvS0MBohKxZgtssCw1XOX82pnsMVjvBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jcOyTTeb6kYAp6S1fpWCz9WVxwjKvLIm2ZMmbi4aqhA=; b=NQYVG7gz+D0VNDJJ85EgYaS6CNt5Pse5cI9Z8CWOZlDNddw+x6da9EKYL7Q+Pkz/9G6pZN EmdpYyR7i5kMLHBVYIsE1139FRMsQRZIfRb9BtCqrwy+v591hMX1g3rsgOcLtuJdWAp7dG czRsS6Rc0w0KgRoDbkIRYuhF9PVlOIuoAvcYiTAOS3f+UT4tGvoTFZd5rUAJ0XcgYtMYg9 bn4sjHtUY+E8fg4F9yaFO9k7POdd/I9K0Kla0v+HSh2/lMHtOz/yhfL8nNrTdBeGynbo5i 0SlYaMNuxz5iDbkAXMlEKQCR14KXjnUz3o5cnH3DujVH6F92IYMip6C5Ih0kTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050908; a=rsa-sha256; cv=none; b=Ws2APXKCgdYWLdIFsbBhMMG309tHtpjC/0CR42WaKd7raAZmTEWhcbgHzpRRHy9MJZZ3Xr p6H6086AJ3ErgikNCpioKAq+amv5KWD4bYTdGz7HiqClwCt9dDes8ckVA4b8dNdUeLU3C0 jPC+ShvxlH3drCor9NJT/tlkWbOAACpaNyNHTJG5csJ5uQtywWxWzS+bZf987bXTFTqCC+ hAIrZwv5/X9zhbxWkO/CwYrdcvHHPgvlOlJUMVYXo+VdPdpWo6G0YrGNgr9PLzg/OZdqSx a1OejcJkITF+gUhE69mpnkzVpYCAKIX7CWH1JSbz2eRtlAaOZW9I7YhfIBufOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrT85DgdzkKk; Thu, 16 Jan 2025 18:08: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 50GI8SPK092440; Thu, 16 Jan 2025 18:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8SqF092437; Thu, 16 Jan 2025 18:08:28 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:28 GMT Message-Id: <202501161808.50GI8SqF092437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ca9614d8f64a - stable/14 - mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ca9614d8f64a7de19ba1f1cd9d6927047dd3d032 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ca9614d8f64a7de19ba1f1cd9d6927047dd3d032 commit ca9614d8f64a7de19ba1f1cd9d6927047dd3d032 Author: Olivier Certner AuthorDate: 2024-10-08 12:30:03 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:06:59 +0000 mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups NGROUPS_MAX is just the minimum maximum of the number of allowed supplementary groups. The actual runtime value may be greater. Allow more groups to be specified accordingly (now that, a few commits ago, nmount(2) has been changed similarly). To this end, we just allocate once and for all a static array called 'tmp_groups' big enough to hold {NGROUPS_MAX} + 1 groups (the maximum number of supplementary groups plus the effective GID, which we store in a variable named 'tngroups_max' to avoid confusion with the kernel variable 'ngroups_max' holding only the maximum number of *supplementary* groups) in main() and use this temporary space in get_exportlist_one(), do_opt() and parsecred(). Doing so in passing fixes a (benign) memory leak in case "-maproot" and/or "-mapall" were specified multiple times and the first option comprised more than SMALLNGROUPS. parsecred() does not use 'cr_smallgrps' anymore, but we have kept 'cr_smallgrps'/SMALLNGROUPS as 'struct expcred' is also included in 'struct exportlist' and 'struct grouplist', and thus this preallocated field still results in an optimization for the common case of small number of groups (although its real impact is probably negligible and arguably was not worth the trouble). While here, in do_mount(), remove some unnecessary groups array allocation and copying. Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47016 (cherry picked from commit e87848a8150ed75da29d99a7d0c0bba6cc5129b8) --- usr.sbin/mountd/mountd.c | 70 +++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 5c8c6aad63ec..20055d885b08 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -70,6 +70,7 @@ static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; #include +#include #include #include #include @@ -258,7 +259,7 @@ static void huphandler(int sig); static int makemask(struct sockaddr_storage *ssp, int bitlen); static void mntsrv(struct svc_req *, SVCXPRT *); static void nextfield(char **, char **); -static void out_of_mem(void); +static void out_of_mem(void) __dead2; static void parsecred(char *, struct expcred *); static int parsesec(char *, struct exportlist *); static int put_exlist(struct dirlist *, XDR *, struct dirlist *, @@ -313,6 +314,11 @@ static int has_publicfh = 0; static int has_set_publicfh = 0; static struct pidfh *pfh = NULL; + +/* Temporary storage for credentials' groups. */ +static long tngroups_max; +static gid_t *tmp_groups = NULL; + /* Bits for opt_flags above */ #define OP_MAPROOT 0x01 #define OP_MAPALL 0x02 @@ -445,6 +451,18 @@ main(int argc, char **argv) warn("cannot open or create pidfile"); } + openlog("mountd", LOG_PID, LOG_DAEMON); + + /* How many groups do we support? */ + tngroups_max = sysconf(_SC_NGROUPS_MAX); + if (tngroups_max == -1) + tngroups_max = NGROUPS_MAX; + /* Add space for the effective GID. */ + ++tngroups_max; + tmp_groups = malloc(tngroups_max); + if (tmp_groups == NULL) + out_of_mem(); + s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s < 0) have_v6 = 0; @@ -541,7 +559,6 @@ main(int argc, char **argv) exnames = argv; else exnames = exnames_default; - openlog("mountd", LOG_PID, LOG_DAEMON); if (debug) warnx("getting export list"); get_exportlist(0); @@ -1573,9 +1590,9 @@ get_exportlist_one(int passno) int unvis_len; v4root_phase = 0; - anon.cr_groups = NULL; dirhead = (struct dirlist *)NULL; unvis_dir[0] = '\0'; + while (get_line()) { if (debug) warnx("got line %s", line); @@ -1588,9 +1605,9 @@ get_exportlist_one(int passno) * Set defaults. */ has_host = FALSE; - anon.cr_groups = anon.cr_smallgrps; anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; + anon.cr_groups = tmp_groups; anon.cr_groups[0] = nogroup(); exflags = MNT_EXPORTED; got_nondir = 0; @@ -1920,10 +1937,6 @@ nextline: free_dir(dirhead); dirhead = (struct dirlist *)NULL; } - if (anon.cr_groups != anon.cr_smallgrps) { - free(anon.cr_groups); - anon.cr_groups = NULL; - } } } @@ -3189,11 +3202,11 @@ do_mount(struct exportlist *ep, struct grouplist *grp, uint64_t exflags, eap->ex_flags = exflags; eap->ex_uid = anoncrp->cr_uid; eap->ex_ngroups = anoncrp->cr_ngroups; - if (eap->ex_ngroups > 0) { - eap->ex_groups = malloc(eap->ex_ngroups * sizeof(gid_t)); - memcpy(eap->ex_groups, anoncrp->cr_groups, eap->ex_ngroups * - sizeof(gid_t)); - } + /* + * Use the memory pointed to by 'anoncrp', as it outlives 'eap' which is + * local to this function. + */ + eap->ex_groups = anoncrp->cr_groups; LOGDEBUG("do_mount exflags=0x%jx", (uintmax_t)exflags); eap->ex_indexfile = ep->ex_indexfile; if (grp->gr_type == GT_HOST) @@ -3383,7 +3396,6 @@ skip: if (cp) *cp = savedc; error_exit: - free(eap->ex_groups); /* free strings allocated by strdup() in getmntopts.c */ if (iov != NULL) { free(iov[0].iov_base); /* fstype */ @@ -3611,21 +3623,19 @@ get_line(void) * Parse a description of a credential. */ static void -parsecred(char *namelist, struct expcred *cr) +parsecred(char *names, struct expcred *cr) { char *name; - char *names; struct passwd *pw; - gid_t groups[NGROUPS_MAX + 1]; - int ngroups; unsigned long name_ul; char *end = NULL; + assert(cr->cr_groups == tmp_groups); + /* * Parse the user and if possible get its password table entry. * 'cr_uid' is filled when exiting this block. */ - names = namelist; name = strsep_quote(&names, ":"); name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) @@ -3652,17 +3662,13 @@ parsecred(char *namelist, struct expcred *cr) "can't determine groups", name); goto nogroup; } - cr->cr_uid = pw->pw_uid; - ngroups = NGROUPS_MAX + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { + + cr->cr_ngroups = tngroups_max; + if (getgrouplist(pw->pw_name, pw->pw_gid, + cr->cr_groups, &cr->cr_ngroups) != 0) { syslog(LOG_ERR, "too many groups"); - ngroups = NGROUPS_MAX + 1; + cr->cr_ngroups = tngroups_max; } - - if (ngroups > SMALLNGROUPS) - cr->cr_groups = malloc(ngroups * sizeof(gid_t)); - cr->cr_ngroups = ngroups; - memcpy(cr->cr_groups, groups, ngroups * sizeof(gid_t)); return; } @@ -3686,17 +3692,14 @@ parsecred(char *namelist, struct expcred *cr) } else { group = name_ul; } - if (cr->cr_ngroups == NGROUPS_MAX + 1) { + if (cr->cr_ngroups == tngroups_max) { syslog(LOG_ERR, "too many groups"); break; } - groups[cr->cr_ngroups++] = group; + cr->cr_groups[cr->cr_ngroups++] = group; } if (cr->cr_ngroups == 0) goto nogroup; - if (cr->cr_ngroups > SMALLNGROUPS) - cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); - memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); return; nogroup: @@ -4065,6 +4068,7 @@ huphandler(int sig __unused) static void terminate(int sig __unused) { + free(tmp_groups); pidfile_remove(pfh); rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); From nobody Thu Jan 16 18:08:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTF2RdMz5kkmM; Thu, 16 Jan 2025 18:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTD239nz3S1R; Thu, 16 Jan 2025 18:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vcIJE24kV+ICp9yB5j5qyNNUqVUr2h9L3BNu+P6OVNs=; b=YVK2N2mHatjL3SMUbb2cFyS3gun3Dyj4oHSy42AoK6USSTNB/zv5Es2+i6pM74naD/TQnC JBigUsSkyX5hLehYp01yf2ZO4eXOroTwr4qFh/D2Q1QULUoLIqf/xLvn0dHF/KgzFCBdFl 2VetATuD/yATiZrI6hWt4GialOs4jE6D4OljWeZgPTMplByYE/QwyCIqig/COaONzDm913 bf57MN0B6raAucdzVF5xo0ROujP+ROAs+gHNlyZ0uYhRmvrAKANBRyl0xbvQeVWipMeRa/ dvGz8jSHGDvIHFQftFhwK586cacDfdlc7RBH3hCAFlFM/jcLifEHMrYuAbheeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vcIJE24kV+ICp9yB5j5qyNNUqVUr2h9L3BNu+P6OVNs=; b=azYMMEum+Iqbq0KPX7f2fZgITeDv8nh1yWxwpjCnRR7irg9EeSZCWIpUf9w92cVtnlmPhF d9bYCq8w9NPPUMNGcwAFellXjDcmb3sEXwNTE9THye9b7OVpUvUoKl3d9GVPjOYPFUSz0j 2TEXaYsBFD4/aQrpLilGrgvdEHExCtToeM1LodnCoxB7EK5G69jcXAFuaF6cCu/cu5WJjG W6XGTrc/Mi2EUKbn65url5D0PRkRcWp/D4gbvGT9KvMA0/KYPh/COzGi0pTyGcTU+m9OOs seXvtuKHh1rOrWWjb7fI0XfS3ArhdNrfKbL1IC8hwM01LsoXbGZtKzSpT/5QJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050912; a=rsa-sha256; cv=none; b=S/Kz2jKdBQy28/7FdrB5y6ObqHDm1wF4YRgLn+0L5Edg1pHXrnKbNdqDOl3vYKkE7N/ybu At8xAnOIG6vhbWbH9DVsonr/KET1XxVVH/OzPHwhQ8ySxkEtvqIFJSDxjgGWpcNKM+dOVn acP90UbFdeA2bbUSCoYvlL6THCkpPWcY9m/4DqLp3XTVZfhCGxaB25c3aZTlnCmsgYH6Uq JvWHXggTpJB08P7OOhhF2oCP2Jvopzc/2HuUIbMCEUt1q0FvFxatA0ZchdEQuXIBXp2YfN Rtbnofu3+VwwuDv0+mlmrheS/ESxmn5SkARZ/Tw1yyNzljMozLw4nWnc8aHwAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTD1RHXzk16; Thu, 16 Jan 2025 18:08: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 50GI8WBa092583; Thu, 16 Jan 2025 18:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8WWs092579; Thu, 16 Jan 2025 18:08:32 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:32 GMT Message-Id: <202501161808.50GI8WWs092579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: eed08497de05 - stable/14 - syscallsubr.h: Header inclusions: Explicit , sort List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eed08497de05a3ab6bbdb3823aafccd82e161996 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=eed08497de05a3ab6bbdb3823aafccd82e161996 commit eed08497de05a3ab6bbdb3823aafccd82e161996 Author: Olivier Certner AuthorDate: 2024-12-02 15:06:29 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:00 +0000 syscallsubr.h: Header inclusions: Explicit , sort is currently brought in by other headers but some of its type definition are directly used in this header, so it should appear explicitly. It is necessary as lots of prototypes in there use types it defines ( wouldn't be enough). Additionally, and need constants from , so just include instead of . Sort header inclusions as per style(9). No functional change (intended). Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47881 (cherry picked from commit 8cdb0458e12e6fac577cfb2277e7e85d3c21fa09) --- sys/sys/syscallsubr.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index b3ba50823e93..52d2035cc962 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -28,13 +28,14 @@ #ifndef _SYS_SYSCALLSUBR_H_ #define _SYS_SYSCALLSUBR_H_ -#include -#include -#include -#include +#include #include #include #include +#include +#include +#include +#include struct __wrusage; struct cpuset_copy_cb; From nobody Thu Jan 16 18:08:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTF4Y7xz5kl3J; Thu, 16 Jan 2025 18:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTF3WpWz3S5r; Thu, 16 Jan 2025 18:08:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jsb3K+XQsONdWvQFpjRRznt6puK0MkU3b2ca8YduInU=; b=x3+0M2hy5Z1yhd1pQjZZSQ9nB1NSe1O+6hwYkjyfdtbAdRGBzDfUMovyTym9YyJ77DL7UT CYKHl74taSYrPt26OD+WKcdgFpL1D119A30JzZzAe+gmkYaliDvJZ9eQldYf8A4NzriyR7 i+HsmeJ9QtmU+1zixo/TWUozrgjGvOUoZ7ivzi+46IJAtXinEJd+jAtDOiuayKbNZJd2HP xhdL46XymkwX+T0v2/D6hqg5MyEJRrENYQzSIrPjCWouZKeGdBrOSQeeO3YFomv4s3xf8z x+gz0OJrhnRxv58/5WRMo5HXb1isVJVm86rqZSFSHVKO9rNp6eBPKp5leNf0ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jsb3K+XQsONdWvQFpjRRznt6puK0MkU3b2ca8YduInU=; b=yglYb3fM2tFnJNhaMfhFjDGKaEhWHp3HqU3K8+G0iugK61CPTNiPDtxmSNb+ytpB6BGcnl Wv9DKsm9sVF/NTiiex/HY3N0WbWK9Q+zkSIW6osKqIVFeVXHZLkklTq7VphfwOgr4TcwkP whgE7MeGYVTiECv+HqgB4Qc8Wc/yKVhY5jb3vLry/19njx5Cy28I6gq6w2G63ugc+Anf8I T0ed8mHjxb5x6FgdMqvO7pOEiiJMaXSh3jSPgsfL6srbI4757nW2q/iRRQyC2qN6S6pX4s U3ME4D5P4pyaOdZK/U9rXo3FVskj/0B+xpTwYWg7vkqVNqeYPCsJrbBay3+dtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050913; a=rsa-sha256; cv=none; b=xFzYiGcsWNwUb0lO4zcHKUzGqz19f/KPgFjtOmGE/oqmc6k94INUsv2LKT/InjOud5aTEE xcbc4gIKODul79h0/9mewOcjUfH57tfNlHjMSx6Rpn8ZQbgG8jrP+1wOGWHh+irI19yS0b 3PIQFYrtPOr9K+E+G7fNdVYLka2KAYeFD/bL/PiZobe5EwHPyoH1yFRUGTOp/8Ohfm9ZuG m9jD0DGKb/E/w2J2vzsfiZMIh8kbk/Dnh49LA02u/0uWn6FYjZBmWpgeqv6MSU6LqvlAOm 7BH8f+17wZ5XNW+8VFc6/b/J5KVL+a6Ma8UqCv9A/i5ARlv5CY9ksSPphJiVGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTF2TJkzk17; Thu, 16 Jan 2025 18:08: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 50GI8XQm092626; Thu, 16 Jan 2025 18:08:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8XBA092623; Thu, 16 Jan 2025 18:08:33 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:33 GMT Message-Id: <202501161808.50GI8XBA092623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 24e4f0365709 - stable/14 - x86 atomics: Remove unused WANT_FUNCTIONS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 24e4f0365709b473029f7aa85514939a0d87df77 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=24e4f0365709b473029f7aa85514939a0d87df77 commit 24e4f0365709b473029f7aa85514939a0d87df77 Author: Olivier Certner AuthorDate: 2024-12-09 16:13:09 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:00 +0000 x86 atomics: Remove unused WANT_FUNCTIONS This macro has not been in use since commit "inline atomics and allow tied modules to inline locks" (r335873, f4b3640475cec929). Reviewed by: markj, kib, emaste, imp MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48061 (cherry picked from commit fa368cc86cebe7185b3a99d4f6083033da377eee) --- sys/amd64/include/atomic.h | 3 --- sys/i386/include/atomic.h | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 91a4398a0815..93301459fd77 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -385,7 +385,6 @@ ATOMIC_LOADSTORE(long); #undef ATOMIC_LOAD #undef ATOMIC_STORE #undef ATOMIC_LOADSTORE -#ifndef WANT_FUNCTIONS /* Read the current value and store a new value in the destination. */ static __inline u_int @@ -592,8 +591,6 @@ atomic_swap_long(volatile u_long *p, u_long v) #define atomic_testandset_ptr atomic_testandset_long #define atomic_testandclear_ptr atomic_testandclear_long -#endif /* !WANT_FUNCTIONS */ - #endif /* !SAN_NEEDS_INTERCEPTORS || SAN_RUNTIME */ #endif /* !_MACHINE_ATOMIC_H_ */ diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index e68af0454130..f210b501d333 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -299,17 +299,6 @@ atomic_thread_fence_seq_cst(void) #ifdef _KERNEL -#ifdef WANT_FUNCTIONS -int atomic_cmpset_64_i386(volatile uint64_t *, uint64_t, uint64_t); -int atomic_cmpset_64_i586(volatile uint64_t *, uint64_t, uint64_t); -uint64_t atomic_load_acq_64_i386(const volatile uint64_t *); -uint64_t atomic_load_acq_64_i586(const volatile uint64_t *); -void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); -void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); -uint64_t atomic_swap_64_i386(volatile uint64_t *, uint64_t); -uint64_t atomic_swap_64_i586(volatile uint64_t *, uint64_t); -#endif - /* I486 does not support SMP or CMPXCHG8B. */ static __inline int atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t expect, uint64_t src) @@ -618,8 +607,6 @@ ATOMIC_LOADSTORE(long); #undef ATOMIC_STORE #undef ATOMIC_LOADSTORE -#ifndef WANT_FUNCTIONS - static __inline int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) { @@ -874,8 +861,6 @@ atomic_swap_long(volatile u_long *p, u_long v) #define atomic_testandset_ptr(p, val) \ atomic_testandset_int((volatile u_int *)(p), (val)) -#endif /* !WANT_FUNCTIONS */ - #if defined(_KERNEL) #define mb() __mbk() #define wmb() __mbk() From nobody Thu Jan 16 18:08:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTG6DfFz5kkmP; Thu, 16 Jan 2025 18:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTG3xPYz3S3m; Thu, 16 Jan 2025 18:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m6szX0bAHHD/TAJxHei9utehHewmT1urOctf5WUw1ds=; b=K1Z5HLyT6q/TlEItNEb+FUveB27wu7djvVBY3pIdKpl+n6ay9RfsEohvLqGk/Ec95+Kinf eiP42MLRgSXYTouXbiGeT5V41I1uDVe3aBkHzxw+Lt0TvT0PSm9i1xxVd/chRkHDAMMUjA PjcayK5MIN3N7d67TruxcZh+CLLRhKjF5TIjnCuteDp0EJG1vguubGZN+lLfi1jat/70qD EGIdjlwYowo/rMrbYwctI29DoLmNuHC0A0QJlaOztX021/W3r62OR0QrSgRlZqIspE8Oob X+lJ2LQ9y/BZs06YJazWZjsQYt3mAIm8MRCr7ENreFpZDwxySVbHxGu3CmNQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m6szX0bAHHD/TAJxHei9utehHewmT1urOctf5WUw1ds=; b=NvL2cF6SSkUCeYL4ICWhVtBi4I2r9tVjCW5L3XWFKylxRfEflBSNcXbubtPdyH76KEm7nb PDFt400E4ENdVcpUR5lBG7h8ASuO+J2OS1P4MEPISfuyZfvg9FT/mgu1B30MYSIAzBp5ro baHb6LFmmPfJM52dGxAKxyCxXhvwBM1ZsgHXX8WyaLxJX0Xdhyr/h8dKxOEzMUbZ7IEkkt GHpYL8I8eezDvy7Pey/zS7qZm2GoA9KE7I0wCXi3sDrZ6w9yqkoGCn3CM6pS7Z69meQqKc egjjs/VRc59qTahMP0gR2S9G9E0dm+upY+T7SR5BUs1s+XjfzoC0fQmUY+clag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050914; a=rsa-sha256; cv=none; b=BmUMcRbT0jyHWtY5908iqeDDXGiafdbBcIX+87EUbtg7xZZctZkW/RB/Q4l2pJSDcDmyRA 8iffc+D4ABP+sTgpx9gr0tcca6luhHYgNLYnLYuiAisxrJhUs1Vt8MvTDLbpY/jDoaGxsN pjB1E1BA0IbkckXRClcvS7M93cdizV/e6s5bWxNYFRupBLiK2hagWcsUxQdSW+6O+oE2LE zMbVxxjznyiqL9vQd/iDcAFF8T2/9N7ff8pNoBXPMroB+XVVrkX4oVBYoQOzXWPMBmMnYF 55XPr3hUnVhI5pfFHBWn0lkVIZ0XDc2j+zvF+wzoHu8GaVNElMJh6CtHvl43IQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTG3Whdzk18; Thu, 16 Jan 2025 18:08: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 50GI8Y7T092676; Thu, 16 Jan 2025 18:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8YQw092673; Thu, 16 Jan 2025 18:08:34 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:34 GMT Message-Id: <202501161808.50GI8YQw092673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 31eb78aef84f - stable/14 - atomic(9): Update manpage after constifying atomic loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 31eb78aef84f7670dc88c2ee246a74ad86b27ee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=31eb78aef84f7670dc88c2ee246a74ad86b27ee7 commit 31eb78aef84f7670dc88c2ee246a74ad86b27ee7 Author: Olivier Certner AuthorDate: 2024-12-16 17:58:50 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:00 +0000 atomic(9): Update manpage after constifying atomic loads MFC after: 5 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 32c45723fa53d384e19ce52aec15972e73305a8c) --- share/man/man9/atomic.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 581aac9878c8..df24cd4a4d2b 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -20,7 +20,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 November 19, 2024 +.Dd December 16, 2024 .Dt ATOMIC 9 .Os .Sh NAME @@ -60,7 +60,7 @@ .Ft void .Fn atomic_interrupt_fence "void" .Ft -.Fn atomic_load_[acq_] "volatile *p" +.Fn atomic_load_[acq_] "const volatile *p" .Ft .Fn atomic_readandclear_ "volatile *p" .Ft void From nobody Thu Jan 16 18:08:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTK13bDz5kl0k; Thu, 16 Jan 2025 18:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTJ5wPZz3Rwl; Thu, 16 Jan 2025 18:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050916; h=from:from:reply-to:subject:subject: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+zxLpuLVMVzERWwly3Qcu1SLp4xHXLs/RC4zB90YA=; b=cNZNlXbdksYM9p4smFhh5IOSA8lQcFVZRT86Mc7dHwn0qHjgczvDnI0r4xLPq2bSz1urOg cRntGp0tbsWFevcvHAjyqrbxv8If4Xlc7QfF1KWPbJP4miTgs7dcAadSz7XpWqIiI05GBk CMuyNXpvJi7KCv7DpmEMBRC/9ZgccYOKbtHgk5A+mpHIlfRpGyDM2/9hMkgw6JCbJcAguo DSjj9IU3ZSLEY6mAssNkKMpuInqnRHVjfWWF8A7ihqaTbsa6hXs80QIPULeNMTkI3EYU+o jaSKX4/IqE9Lu3hIgOkShsMkEKra0DQna2pVIJph0XWnCaEv6/mWrOKl00qVaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050916; h=from:from:reply-to:subject:subject: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+zxLpuLVMVzERWwly3Qcu1SLp4xHXLs/RC4zB90YA=; b=DkSSJvV603BxM6Z8SFBgLG7bd+cHLlpkgZ0+tirnaRI3Xzz9sQqJArmShzamey1WEiwq+F k7ehkwjOAX+HOAX7Fhh23sc2HMDUJQErCBaX5XpIWegeJIk/JXT2ISdmfLYEz3cJaoZ9kc nSInON4CYOSjzKFQ2+j7k/ntqGxehRVJTOfqj1VBVGXmV0TMQJmgUA2+XisuEuTlfYP/YD pUtDv7kUrGRtt9e9myHYQ0ahsReaJ6Q2qjiLDcVo1t2qULzjKTKNMKbIeun/XaSRGiXlQJ JnyoXMoOIMtyLQZdyubAiBTuCefXIJSuJ1UQJolC4ZChTxrrcisJOdWkPvOr6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050916; a=rsa-sha256; cv=none; b=sOMX8U6aW4bGkccBYhxVOC2Ft7Gd/fnZS3FlGIKFzixb4pqxFhl2O4fvdETfFeB2IkF7bH bQ7dqxa4bw0A9cCeg5ZaqQuVoQn/iLEw1ARS3TCoym5Ox+CNknoG0A+TzMyN7n/P5ZCb/T zjGjgGKfAQr77Zn/ZOA6JnOYHHEYn1CFHJEAIcd+MReWIyRdrofsOm5iMZOu6E6EEPBGE8 9VRMWWeE06HL84q9ojpoXzXvV9B+b+msMgxUd2XwHQ7vCLWAXzU4VxLiib11+CEQj72rWd jHobZU9QYXMQVmkREsBmKebIw6sfESJaG7LIjKvhOQosDbeufbTAx4l5i78mxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTJ5V86zk7p; Thu, 16 Jan 2025 18:08: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 50GI8aMx092766; Thu, 16 Jan 2025 18:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8aSD092763; Thu, 16 Jan 2025 18:08:36 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:36 GMT Message-Id: <202501161808.50GI8aSD092763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fce2a3509a65 - stable/14 - atomics: Constify loads: Fix powerpc build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fce2a3509a65a374820dc889929f8e8f5dbd1707 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fce2a3509a65a374820dc889929f8e8f5dbd1707 commit fce2a3509a65a374820dc889929f8e8f5dbd1707 Author: Olivier Certner AuthorDate: 2024-12-16 19:12:14 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:01 +0000 atomics: Constify loads: Fix powerpc build Fixes: 5e9a82e898d5 ("atomics: Constify loads") Sponsored by: The FreeBSD Foundation (cherry picked from commit a9722e5ae8519a9a28e950dbd8d489178e9bc27e) (cherry picked from commit 793939c9444dce957118fee412f5144c2e46aea3) --- sys/kern/subr_atomic64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_atomic64.c b/sys/kern/subr_atomic64.c index 8a565ef8ec67..f52ac9caac75 100644 --- a/sys/kern/subr_atomic64.c +++ b/sys/kern/subr_atomic64.c @@ -78,7 +78,7 @@ static struct mtx a64_mtx_pool[A64_POOL_SIZE]; #define ATOMIC64_EMU_UN(op, rt, block, ret) \ rt \ - atomic_##op##_64(volatile uint64_t *p) { \ + atomic_##op##_64(const volatile uint64_t *p) { \ uint64_t tmp __unused; \ LOCK_A64(); \ block; \ From nobody Thu Jan 16 18:08:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTJ3NlPz5kl5K; Thu, 16 Jan 2025 18:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTH4hrdz3S3w; Thu, 16 Jan 2025 18:08:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNxBU1TOZezVlPAGw4rV9ka9rrRp5m9QpGlfb0Xfngg=; b=JGjbr07WvQNhm2odZ2FU9Af5k6/CEkvooa34oKBcYsCy/u1uVGkWqNWH9nkeyDVbuUizBO h1T/PEhzpxWhNQJD8/C9AMMKMmmVoSlLeW7Pw46J5x3qo87ouXEblBxzZqPnOOXA+Dh8DQ AO5CTHtwi/w3XhknG6ungcaWWg+4A+lnqwnqTKcBlaccDj+FeOJFy50YFrvEr8A49us8K1 +VnMr3rEGjgSTv6pIwsoM7aEz6KStpQ1KpUYp5AfZkMK8TXurrW96MhIs7lRwJZxWZBgty mUxbJX7bUJqPvekZ2pqH1qxbukRo+FrXf6vfcHrHc5KAxDsO7PXq8QJsq188xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNxBU1TOZezVlPAGw4rV9ka9rrRp5m9QpGlfb0Xfngg=; b=H3je/s4us2A0UA2I3KgmGWBcnUYKDh5sGujgZBmJCMbRNmZ9rCYzovc2vWmFlDm9O/XOy+ xmJkg/PjuXKOyMY4pDzpi82pFCMqtZqABtBamsEqXv2Skx7KuaehJ+w8VapNt542hAvow+ bLsgb0UfYLAD9xfM82dpdEi/WvsFTaL030n9zZD69fVsb1RcydTuYUUFAyFSVBotYu14N0 ftlM354ypADop6Zy3U6bY/bcIVwS3y8+k37L6EFYmkDu5yCegIMGPBIpqyBAe6sSs/f2uv Nw2sLmYGUobZy23/8RIHtwBo5oJRin/8nBk+uPqsjpwAZXNP1DTwaEOOvqs4Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050915; a=rsa-sha256; cv=none; b=kdQHf3wdJbR/Gs5D8NbxMU1a3n5+6YVISrYRmN4rr8UctNEY+VtrowF26t1C2Vu7TSfBwS aknnvd4vsdSF+32OgZSDOyEs2lEuYh3wGUKlEkbguzCdUsI2LhXpkdP9OPyAMJekCIpS7k KiiI9ORKLRl8E5Ju5GD/JWo6st1k/MvbgpHQJNHvHmkStARIc0QbXzRO2R+Qi7R/Q9yXrN 6wpk7pqTpKJCRTtjpL8KTg8M+NceUaZHxr+dpBaKGDLwjD0ZYINh7e7FufpCpiJqm+LEMZ YG+3Y820r3WPRgTVbqu0vQk8aGMxNRMr9wKxp0iPC0ofTE50HPOlMyMP5kfo4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTH4C37zk19; Thu, 16 Jan 2025 18:08: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 50GI8ZIO092718; Thu, 16 Jan 2025 18:08:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8Z9n092715; Thu, 16 Jan 2025 18:08:35 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:35 GMT Message-Id: <202501161808.50GI8Z9n092715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 22e8819388ee - stable/14 - proc_set_cred(): Fix compilation of GENERIC-NODEBUG List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 22e8819388ee0495bb02a31e888ea4c0f0b11dab Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=22e8819388ee0495bb02a31e888ea4c0f0b11dab commit 22e8819388ee0495bb02a31e888ea4c0f0b11dab Author: Olivier Certner AuthorDate: 2024-12-16 15:38:26 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:01 +0000 proc_set_cred(): Fix compilation of GENERIC-NODEBUG Approved by: mark (mentor) Fixes: d2be7ed63aff ("cred: proc_set_cred(), proc_unset_cred(): Update user's process count") (cherry picked from commit 675708aa402a06d9ced98c8a12d9ef29625d3c66) --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 7c5ce97fef93..3f1d28376d49 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2339,7 +2339,7 @@ _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) void proc_set_cred(struct proc *p, struct ucred *newcred) { - bool success = _proc_set_cred(p, newcred, false); + bool success __diagused = _proc_set_cred(p, newcred, false); MPASS(success); } From nobody Thu Jan 16 18:08:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTM4Zy0z5kkqZ; Thu, 16 Jan 2025 18:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTL75WVz3S9F; Thu, 16 Jan 2025 18:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZluBAa/b1CRl939TqlDH6pRuqMI3oX+abs71MwhPE0Y=; b=W3TgLCBPHZ6CKa+6SYlkrlcJeGk8QJAYEI5O5P79JBc24MaZ9vWrUrGfZ1QpQ+03yeVL7/ AQy3RKfI8COz6sENepCv25J+X/GBNctVM1wYzk9i2YziUiDqfdnoluCATwUaEy5gPBCI5f CStSWaP6D9qY8k4JkRXZtFytqzWQe7n9k1RL8L2A54TRIewgySSh76d//PoQ6TnvqnyhWP NFoWL5YZkjRdh1LxEbmWZfufDKlq5czeVQS2PITpIgKOmpayN0DqgCavp3gRnTSp9I+dYM NmmL6lJCG112RB6+lCbfXSwb446ctTnvycgXup/ZjjFYMPnLaEWk13dzpPv5hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZluBAa/b1CRl939TqlDH6pRuqMI3oX+abs71MwhPE0Y=; b=FhojycVPeIawmuhDYxLl324rzA/tX3/AtXd34lT3nSu+hwm9EcxuTHj6ZWWR4HZ/JSNpsW gQcMQioyIGbQal3Y5aNiJUJAnVt9RWYnzTJfTr9QtqEGY0W0OdsAymDogrUmOtY/t3wULl dsbl8XLkQZ9uhM4pkVQ8JmVpaTiQRSAnp9JehWyZ690x3AgC7zWvNVtHhV3xPwSPiabwNK sO4aS1mFVF/QqiKoUW2wZ21X1z23A2QYkWtW5O3bltSe8SHl+rRGkPaNjUqJnwvPqySX0Q XiIqGh49hPyaVxqhmky/Gi6jg+IB5MBunHWvZOnH+QRuqeyN981tUGJePQTahg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050919; a=rsa-sha256; cv=none; b=RiAq6aXXqf+X1l0+Ay9HM4AbgwaOUsnvF+mpomB6Um3wTT2IuNyGXV7aACffl8gcUMYny5 3FYRC7C2vMpVdZHB7JlvVC4ckECLXGdbdQqPUzwk4D/TSsVDdoZE5dO50U603GJxwNaQnN 3X+X9+lVIrJD24zKKTsmC1xIggJqu1Q0ZfcChE4qCew/k5WEivwqQCmhKz9QTKkYvA9e/g 6H+jggWsP8J1mrFuFaJjap+CQ2zpAYfqZ5wq3EnDXzfzml4gjyz3y+YhMzzkGpY8JXTF+Z Bo6kNw/IrS2/uqrFAvgcVrt9a8cSD9ctyHQHNOXO8KXeL4DDEs7VRRPsk8vhyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTL6bKxzk1B; Thu, 16 Jan 2025 18:08: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 50GI8ckJ092862; Thu, 16 Jan 2025 18:08:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8c3X092859; Thu, 16 Jan 2025 18:08:38 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:38 GMT Message-Id: <202501161808.50GI8c3X092859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: dd0fae3028d2 - stable/14 - atomic: Update interceptor function signatures after commit 5e9a82e898d5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd0fae3028d22ec9e9c98172aedfde46c3534186 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=dd0fae3028d22ec9e9c98172aedfde46c3534186 commit dd0fae3028d22ec9e9c98172aedfde46c3534186 Author: Mark Johnston AuthorDate: 2024-12-17 14:05:00 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:01 +0000 atomic: Update interceptor function signatures after commit 5e9a82e898d5 Fixes: 5e9a82e898d5 ("atomics: Constify loads") (cherry picked from commit fa5f4c10a8ce457bc1c4276933fd7dd34d75f6d6) --- sys/kern/subr_asan.c | 2 +- sys/kern/subr_csan.c | 2 +- sys/kern/subr_msan.c | 2 +- sys/sys/atomic_san.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_asan.c b/sys/kern/subr_asan.c index c934ff83874e..51bf1f684c79 100644 --- a/sys/kern/subr_asan.c +++ b/sys/kern/subr_asan.c @@ -750,7 +750,7 @@ kasan_casueword(volatile u_long *base, u_long oldval, u_long *oldvalp, } #define _ASAN_ATOMIC_FUNC_LOAD(name, type) \ - type kasan_atomic_load_##name(volatile type *ptr) \ + type kasan_atomic_load_##name(const volatile type *ptr) \ { \ kasan_shadow_check((uintptr_t)ptr, sizeof(type), true, \ __RET_ADDR); \ diff --git a/sys/kern/subr_csan.c b/sys/kern/subr_csan.c index 368f8b6ba981..e8f0eeabbca6 100644 --- a/sys/kern/subr_csan.c +++ b/sys/kern/subr_csan.c @@ -441,7 +441,7 @@ kcsan_copyout(const void *kaddr, void *uaddr, size_t len) } #define _CSAN_ATOMIC_FUNC_LOAD(name, type) \ - type kcsan_atomic_load_##name(volatile type *ptr) \ + type kcsan_atomic_load_##name(const volatile type *ptr) \ { \ kcsan_access((uintptr_t)ptr, sizeof(type), false, true, \ __RET_ADDR); \ diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index b596443de2aa..07e894e4c3db 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -1220,7 +1220,7 @@ kmsan_casueword(volatile u_long *base, u_long oldval, u_long *oldvalp, } #define _MSAN_ATOMIC_FUNC_LOAD(name, type) \ - type kmsan_atomic_load_##name(volatile type *ptr) \ + type kmsan_atomic_load_##name(const volatile type *ptr) \ { \ kmsan_check_arg(sizeof(ptr), \ "atomic_load_" #name "():args"); \ diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index e22324b87623..93a9bfcbf593 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -65,10 +65,10 @@ type sp##_atomic_readandclear_##name(volatile type *) #define ATOMIC_SAN_LOAD(sp, name, type) \ - type sp##_atomic_load_##name(volatile type *) + type sp##_atomic_load_##name(const volatile type *) #define ATOMIC_SAN_LOAD_ACQ(sp, name, type) \ - type sp##_atomic_load_acq_##name(volatile type *) + type sp##_atomic_load_acq_##name(const volatile type *) #define ATOMIC_SAN_STORE(sp, name, type) \ void sp##_atomic_store_##name(volatile type *, type) From nobody Thu Jan 16 18:08:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTM3mz8z5kl0n; Thu, 16 Jan 2025 18:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTK706hz3Rx6; Thu, 16 Jan 2025 18:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tyQV6jbimT7KVqtegxKOGqnqNz4cLqQu7U+Q9PDgEU=; b=Ti/Qjxv5ub/ixJj1MtKHvzQb3sje/uOZAgovtKpMIB3O2mnz8s6IDTlf5pXacpkT0eTqQ1 75bfJy0INEIR0SHh3FTR2DbYUNicP+ZdBoE8A8RJui+eAyV4tuOOWIZtJPN8FsynjAeiUE GjO+QVN26G3zp3oXRXiHOgxWK3NfeLiRDhcJcL9130Yv2w67BNFr+r1Q3LR93x79D3nn78 Ta2yibQ8Pu4uJhMZ+dEpTg2DvreiwgKUMphXsbWJMYBpYvilC2h7rDDZX0KzvnikPjqINA yYdrjp9gSW7aBJypTvZeoo/8GtBXL9iVhhKFzFpBKfiXDMwvGTEgJfTUDFj9TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tyQV6jbimT7KVqtegxKOGqnqNz4cLqQu7U+Q9PDgEU=; b=NF+FgUMQzrN9f7A65i02bMor/5hmf/IlKXi6Gy9CipVnvcjGn+YzuNJ5LnMHx/9delOll0 I73Wj0ufAfDNVgAbq7iuYtxbCLiHDwRX0EwGff8fGbWHAxLniNxPq+mPja+geeUgIqydyT iRYpfck8/fkNGdzLmm52S2mkd28A3LTW9eJSINeALRJ5GT0cJrr8ubBKOs3uekH37qB4u6 NRt/w0JunRKAYUkVYTjn2dfKrOHqgpPZj+1FUAiIvcuCGjI92oUCmnASi+QpAaPtBwv5jC UBwwCa/AzPh/zciBPlbQlC1NF3q8YB56U4WhbchIRVEHF1LmF7oRIm3zBJ+VqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050918; a=rsa-sha256; cv=none; b=pvJolSTWLXG5NMMfpW8RHSPc25qvYwo4mFM+P9HnjLUDZGJtvMT0TExcdSGIP5jul/NN9Q 29/wKhKZVr93Fpi9yAuMXru0OoM/HQ92ekaWwyryJWrqFE6E3UdQ8CH3pa4mMZg/VMAKI3 fnjwZaSukmCREsEoXb16NXtmN3OMD2aNDCf45Hp1hxkX1UTxvaPBbmz5JKviwMTDhmscG0 IgBXzKvH0Th2EyjHH1xmoVen0zlVAkUryKwAEu12UsoFNrHWSnT1PUav4J6rL4/iyAFMjC VjwvEQ6pP0J7B5ol6LESwv6JR+HDJkvu4bQUUvwtrKXxggMDY7ieLR/NZJufhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTK6DKjzkJT; Thu, 16 Jan 2025 18:08: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 50GI8bIV092806; Thu, 16 Jan 2025 18:08:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8bwu092803; Thu, 16 Jan 2025 18:08:37 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:37 GMT Message-Id: <202501161808.50GI8bwu092803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b14c0e102e78 - stable/14 - queue: Fix STAILQ_SWAP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b14c0e102e783c24795578df33b60319c6239481 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b14c0e102e783c24795578df33b60319c6239481 commit b14c0e102e783c24795578df33b60319c6239481 Author: Mark Johnston AuthorDate: 2024-12-17 00:12:11 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:01 +0000 queue: Fix STAILQ_SWAP The debug assertions added in commit 34740937f7a4 do not hold for a window in STAILQ_SWAP, so check whether the queues are empty directly. Reported by: ler Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") (cherry picked from commit da2c88dfcf4f425e6e0a58d6df3a7c8e88d8df92) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index fee6618ee88c..be862c7ce814 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -475,9 +475,9 @@ struct { \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ + if (STAILQ_FIRST(head1) == NULL) \ (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ + if (STAILQ_FIRST(head2) == NULL) \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) From nobody Thu Jan 16 18:08:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTP0Ch5z5kkmV; Thu, 16 Jan 2025 18:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTN0vsRz3S9T; Thu, 16 Jan 2025 18:08:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lfY33TGrAI9aQ8nv9VruCPrwMSBjQYKtx7heAi1DhAo=; b=VX807GAUyuL9vzXoSd6GZqFouZq9kt5AderBKeo82EY9ZMrl38HN/FP3Aa8g46P39RIR3Q b76gqdp1i1+3vbLTn0C6AoGsfxrbPZZsmw47HF4kyQsLKmAAEP1Motl9yxneFew3WE0usD +gbTnyL+KApVGJhkbZZICuw+0hIgS70eWgCkaTIl3kj6u6TXOlVrw3Xf3/i2ZMe7HqSq1W G5+qwZwFKY6L0a30mY4ycAy0Ks49fLijVY/q2QXnMAsrf42H7xW1aeyDvzz2/v1tyTk5zo 8B96H8GxSfMIEsvOAkrGwgTnjQVEYfPJ1i2UUG9XMtvUYB6rckrFGNnu3XWPcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lfY33TGrAI9aQ8nv9VruCPrwMSBjQYKtx7heAi1DhAo=; b=pgqVrEVzKUhxwrVjfXkAliKtaywB/cpJoOMI74d+1mLLephzvNQtMtPkOnY4FI1cJyARJU RVTwS1M/TduZjYHwB23V7ufjraxFRflZDmPHreVTjvpMfb5FljAjf5XTrltd7qAK2Y4084 AHqhfF4weugYWf5Ndr+qAwjccgYlYordXNEN0uCPbMfL0T+8jap5SC1VufWtZbL2lRUrB3 GkYugu+gW7Ry8TeTqRP2mIavTGJATA8SF7bi54SzUGz3VHpqMTFXVIcZuWbSH4JLtgmP26 j+JZyico4ZcgxUSLteJo0OpMSjG4d2wiHJhzP0SgCN1FzlUTJcMeSvkQq+sPRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050920; a=rsa-sha256; cv=none; b=hTcIWWrNNEztOd26dUAEbxUgbI2ECV7RI6kOEbV764ki+R4H4mToG5A6ZRaQielAXjuwCA a1xWKJDGbVfXY6YnWDrdtpChFGGsaROZmnXSQd9VvZCv+VF+zA1JPX1pmTCJYrm8DuJr/Y t538WnmVGwCwxxCsh0FyMEhcpsNvz4y695tzxE6iA8KNTPKkbl0WtMYHO1Vy293TzjxhKK IefqB4YeBuzxFRT3e+c4huf7vPAWq7cp7rCn2MA2ajSAKA8D83jJ0wZiN4TQBACw1al/3q /70PCb9JFyemtTFAxB8CY/Ql6UOkAOeBqt+Js37orNw/PKrpGu6bZBXdmGQRUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTN0T90zkKl; Thu, 16 Jan 2025 18:08: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 50GI8d0G092913; Thu, 16 Jan 2025 18:08:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8dpG092910; Thu, 16 Jan 2025 18:08:39 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:39 GMT Message-Id: <202501161808.50GI8dpG092910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 76d0aed16439 - stable/14 - libprocstat: ZFS support: Makefile: Tidy up a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 76d0aed16439c58c4919973436400b067ad434cc Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=76d0aed16439c58c4919973436400b067ad434cc commit 76d0aed16439c58c4919973436400b067ad434cc Author: Olivier Certner AuthorDate: 2024-12-12 21:37:14 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:02 +0000 libprocstat: ZFS support: Makefile: Tidy up a bit Regroup assignments tweaking preprocessor defines/undefs, and separately those about include directories. Re-order include directories a bit more logically, and remove redundant ones. Separate logical groups by blank lines. Build artifacts have been verified to stay the same when produced with an external LLVM 18 toolchain. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48070 (cherry picked from commit 618c97b87b7124cdfb10d2f33a213c3302c8a98b) --- lib/libprocstat/zfs/Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/libprocstat/zfs/Makefile b/lib/libprocstat/zfs/Makefile index da689fdd3e81..10448b0bfab9 100644 --- a/lib/libprocstat/zfs/Makefile +++ b/lib/libprocstat/zfs/Makefile @@ -6,19 +6,23 @@ OBJS= zfs_defs.o WARNS?= 1 -CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -I. -I${.CURDIR} +# We fake a kernel compilation environment in order to get the definition for +# 'zpool_t'. +CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -UKLD_TIED -DKLD_MODULE +CFLAGS+= -DHAVE_ISSETUGID -D_SYS_VMEM_H_ + +CFLAGS+= -fno-builtin -nostdlib + +CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include - -CFLAGS+= -I${SRCTOP}/sys -I. -I.. CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include -CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID -D_SYS_VMEM_H_ -UKLD_TIED -DKLD_MODULE +CFLAGS+= -I${SRCTOP}/sys -I. -I.. -CFLAGS+= -fno-builtin -nostdlib +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h all: ${OBJS} CLEANFILES= ${OBJS} From nobody Thu Jan 16 18:08:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrTP4pxTz5kl5T; Thu, 16 Jan 2025 18:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrTP2R1yz3S7B; Thu, 16 Jan 2025 18:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAAM3dMnetFM1s2ONpJbXQh4SGgf91L9izquQb291wQ=; b=XFalc3XDlt6XNYcnnXnwBPd1UWz4+sHOw6bhMX5gZRIjqewcGti8olm6LYyHOuSU3C8t95 0AcTmsq80MpeHcejXWvMGqPxhS7QRkpdxGn/pyqCcqpc+LP0WS1HMSkNB7AsbYczL4Bu/Q oIGJa7uZx0IqEh1HyU5LClQDU+ZChZnEgdsv0j4ZW+gunZ72GJ/dB5MmC2pJbsQ7zbmwhf 7DjopfUoPQXZGtO4Jh61kD/koRYKemHshNJnTwL+/jdPD3NS2uKcM93iKlo7A7qtx4v+20 usfmcqrLmOQMLQbboEqbLjaTKNiIu9hRa+LioCGzkkIEJeMK0tFKKhNb587/Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737050921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YAAM3dMnetFM1s2ONpJbXQh4SGgf91L9izquQb291wQ=; b=aAIGqVh155vkYIjFDDZs2zHA/zUTmeds5WGAjPLjc6RWnUOA0IC/Epb7SkV4LPZB3L2YKI RQv0sW1rtSwBRNpXzLG4rUmGsup8lwRvjkIsCjHNTI4MdV1ngyVttHhNpADjii55a+x0yH Xx0KTfH9KGbQCmw6agAhTNK5Fi2IXdxd5sq1UD/eZYw0kpYDnn5fSCuKi94h03jvZo3CvC PnRdOR7aFQnnbpD/tecfoyUeqRywmG9SF9RIfO0Y0AxfhSuDXEuJ0OLgkU2Q3R55nBnEZh 9TH75Z1iGauFjmANLKZcp5J1AnRJ9y+bOjjhpTf+RLcc8sph228trOE+m9mPhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737050921; a=rsa-sha256; cv=none; b=L/f7Cil94iFOBqYe6QnGyQeJcassCgiNg1kEx/8noRNTZQ1amhBmFiqVnw1kIUTwn2nP3x uhTf3LFHdGAbK4eT/2OuoK/JDZ+hloIJosMBR2o9Q5Gj2KDJHnjmZPnZiNzPyF12vDaICq LB1zlOGYQVifvya8jLbvGN/ezbb/XgebtG1ihxH9CiMzEkSxoLsKyn8+qJjFcz/fB4ynhb kLm8CBC8FmN9Xlc6KeQ00+iFLaXsHE/xxDyqPoV0g8b9FK4Jvp3OFF4XASS1fQ/YKDsbf3 ZScMxqz3XFbjmylt2H9MBquEsTiV6ojnglPrir/JOrMBNf+zqbwxIn+RmOwEUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrTP1RcdzkKm; Thu, 16 Jan 2025 18:08: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 50GI8fik092957; Thu, 16 Jan 2025 18:08:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GI8fon092954; Thu, 16 Jan 2025 18:08:41 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:08:41 GMT Message-Id: <202501161808.50GI8fon092954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 5e6079209e9b - stable/14 - tmpfs: Rework file handles List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5e6079209e9b6db2bd2980e1b97e7cb4cf8b5364 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5e6079209e9b6db2bd2980e1b97e7cb4cf8b5364 commit 5e6079209e9b6db2bd2980e1b97e7cb4cf8b5364 Author: Olivier Certner AuthorDate: 2024-12-06 20:23:59 +0000 Commit: Olivier Certner CommitDate: 2025-01-16 18:07:02 +0000 tmpfs: Rework file handles Change 'struct tmpfs_fid_data' to behave consistently with the private structure other FSes use. In a nutshell, make it a full alias of 'struct fid', instead of just using it to fill 'fid_data'. This implies adding a length field at start (aliasing 'fid_len' of 'struct fid'), and filling 'fid_len' with the full size of the aliased structure. To ensure that the new 'struct tmpfs_fid_data' is smaller than 'struct fid', which the compile-time assert introduced in commit 91b5592a1e1af974 ("fs: Add static asserts for the size of fid structures") checks (and thus was not strong enough when added), use '__packed'. A consequence of this change is that copying the 'struct tmpfs_fid_data' into a stack-allocated variable becomes unnecessary, we simply rely on the compiler emitting the proper code on seeing '__packed' (and on the start of 'struct tmpfs_fid_data' being naturally aligned, which is normally guaranteed by kernel's malloc() and/or inclusion in 'struct fhandle'). Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47956 (cherry picked from commit 1ccbdf561f417f9fe802131d5b1756ac45fd314d) --- sys/fs/tmpfs/tmpfs.h | 5 ++--- sys/fs/tmpfs/tmpfs_vfsops.c | 16 ++++++---------- sys/fs/tmpfs/tmpfs_vnops.c | 16 ++++------------ 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 7ebdffbec84f..277cb599d78b 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -439,11 +439,10 @@ struct tmpfs_mount { * NFS code. */ struct tmpfs_fid_data { + unsigned short tfd_len; ino_t tfd_id; unsigned long tfd_gen; -}; -_Static_assert(sizeof(struct tmpfs_fid_data) <= MAXFIDSZ, - "(struct tmpfs_fid_data) is larger than (struct fid).fid_data"); +} __packed; struct tmpfs_dir_cursor { struct tmpfs_dirent *tdc_current; diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 65d54b446849..c404eb81a8d2 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -586,29 +586,25 @@ static int tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) { - struct tmpfs_fid_data tfd; + struct tmpfs_fid_data *tfd; struct tmpfs_mount *tmp; struct tmpfs_node *node; int error; - if (fhp->fid_len != sizeof(tfd)) + if (fhp->fid_len != sizeof(*tfd)) return (EINVAL); - /* - * Copy from fid_data onto the stack to avoid unaligned pointer use. - * See the comment in sys/mount.h on struct fid for details. - */ - memcpy(&tfd, fhp->fid_data, fhp->fid_len); + tfd = (struct tmpfs_fid_data *)fhp; tmp = VFS_TO_TMPFS(mp); - if (tfd.tfd_id >= tmp->tm_nodes_max) + if (tfd->tfd_id >= tmp->tm_nodes_max) return (EINVAL); TMPFS_LOCK(tmp); LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { - if (node->tn_id == tfd.tfd_id && - node->tn_gen == tfd.tfd_gen) { + if (node->tn_id == tfd->tfd_id && + node->tn_gen == tfd->tfd_gen) { tmpfs_ref_node(node); break; } diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 4571a2855be3..729feb0329a4 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1684,23 +1684,15 @@ vop_vptofh { }; */ { - struct tmpfs_fid_data tfd; + struct tmpfs_fid_data *const tfd = (struct tmpfs_fid_data *)ap->a_fhp; struct tmpfs_node *node; - struct fid *fhp; _Static_assert(sizeof(struct tmpfs_fid_data) <= sizeof(struct fid), "struct tmpfs_fid_data cannot be larger than struct fid"); node = VP_TO_TMPFS_NODE(ap->a_vp); - fhp = ap->a_fhp; - fhp->fid_len = sizeof(tfd); - - /* - * Copy into fid_data from the stack to avoid unaligned pointer use. - * See the comment in sys/mount.h on struct fid for details. - */ - tfd.tfd_id = node->tn_id; - tfd.tfd_gen = node->tn_gen; - memcpy(fhp->fid_data, &tfd, fhp->fid_len); + tfd->tfd_len = sizeof(*tfd); + tfd->tfd_gen = node->tn_gen; + tfd->tfd_id = node->tn_id; return (0); } From nobody Thu Jan 16 18:10:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYrWh2pxBz5kl81; Thu, 16 Jan 2025 18:10:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYrWg5TkGz3XKd; Thu, 16 Jan 2025 18:10:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737051039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlmVV0DkmL+iY5QnxwnW2BirTzTTW21CFLonyxoUiO4=; b=pmRhcDGkq5scHECdSrTnkUn9vLbS4k4yq1GxtnI3ylmKZj7u7V3m+pbO284RAC+MbBzmCM hIXygNrFIE+9LWxh7y/IlchOATGj4uWni6dljrtKGri2xvmrRrahL8KSi+c5RdyZNLLUKQ MBA9F4O1ELBKP4QvE6G+yRNDyY+Fvf5THEJCng7ocQxZt00JvJ17iPg1bJ7wt2MoT7S2RJ 3xI1mgkxzcRoKBsYwMEmymiWvgab0m6iJBNB0iqhsoZwPE/3XZq4k+mAK1rF7PxkSlSlL2 XwThNmf6Fu75hsggxRkFZapvJuZ2OgSDrm/ym+W6saSqG/anowMcdrQyEmrPzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737051039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dlmVV0DkmL+iY5QnxwnW2BirTzTTW21CFLonyxoUiO4=; b=llGWuKa8rasHea+OGQYvc0ZHzjai8PUfQydwmbXsFY8a7Aa5w9GSeHJ9oU9x0/RzwJPGbP Xa5jAG09S4ToUuZwxql+ETqFDfjeHSVAYHM1ofM4tbpYwsfSmA4JOM3GUy9ue6p4btOIH9 OyY+Wjxby0Pm7G80KD0t2DdexT/URv+k6wzVFmEzjstGSGTy6vOLe1rBbaZEZ1oqpIB5ac sS6YaY4LFPv9sGFM6fPa+IaATsoPrl6QbUs75GWv5bge+zyvsCewkezn/qyvobEP9YUhWH WBxwDYbt8YNNwS98tKn2MEKLxIaQ+UsBVx3GOZ7jqmz7GTuUmd17DfEIgD2hYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737051039; a=rsa-sha256; cv=none; b=XHk1O7ZmNPPWn4SLWvfheXjFi39XXKPoVV9KSdpA3KNqc1bGe40uxuWVnpCfzVd0ewFmDz qE5j5NYSxF8i8SnTUrDC2vM6ouwUIfdVUS4noAbqiOZdKyCHSmSeSuu9naQ/17zlb4A8yN kUpcXYLNzs9eJqthZ+Hm4FA9EE0V894Xi+dg/c1iu+LaPprcWgR2W22Xore83j843EiyGC 4Xm5OayoyWT26IU1bDcEu8QJXH8PdcSrgluOzqdPe+wCeK3796HQQsTGU2X3mqfkpfPtYX f3m10wYg2JYE3nY7I+TOu5GWNr5Fa+UfLACjQ/9KZjfLtfxQeaJM0kNA74yAuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYrWg4v0KzkKr; Thu, 16 Jan 2025 18:10: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 50GIAdAK002518; Thu, 16 Jan 2025 18:10:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GIAdWV002515; Thu, 16 Jan 2025 18:10:39 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:10:39 GMT Message-Id: <202501161810.50GIAdWV002515@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: 8be18c2d5a63 - main - sys/net: fix several sysinit_cfunc_t signature mismatches List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8be18c2d5a63859c83aaceb66377e3c9820bfe48 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8be18c2d5a63859c83aaceb66377e3c9820bfe48 commit 8be18c2d5a63859c83aaceb66377e3c9820bfe48 Author: SHENGYI HONG AuthorDate: 2025-01-16 17:49:04 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-16 18:10:09 +0000 sys/net: fix several sysinit_cfunc_t signature mismatches Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D48490 --- sys/net/dummymbuf.c | 4 ++-- sys/net/if_ethersubr.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/dummymbuf.c b/sys/net/dummymbuf.c index d73566759ed3..ff566cfb87c3 100644 --- a/sys/net/dummymbuf.c +++ b/sys/net/dummymbuf.c @@ -437,7 +437,7 @@ dmb_pfil_uninit(void) } static void -vnet_dmb_init(void *unused __unused) +vnet_dmb_init(const void *unused __unused) { sx_init(&V_dmb_rules_lock, "dummymbuf rules"); V_dmb_hits = counter_u64_alloc(M_WAITOK); @@ -447,7 +447,7 @@ VNET_SYSINIT(vnet_dmb_init, SI_SUB_PROTO_PFIL, SI_ORDER_ANY, vnet_dmb_init, NULL); static void -vnet_dmb_uninit(void *unused __unused) +vnet_dmb_uninit(const void *unused __unused) { dmb_pfil_uninit(); counter_u64_free(V_dmb_hits); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 6cd5cefa9609..ddaa94414ca5 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -759,7 +759,7 @@ ether_init(__unused void *arg) SYSINIT(ether, SI_SUB_INIT_IF, SI_ORDER_ANY, ether_init, NULL); static void -vnet_ether_init(__unused void *arg) +vnet_ether_init(const __unused void *arg) { struct pfil_head_args args; @@ -778,7 +778,7 @@ VNET_SYSINIT(vnet_ether_init, SI_SUB_PROTO_IF, SI_ORDER_ANY, #ifdef VIMAGE static void -vnet_ether_pfil_destroy(__unused void *arg) +vnet_ether_pfil_destroy(const __unused void *arg) { pfil_head_unregister(V_link_pfil_head); From nobody Thu Jan 16 18:45:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYsHQ7035z5kn2G; Thu, 16 Jan 2025 18:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYsHQ5rJCz3fn2; Thu, 16 Jan 2025 18:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737053106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZJzGhhp5CronxMLkF9/Wwez6j9nsNUAteZqCPQvMTyg=; b=SdFFH/cA0np58EKEk9fCUmZtsCwQdMuB3w2O7F8flmww6McvDpd/Te3jKMs3GiTbzcVNIx gOX9dr4tUUarm270TiTKb8QNLAV7qeMkWvFKT8NQJMaxJJDYBVVTPCcYLrmpdOToRdivz3 5YbWC4LkoxvyuTtx7dUm3QtP79Kxxk0dj9FlopbP/b3GoQJA5XgjP6scTTDzZuXuHN6sDA KmlMS7WFKLnFpr+diEedZZs2kHyLsqK6JI6LOkcPDxVJ97m8nFyDFVD5GDu38ZDhwOB7cf hrQclV2pKErqWok2HKohB+8J7G75daqOJo6q1XjIgujUbkwMf3FAW2PidVtrQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737053106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZJzGhhp5CronxMLkF9/Wwez6j9nsNUAteZqCPQvMTyg=; b=BCU4GPIu6luvpn6gsnyX9uVPhwmxDGbsL7BsngZUDwkaAk9He43XwMnp0a11aVjTOp97GS iPcppd+bg+KIQcEu2iOSO+kh6EZPiozYrSftUNeirpVhthBY7sR9paEUYbJ4YOoRRv3pjN CpU6reLA6jzFlfrs2MssSf+XbxTYb99xpgh+iWTwqG0oV3euF0Aiq8AsQmcDbCUVrsTKq9 7ewHv4pyAl0MRVWJuqh0NkI2WEisXti/u7NMkGk1vO89CgnQjrZEkkKjDkB5KfV5UPLmns XDDDe+Qrnpz+IH5CyS41+gl9ZRqlQn1BIeVBDlbpEKqG4upJKhs5/xt6zVj12g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737053106; a=rsa-sha256; cv=none; b=c/iukOuZEh1iY2cRjMvOnl9ylfbAzHoGl//2PliDvqEAcy3IXGDrivxp1BezJKcQ1Rz0Kw YD0up15uUHJ88rm9aOpXIrJixSrnyQWMJO4QnR35eqizjeXyXFIRD2QLPI14YnZirEWUbn e+1Pq4B/5QNj2t8TyHf9zmcn769tqO+teLGkkzBYNQ5QkbX75EDqhFWgPldirHsuO2z0K+ QCO8nwzOW7PXfVknF3jTdNcMeESFQyrB212iWDwvQ9k1aVsC/OUY5lAdpFnU2hzEQlji/X AFwavTVDZsy3z4mq2E8G1rdHYlfk2FUkibHrfb/trA3OWBwk4R3NJ3MT534y2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYsHQ5GW9zlJd; Thu, 16 Jan 2025 18:45: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 50GIj6dR067127; Thu, 16 Jan 2025 18:45:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GIj6TW067124; Thu, 16 Jan 2025 18:45:06 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:45:06 GMT Message-Id: <202501161845.50GIj6TW067124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 661ca921e8cd - main - Fix backward compatibility with UFS1 filesystems created before June 2002 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 661ca921e8cd56b17fc6615bc7e596e56e0e7c31 Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=661ca921e8cd56b17fc6615bc7e596e56e0e7c31 commit 661ca921e8cd56b17fc6615bc7e596e56e0e7c31 Author: Kirk McKusick AuthorDate: 2025-01-16 18:43:48 +0000 Commit: Kirk McKusick CommitDate: 2025-01-16 18:44:35 +0000 Fix backward compatibility with UFS1 filesystems created before June 2002 The code to handle compatibility with old filesystems exists and does the right things. The loss of compatibility was introduced 2.5 years ago when the superblock integrity checks were added. The problem is that the compatibility code was being run after the new integrity checks rather than before them. The reason that it has taken so long to show up is because it only affected filesystems created before UFS2 got added in June 2002 and that had never been mounted read-write (as their superblocks would be updated by the compatibility code if they could be written). Hence the problem was not apparent until someone tried to mount a pre-2002 virgin UFS1 filesystem image. See the Pahabricator review for more details. Reviewed-by: kib Tested-by: Peter Holm MFC-after: 1 week Differential-Revision: https://reviews.freebsd.org/D48472 --- sbin/growfs/debug.c | 2 - sys/ufs/ffs/ffs_extern.h | 2 +- sys/ufs/ffs/ffs_snapshot.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 +- sys/ufs/ffs/ffs_subr.c | 81 +++++++++++++++++++++++++++++++++++++- sys/ufs/ffs/ffs_vfsops.c | 96 +--------------------------------------------- sys/ufs/ffs/fs.h | 5 ++- 7 files changed, 88 insertions(+), 104 deletions(-) diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index bfff2acad2b5..3fe7e26e3e50 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -305,8 +305,6 @@ dbg_dump_fs(struct fs *sb, const char *comment) sb->fs_avgfilesize); fprintf(dbg_log, "avgfpdir int32_t 0x%08x\n", sb->fs_avgfpdir); - fprintf(dbg_log, "save_cgsize int32_t 0x%08x\n", - sb->fs_save_cgsize); fprintf(dbg_log, "flags int32_t 0x%08x\n", sb->fs_flags); fprintf(dbg_log, "contigsumsize int32_t 0x%08x\n", diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 112ab1107e8b..119de616003d 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -82,7 +82,7 @@ int ffs_inotovp(struct mount *, ino_t, uint64_t, int, struct vnode **, int); int ffs_isblock(struct fs *, uint8_t *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, uint8_t *, ufs1_daddr_t); -void ffs_oldfscompat_write(struct fs *, struct ufsmount *); +void ffs_oldfscompat_write(struct fs *); int ffs_own_mount(const struct mount *mp); int ffs_sbsearch(void *, struct fs **, int, struct malloc_type *, int (*)(void *, off_t, void **, int)); diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index f4eed782f7bc..31823458ed8a 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -838,7 +838,7 @@ resumefs: copy_fs->fs_fmod = 0; bpfs = (struct fs *)&nbp->b_data[loc]; bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (uint64_t)fs->fs_sbsize); - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 98ad4269b5f2..751b6e42a347 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -9937,7 +9937,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) if (pino == 0) { bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, @@ -9969,7 +9969,7 @@ clear_unlinked_inodedep( struct inodedep *inodedep) (int)fs->fs_sbsize, 0, 0, 0); bcopy((caddr_t)fs, bp->b_data, (uint64_t)fs->fs_sbsize); bpfs = (struct fs *)bp->b_data; - ffs_oldfscompat_write(bpfs, ump); + ffs_oldfscompat_write(bpfs); softdep_setup_sbupdate(ump, bpfs, bp); /* * Because we may have made changes to the superblock, diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index bcb4d25c8ad9..7c2971d885ea 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -123,6 +123,7 @@ ffs_update_dinode_ckhash(struct fs *fs, struct ufs2_dinode *dip) static off_t sblock_try[] = SBLOCKSEARCH; static int readsuper(void *, struct fs **, off_t, int, int (*)(void *, off_t, void **, int)); +static void ffs_oldfscompat_read(struct fs *, ufs2_daddr_t); static int validate_sblock(struct fs *, int); /* @@ -268,6 +269,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, if (fs->fs_magic == FS_UFS1_MAGIC && (flags & UFS_ALTSBLK) == 0 && fs->fs_bsize == SBLOCK_UFS2 && sblockloc == SBLOCK_UFS2) return (ENOENT); + ffs_oldfscompat_read(fs, sblockloc); if ((error = validate_sblock(fs, flags)) > 0) return (error); /* @@ -316,6 +318,83 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int flags, return (0); } +/* + * Sanity checks for loading old filesystem superblocks. + * See ffs_oldfscompat_write below for unwound actions. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +static void +ffs_oldfscompat_read(struct fs *fs, ufs2_daddr_t sblockloc) +{ + uint64_t maxfilesize; + + /* + * If not yet done, update fs_flags location and value of fs_sblockloc. + */ + if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { + fs->fs_flags = fs->fs_old_flags; + fs->fs_old_flags |= FS_FLAGS_UPDATED; + fs->fs_sblockloc = sblockloc; + } + /* + * If not yet done, update UFS1 superblock with new wider fields. + */ + if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { + fs->fs_maxbsize = fs->fs_bsize; + fs->fs_time = fs->fs_old_time; + fs->fs_size = fs->fs_old_size; + fs->fs_dsize = fs->fs_old_dsize; + fs->fs_csaddr = fs->fs_old_csaddr; + fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; + fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; + fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; + fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; + } + if (fs->fs_magic == FS_UFS1_MAGIC && + fs->fs_old_inodefmt < FS_44INODEFMT) { + fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; + fs->fs_qbmask = ~fs->fs_bmask; + fs->fs_qfmask = ~fs->fs_fmask; + } + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_save_maxfilesize = fs->fs_maxfilesize; + maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; + if (fs->fs_maxfilesize > maxfilesize) + fs->fs_maxfilesize = maxfilesize; + } + /* Compatibility for old filesystems */ + if (fs->fs_avgfilesize <= 0) + fs->fs_avgfilesize = AVFILESIZ; + if (fs->fs_avgfpdir <= 0) + fs->fs_avgfpdir = AFPDIR; +} + +/* + * Unwinding superblock updates for old filesystems. + * See ffs_oldfscompat_read above for details. + * + * XXX - Parts get retired eventually. + * Unfortunately new bits get added. + */ +void +ffs_oldfscompat_write(struct fs *fs) +{ + + /* + * Copy back UFS2 updated fields that UFS1 inspects. + */ + if (fs->fs_magic == FS_UFS1_MAGIC) { + fs->fs_old_time = fs->fs_time; + fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; + fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; + fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; + fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; + fs->fs_maxfilesize = fs->fs_save_maxfilesize; + } +} + /* * Verify the filesystem values. */ @@ -561,7 +640,7 @@ validate_sblock(struct fs *fs, int flags) sizepb *= NINDIR(fs); maxfilesize += sizepb; } - WCHK(fs->fs_maxfilesize, !=, maxfilesize, %jd); + WCHK(fs->fs_maxfilesize, >, maxfilesize, %jd); /* * These values have a tight interaction with each other that * makes it hard to tightly bound them. So we can only check diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index a739e0220ec9..da079ce1efb6 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -83,8 +83,6 @@ static uma_zone_t uma_inode, uma_ufs1, uma_ufs2; VFS_SMR_DECLARE; static int ffs_mountfs(struct vnode *, struct mount *, struct thread *); -static void ffs_oldfscompat_read(struct fs *, struct ufsmount *, - ufs2_daddr_t); static void ffs_ifree(struct ufsmount *ump, struct inode *ip); static int ffs_sync_lazy(struct mount *mp); static int ffs_use_bread(void *devfd, off_t loc, void **bufp, int size); @@ -795,7 +793,6 @@ ffs_reload(struct mount *mp, int flags) fs = VFSTOUFS(mp)->um_fs = newfs; ump->um_bsize = fs->fs_bsize; ump->um_maxsymlinklen = fs->fs_maxsymlinklen; - ffs_oldfscompat_read(fs, VFSTOUFS(mp), fs->fs_sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { printf("WARNING: %s: reload pending error: blocks %jd " @@ -1010,7 +1007,6 @@ ffs_mountfs(struct vnode *odevvp, struct mount *mp, struct thread *td) ump->um_check_blkno = NULL; mtx_init(UFS_MTX(ump), "FFS", "FFS Lock", MTX_DEF); sx_init(&ump->um_checkpath_lock, "uchpth"); - ffs_oldfscompat_read(fs, ump, fs->fs_sblockloc); fs->fs_ronly = ronly; fs->fs_active = NULL; mp->mnt_data = ump; @@ -1219,96 +1215,6 @@ ffs_use_bread(void *devfd, off_t loc, void **bufp, int size) return (0); } -static int bigcgs = 0; -SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, ""); - -/* - * Sanity checks for loading old filesystem superblocks. - * See ffs_oldfscompat_write below for unwound actions. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -static void -ffs_oldfscompat_read(struct fs *fs, - struct ufsmount *ump, - ufs2_daddr_t sblockloc) -{ - off_t maxfilesize; - - /* - * If not yet done, update fs_flags location and value of fs_sblockloc. - */ - if ((fs->fs_old_flags & FS_FLAGS_UPDATED) == 0) { - fs->fs_flags = fs->fs_old_flags; - fs->fs_old_flags |= FS_FLAGS_UPDATED; - fs->fs_sblockloc = sblockloc; - } - /* - * If not yet done, update UFS1 superblock with new wider fields. - */ - if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_maxbsize != fs->fs_bsize) { - fs->fs_maxbsize = fs->fs_bsize; - fs->fs_time = fs->fs_old_time; - fs->fs_size = fs->fs_old_size; - fs->fs_dsize = fs->fs_old_dsize; - fs->fs_csaddr = fs->fs_old_csaddr; - fs->fs_cstotal.cs_ndir = fs->fs_old_cstotal.cs_ndir; - fs->fs_cstotal.cs_nbfree = fs->fs_old_cstotal.cs_nbfree; - fs->fs_cstotal.cs_nifree = fs->fs_old_cstotal.cs_nifree; - fs->fs_cstotal.cs_nffree = fs->fs_old_cstotal.cs_nffree; - } - if (fs->fs_magic == FS_UFS1_MAGIC && - fs->fs_old_inodefmt < FS_44INODEFMT) { - fs->fs_maxfilesize = ((uint64_t)1 << 31) - 1; - fs->fs_qbmask = ~fs->fs_bmask; - fs->fs_qfmask = ~fs->fs_fmask; - } - if (fs->fs_magic == FS_UFS1_MAGIC) { - ump->um_savedmaxfilesize = fs->fs_maxfilesize; - maxfilesize = (uint64_t)0x80000000 * fs->fs_bsize - 1; - if (fs->fs_maxfilesize > maxfilesize) - fs->fs_maxfilesize = maxfilesize; - } - /* Compatibility for old filesystems */ - if (fs->fs_avgfilesize <= 0) - fs->fs_avgfilesize = AVFILESIZ; - if (fs->fs_avgfpdir <= 0) - fs->fs_avgfpdir = AFPDIR; - if (bigcgs) { - fs->fs_save_cgsize = fs->fs_cgsize; - fs->fs_cgsize = fs->fs_bsize; - } -} - -/* - * Unwinding superblock updates for old filesystems. - * See ffs_oldfscompat_read above for details. - * - * XXX - Parts get retired eventually. - * Unfortunately new bits get added. - */ -void -ffs_oldfscompat_write(struct fs *fs, struct ufsmount *ump) -{ - - /* - * Copy back UFS2 updated fields that UFS1 inspects. - */ - if (fs->fs_magic == FS_UFS1_MAGIC) { - fs->fs_old_time = fs->fs_time; - fs->fs_old_cstotal.cs_ndir = fs->fs_cstotal.cs_ndir; - fs->fs_old_cstotal.cs_nbfree = fs->fs_cstotal.cs_nbfree; - fs->fs_old_cstotal.cs_nifree = fs->fs_cstotal.cs_nifree; - fs->fs_old_cstotal.cs_nffree = fs->fs_cstotal.cs_nffree; - fs->fs_maxfilesize = ump->um_savedmaxfilesize; - } - if (bigcgs) { - fs->fs_cgsize = fs->fs_save_cgsize; - fs->fs_save_cgsize = 0; - } -} - /* * unmount system call */ @@ -2192,7 +2098,7 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size) UFS_UNLOCK(ump); fs = (struct fs *)bp->b_data; fs->fs_fmod = 0; - ffs_oldfscompat_write(fs, ump); + ffs_oldfscompat_write(fs); fs->fs_si = NULL; /* Recalculate the superblock hash */ fs->fs_ckhash = ffs_calc_sbhash(fs); diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 8a1b5be18bc2..c092688c475b 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -411,7 +411,8 @@ struct fs { int64_t fs_unrefs; /* number of unreferenced inodes */ int64_t fs_providersize; /* size of underlying GEOM provider */ int64_t fs_metaspace; /* size of area reserved for metadata */ - int64_t fs_sparecon64[13]; /* old rotation block list head */ + uint64_t fs_save_maxfilesize; /* save old UFS1 maxfilesize */ + int64_t fs_sparecon64[12]; /* old rotation block list head */ int64_t fs_sblockactualloc; /* byte offset of this superblock */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ @@ -424,7 +425,7 @@ struct fs { uint32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */ uint32_t fs_avgfilesize; /* expected average file size */ uint32_t fs_avgfpdir; /* expected # of files per directory */ - int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */ + uint32_t fs_available_spare; /* old scratch space */ ufs_time_t fs_mtime; /* Last mount or fsck time. */ int32_t fs_sujfree; /* SUJ free list */ int32_t fs_sparecon32[21]; /* reserved for future constants */ From nobody Thu Jan 16 18:54:28 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYsVD2nJ1z5knHt; Thu, 16 Jan 2025 18:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYsVD25z3z3gdv; Thu, 16 Jan 2025 18:54:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737053668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KbER20RrjMZ9Sd/sBjVBx329Jojk3Fpmi1OATEGjncM=; b=ucXovKhTGGBerclkNvkBsTJpgIzs+7OuH0xX1FVuq+YrWy0kYkvNFfZp8IfY3fQrg6NAkK WiQSKTsdvFgSmIUazvhgsfsW3Ttj2HodL/K9zdk8l71XwF44tD7usi4C9j0EqtPPhMcqsY 8ui/AaRty5tsppYMgdD5OrO503N2/5jgNnFQHwSJWpQV1CynzVda0SNoIuh/7cP/RFXBLk xVpgBdc7CqO4NyBXQ1RU/dnjvNlQSa56X/FTrDt3JLFFdiWXg4Z2XtrK8sQk/3aErd7QTS TgmdTKGbjfXPbQFQOv1329EdvPFSaA51lpsqQYw9uTOKITEOS41iGyKKEjC+xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737053668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KbER20RrjMZ9Sd/sBjVBx329Jojk3Fpmi1OATEGjncM=; b=LOoiP4Cprt3U3KeQ3N/5q3HS1gsjcPtxst4bgOykKeVVxVbttKu7/+bdzQS3uRT2HI0yIM HmlKAxXF4p7iiOC/NqcqCuF5FsVEkgYC0iSSnAZNmitNcwmQR3nqqcpSJbgfzKnTm8yAba 2X3PK7lEEM+RQ9mLbsudFnAozGfN4qTcjeQbTRG6e2+q0P/PfdWENN1OWUqwCmNQ8/jb4O oMUavrCwgrYCjHyzO1VSAkFo/44UZysRb5MrlDA07QNUSR+iv+tl/k7aHow3M1xeEGUn4X j4aXuC/iATcWKjH7CT77HFoVZiJI3fRyQ83kGTfiuOLLf1DkPEelPG8UYcUkNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737053668; a=rsa-sha256; cv=none; b=Ve7NhAK54fKywY/2wXGGaqdbd9Wu+wsZ2cxzcS49GC9j2JeJEqfOSQQ64u+P4pVGtccj7H 3f9yKawQQ2XvVYcECTM12omr73TTp2PKRklLhlBfxnaHUeGsu8a5PJh24BLPdVaf5Kf/nw F13aGatcevonQ6K9RAIlTUhq3O2SNAH7HAbG+IygBmKjNVHjkHXCvilj4VmXOuKwBNZqUK O/vOchaX0jdIsnYISddrcaYJy6YM3d7mGjnpbApDIuuB/HNdhnf3qUWJeJExSLMql/GC8z shS9QtAzJn/uSm+NckHm0mbJxVOYDBkwPYEHkNIy6Cl3jv8C8nkss/Lqlen4JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYsVD1YP3zlKN; Thu, 16 Jan 2025 18:54: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 50GIsSY5085878; Thu, 16 Jan 2025 18:54:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GIsSH9085875; Thu, 16 Jan 2025 18:54:28 GMT (envelope-from git) Date: Thu, 16 Jan 2025 18:54:28 GMT Message-Id: <202501161854.50GIsSH9085875@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: b4663a8d1117 - main - stat(2): add st_filerev List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4663a8d111767206bb3ebcfec5b95a6b88bc720 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b4663a8d111767206bb3ebcfec5b95a6b88bc720 commit b4663a8d111767206bb3ebcfec5b95a6b88bc720 Author: Konstantin Belousov AuthorDate: 2025-01-13 21:14:04 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-16 18:54:20 +0000 stat(2): add st_filerev Reviewed by: asomers, markj, olce, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D48452 --- sys/compat/freebsd32/freebsd32.h | 3 ++- sys/compat/freebsd32/freebsd32_misc.c | 1 + sys/fs/tmpfs/tmpfs_vnops.c | 1 + sys/kern/kern_descrip.c | 1 + sys/kern/vfs_default.c | 2 ++ sys/kern/vfs_subr.c | 1 + sys/sys/stat.h | 3 ++- sys/sys/vnode.h | 1 + sys/ufs/ufs/ufs_vnops.c | 2 ++ 9 files changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index e1bfe282c4b1..3dbf1b5a876d 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -240,7 +240,8 @@ struct stat32 { uint32_t st_blksize; uint32_t st_flags; uint64_t st_gen; - uint64_t st_spare[10]; + uint64_t st_filerev; + uint64_t st_spare[9]; }; struct freebsd11_stat32 { uint32_t st_dev; diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 4cd706e16155..e5b2b0feeafd 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2251,6 +2251,7 @@ copy_stat(struct stat *in, struct stat32 *out) CP(*in, *out, st_blksize); CP(*in, *out, st_flags); CP(*in, *out, st_gen); + CP(*in, *out, st_filerev); TS_CP(*in, *out, st_birthtim); out->st_padding0 = 0; out->st_padding1 = 0; diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 83e43ec7ba13..c99d0732be50 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -476,6 +476,7 @@ tmpfs_stat(struct vop_stat_args *v) sb->st_blksize = PAGE_SIZE; sb->st_flags = node->tn_flags; sb->st_gen = node->tn_gen; + sb->st_filerev = 0; if (vp->v_type == VREG) { #ifdef __ILP32__ vm_object_t obj = node->tn_reg.tn_aobj; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 10e0b4b142f8..f87ad1f45143 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1620,6 +1620,7 @@ kern_fstat(struct thread *td, int fd, struct stat *sbp) AUDIT_ARG_FILE(td->td_proc, fp); + sbp->st_filerev = 0; error = fo_stat(fp, sbp, td->td_ucred); fdrop(fp, td); #ifdef __STAT_TIME_T_EXT diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 4067ab4ba446..5e6516921002 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1511,6 +1511,7 @@ vop_stdstat(struct vop_stat_args *a) vap->va_fsid = VNOVAL; vap->va_gen = 0; vap->va_rdev = NODEV; + vap->va_filerev = 0; error = VOP_GETATTR(vp, vap, a->a_active_cred); if (error) @@ -1587,6 +1588,7 @@ vop_stdstat(struct vop_stat_args *a) sb->st_flags = vap->va_flags; sb->st_blocks = vap->va_bytes / S_BLKSIZE; sb->st_gen = vap->va_gen; + sb->st_filerev = vap->va_filerev; out: return (vop_stat_helper_post(a, error)); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index feb808c0d4c7..ef51fdba8e7c 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1200,6 +1200,7 @@ vattr_null(struct vattr *vap) vap->va_flags = VNOVAL; vap->va_gen = VNOVAL; vap->va_vaflags = 0; + vap->va_filerev = VNOVAL; } /* diff --git a/sys/sys/stat.h b/sys/sys/stat.h index dabf121f45fe..15b7ec99bdd9 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -185,7 +185,8 @@ struct stat { blksize_t st_blksize; /* optimal blocksize for I/O */ fflags_t st_flags; /* user defined flags for file */ __uint64_t st_gen; /* file generation number */ - __uint64_t st_spare[10]; + __uint64_t st_filerev; /* file revision, incr on changes */ + __uint64_t st_spare[9]; }; #ifdef _KERNEL diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 42973adac287..00f8a1eabc4e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -989,6 +989,7 @@ void vop_rename_fail(struct vop_rename_args *ap); ap->a_sb->st_padding0 = 0; \ ap->a_sb->st_padding1 = 0; \ bzero(_ap->a_sb->st_spare, sizeof(_ap->a_sb->st_spare)); \ + ap->a_sb->st_filerev = 0; \ } \ _error; \ }) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 0bca40199071..9aea01e70951 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -549,6 +549,7 @@ ufs_stat(struct vop_stat_args *ap) sb->st_birthtim.tv_sec = -1; sb->st_birthtim.tv_nsec = 0; sb->st_blocks = dbtob((uint64_t)ip->i_din1->di_blocks) / S_BLKSIZE; + sb->st_filerev = ip->i_din1->di_modrev; } else { sb->st_rdev = ip->i_din2->di_rdev; sb->st_size = ip->i_din2->di_size; @@ -559,6 +560,7 @@ ufs_stat(struct vop_stat_args *ap) sb->st_birthtim.tv_sec = ip->i_din2->di_birthtime; sb->st_birthtim.tv_nsec = ip->i_din2->di_birthnsec; sb->st_blocks = dbtob((uint64_t)ip->i_din2->di_blocks) / S_BLKSIZE; + sb->st_filerev = ip->i_din2->di_modrev; } sb->st_blksize = max(PAGE_SIZE, vp->v_mount->mnt_stat.f_iosize); From nobody Thu Jan 16 20:08:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYv7b5n0yz5ks7L; Thu, 16 Jan 2025 20:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYv7b53GMz3tZF; Thu, 16 Jan 2025 20:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737058107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xfI2LPCGQkZ7DbUY4uup4QVPJdZdGL4DFBh46Nvtn00=; b=h2gKbY9ruWyeTJixSnMuvjkqhdAt+6wqHVLoUsHVFfNJC90QGNQAInvdIEGLR59XZ+HngL nAgkU861nq7HdmJjHlgInwR0gPk1BrILSBAdpB7Ij0jchYRH03t5D+3Qt43CLZsxktJZl9 yKBaum7FTzqN3neUwVkgxhKp5tAH12hocxwT1fDNGSQdstVKJ9F6rlwFrcfDq8p9A2kNJ5 rvB4044WAY99EgWZfCiibolZFbsLyyUGOunILhnHLFzXpxFll+acmxWEmtmY0c9i+oqqQs uSiHzYWe7Fx6AMlgXZ8aXycNC8LsGlKBZp58ET88pJcMT3V8aYnc47CDXvOGiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737058107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xfI2LPCGQkZ7DbUY4uup4QVPJdZdGL4DFBh46Nvtn00=; b=qHKwvLaTa16HPAtoRT9hxPQ6dyIwo/PNrZS7NxpMHB0u7dPe0FSoBTpOPOsFenGyEHKQh6 hP2L3jc8320u1yFTOav1g42NOZ8wqo0tqk0iAg4VZ4/UZy5yBJrZAT7BKs3JNs9HX/xD/+ 6USnTGFDRGHXFRTKnAc1yTIsz5Z19X8m65mWc3e1sGd8CuQupLyHBKeF9xsURlKC0S2jts +frzo8cWAbq+hsjew5UxHYb7enoG05r1OaqnrFYMFncodYpFP4Cxdm6pTVvTATylobjO4I dreNJ8NvJxLuLvwzaORZxk0kG5d7yVRLiD/+17XcilGJ+3YjMphXmxpVwpmJ8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737058107; a=rsa-sha256; cv=none; b=Bk5Y8MnlBi5dxxtjcfQI1XTGs5ZDUILMVWw6bNljBJOdGv7+Q8maJQkGYk1sY4bMujl1HV dun9LYrrDSgxAZ4Uo85887YDstblZCXXAZ7pb3wFO6mqJu5wOcIy/gilDyjxZST43xZfFF Qd/qGZwWV20qDTfVr+IH6YmBlOiMlUH6phZuJIk3eXv74ZFF03+tn3btaU/RYcY5/NHKeh pCJwDp87Jk6yPSvezTo2x4Ip/4suQ/M0jhkPk/rMYTlDiBM7jiqg6r4UDj9sJrMA5JbUFc bixalkT59h0VZHYzGmuic4LX1KV1Kk+QXC2QmPWSjCZNt6qXWUbGc8IZ/vHy+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YYv7b4ZfjzmvQ; Thu, 16 Jan 2025 20:08: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 50GK8Rmk019126; Thu, 16 Jan 2025 20:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50GK8LI3019075; Thu, 16 Jan 2025 20:08:21 GMT (envelope-from git) Date: Thu, 16 Jan 2025 20:08:21 GMT Message-Id: <202501162008.50GK8LI3019075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 6c05f3a74f30 - main - Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c05f3a74f30934ee60919cc97e16ec69b542b06 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6c05f3a74f30934ee60919cc97e16ec69b542b06 commit 6c05f3a74f30934ee60919cc97e16ec69b542b06 Merge: b4663a8d1117 a51c056eb719 Author: Dimitry Andric AuthorDate: 2025-01-16 20:04:36 +0000 Commit: Dimitry Andric CommitDate: 2025-01-16 20:06:51 +0000 Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. PR: 280562 MFC after: 3 days contrib/llvm-project/clang/lib/Driver/Driver.cpp | 5 + .../clang/lib/Driver/ToolChains/Hexagon.cpp | 2 +- .../clang/lib/Format/UnwrappedLineParser.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 2 +- .../compiler-rt/lib/lsan/lsan_interceptors.cpp | 2 + contrib/llvm-project/libcxx/include/__config | 2 +- .../llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 2 +- .../CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 8 +- .../llvm-project/llvm/lib/MC/WasmObjectWriter.cpp | 111 +++++++++++++-------- .../lib/Target/Hexagon/HexagonISelLowering.cpp | 4 + .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 11 +- .../llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 7 ++ .../lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 17 ++-- .../llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td | 2 +- .../llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td | 5 +- .../AggressiveInstCombine.cpp | 3 +- .../lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 5 +- .../lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 +- lib/clang/include/VCSVersion.inc | 6 +- lib/clang/include/clang/Basic/Version.inc | 6 +- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +- lib/clang/include/llvm/Config/config.h | 4 +- lib/clang/include/llvm/Config/llvm-config.h | 4 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 25 files changed, 138 insertions(+), 87 deletions(-) diff --cc lib/clang/include/VCSVersion.inc index 7624a2e4b17a,000000000000..a18ba351aaab mode 100644,000000..100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@@ -1,8 -1,0 +1,8 @@@ - #define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" ++#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" +#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" + - #define CLANG_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" ++#define CLANG_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" +#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" + - #define LLDB_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" ++#define LLDB_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" +#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --cc lib/clang/include/clang/Basic/Version.inc index 5104f9d7ad7a,000000000000..92e55f9316cf mode 100644,000000..100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@@ -1,8 -1,0 +1,8 @@@ - #define CLANG_VERSION 19.1.5 - #define CLANG_VERSION_STRING "19.1.5" ++#define CLANG_VERSION 19.1.7 ++#define CLANG_VERSION_STRING "19.1.7" +#define CLANG_VERSION_MAJOR 19 +#define CLANG_VERSION_MAJOR_STRING "19" +#define CLANG_VERSION_MINOR 1 - #define CLANG_VERSION_PATCHLEVEL 5 ++#define CLANG_VERSION_PATCHLEVEL 7 + +#define CLANG_VENDOR "FreeBSD " diff --cc lib/clang/include/lld/Common/Version.inc index 31f15b8a74f8,000000000000..0643da4abbf4 mode 100644,000000..100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@@ -1,4 -1,0 +1,4 @@@ +// Local identifier in __FreeBSD_version style +#define LLD_FREEBSD_VERSION 1500001 + - #define LLD_VERSION_STRING "19.1.5 (FreeBSD llvmorg-19.1.5-0-gab4b5a2db582-" __XSTRING(LLD_FREEBSD_VERSION) ")" ++#define LLD_VERSION_STRING "19.1.7 (FreeBSD llvmorg-19.1.7-0-gcd708029e0b2-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --cc lib/clang/include/lldb/Version/Version.inc index 5aa1f29215b4,000000000000..02d44970ff54 mode 100644,000000..100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@@ -1,6 -1,0 +1,6 @@@ - #define LLDB_VERSION 19.1.5 - #define LLDB_VERSION_STRING "19.1.5" ++#define LLDB_VERSION 19.1.7 ++#define LLDB_VERSION_STRING "19.1.7" +#define LLDB_VERSION_MAJOR 19 +#define LLDB_VERSION_MINOR 1 - #define LLDB_VERSION_PATCH 5 ++#define LLDB_VERSION_PATCH 7 +/* #undef LLDB_FULL_VERSION_STRING */ diff --cc lib/clang/include/llvm/Config/config.h index f86e4b6b5946,000000000000..1968fb5072c9 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@@ -1,372 -1,0 +1,372 @@@ +#ifndef CONFIG_H +#define CONFIG_H + +// Include this header only under the llvm source tree. +// This is a private header. + +/* Exported configuration */ +#include "llvm/Config/llvm-config.h" + +/* Bug report URL. */ +#define BUG_REPORT_URL "https://bugs.freebsd.org/submit/" + +/* Define to 1 to enable backtraces, and to 0 otherwise. */ +#define ENABLE_BACKTRACES 1 + +/* Define to 1 to enable crash overrides, and to 0 otherwise. */ +#define ENABLE_CRASH_OVERRIDES 1 + +/* Define to 1 to enable crash memory dumps, and to 0 otherwise. */ +#define LLVM_ENABLE_CRASH_DUMPS 0 + +/* Define to 1 to prefer forward slashes on Windows, and to 0 prefer + backslashes. */ +#define LLVM_WINDOWS_PREFER_FORWARD_SLASH 0 + +/* Define to 1 if you have the `backtrace' function. */ +#define HAVE_BACKTRACE TRUE + +#define BACKTRACE_HEADER + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRASHREPORTERCLIENT_H */ + +/* can use __crashreporter_info__ */ +#if defined(__APPLE__) +#define HAVE_CRASHREPORTER_INFO 1 +#else +#define HAVE_CRASHREPORTER_INFO 0 +#endif + +/* Define to 1 if you have the declaration of `arc4random', and to 0 if you + don't. */ +#define HAVE_DECL_ARC4RANDOM 1 + +/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you + don't. */ +#define HAVE_DECL_FE_ALL_EXCEPT 1 + +/* Define to 1 if you have the declaration of `FE_INEXACT', and to 0 if you + don't. */ +#define HAVE_DECL_FE_INEXACT 1 + +/* Define to 1 if you have the declaration of `strerror_s', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_S 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define if dlopen() is available on this platform. */ +#define HAVE_DLOPEN 1 + +/* Define if dladdr() is available on this platform. */ +#define HAVE_DLADDR 1 + +#if !defined(__arm__) || defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH__) +/* Define to 1 if we can register EH frames on this platform. */ +#define HAVE_REGISTER_FRAME 1 + +/* Define to 1 if we can deregister EH frames on this platform. */ +#define HAVE_DEREGISTER_FRAME 1 +#endif // !arm || USING_SJLJ_EXCEPTIONS || ARM_DWARF_EH_ + +/* Define if __unw_add_dynamic_fde() is available on this platform. */ +/* #undef HAVE_UNW_ADD_DYNAMIC_FDE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FENV_H 1 + +/* Define if libffi is available on this platform. */ +/* #undef HAVE_FFI_CALL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_FFI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_FFI_H */ + +/* Define to 1 if you have the `futimens' function. */ +#define HAVE_FUTIMENS 1 + +/* Define to 1 if you have the `futimes' function. */ +#define HAVE_FUTIMES 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `isatty' function. */ +#define HAVE_ISATTY 1 + +/* Define to 1 if you have the `edit' library (-ledit). */ +#define HAVE_LIBEDIT TRUE + +/* Define to 1 if you have the `pfm' library (-lpfm). */ +/* #undef HAVE_LIBPFM */ + +/* Define to 1 if the `perf_branch_entry' struct has field cycles. */ +/* #undef LIBPFM_HAS_FIELD_CYCLES */ + +/* Define to 1 if you have the `psapi' library (-lpsapi). */ +/* #undef HAVE_LIBPSAPI */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#define HAVE_LIBPTHREAD 1 + +/* Define to 1 if you have the `pthread_getname_np' function. */ +#define HAVE_PTHREAD_GETNAME_NP 1 + +/* Define to 1 if you have the `pthread_setname_np' function. */ +#define HAVE_PTHREAD_SETNAME_NP 1 + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_LINK_H 1 +#else +#define HAVE_LINK_H 0 +#endif + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_MACH_MACH_H 1 +#endif + +/* Define to 1 if you have the `mallctl' function. */ +#if defined(__FreeBSD__) +#define HAVE_MALLCTL 1 +#endif + +/* Define to 1 if you have the `mallinfo' function. */ +#if defined(__linux__) +#define HAVE_MALLINFO 1 +#endif + +/* Define to 1 if you have the `mallinfo2' function. */ +/* #undef HAVE_MALLINFO2 */ + +/* Define to 1 if you have the header file. */ +#if __has_include() +#define HAVE_MALLOC_MALLOC_H 1 +#endif + +/* Define to 1 if you have the `malloc_zone_statistics' function. */ +#if defined(__APPLE__) +#define HAVE_MALLOC_ZONE_STATISTICS 1 +#endif + +/* Define to 1 if you have the `posix_spawn' function. */ +#define HAVE_POSIX_SPAWN 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Have pthread_mutex_lock */ +#define HAVE_PTHREAD_MUTEX_LOCK 1 + +/* Have pthread_rwlock_init */ +#define HAVE_PTHREAD_RWLOCK_INIT 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `sigaltstack' function. */ +#define HAVE_SIGALTSTACK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the `strerror_r' function. */ +#define HAVE_STRERROR_R 1 + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if stat struct has st_mtimespec member .*/ +#if !defined(__linux__) +#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 +#endif + +/* Define to 1 if stat struct has st_mtim member. */ +#if !defined(__APPLE__) +#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 +#endif + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VALGRIND_VALGRIND_H */ + +/* Have host's _alloca */ +/* #undef HAVE__ALLOCA */ + +/* Define to 1 if you have the `_chsize_s' function. */ +/* #undef HAVE__CHSIZE_S */ + +/* Define to 1 if you have the `_Unwind_Backtrace' function. */ +#define HAVE__UNWIND_BACKTRACE 1 + +/* Have host's __alloca */ +/* #undef HAVE___ALLOCA */ + +/* Have host's __ashldi3 */ +/* #undef HAVE___ASHLDI3 */ + +/* Have host's __ashrdi3 */ +/* #undef HAVE___ASHRDI3 */ + +/* Have host's __chkstk */ +/* #undef HAVE___CHKSTK */ + +/* Have host's __chkstk_ms */ +/* #undef HAVE___CHKSTK_MS */ + +/* Have host's __cmpdi2 */ +/* #undef HAVE___CMPDI2 */ + +/* Have host's __divdi3 */ +/* #undef HAVE___DIVDI3 */ + +/* Have host's __fixdfdi */ +/* #undef HAVE___FIXDFDI */ + +/* Have host's __fixsfdi */ +/* #undef HAVE___FIXSFDI */ + +/* Have host's __floatdidf */ +/* #undef HAVE___FLOATDIDF */ + +/* Have host's __lshrdi3 */ +/* #undef HAVE___LSHRDI3 */ + +/* Have host's __main */ +/* #undef HAVE___MAIN */ + +/* Have host's __moddi3 */ +/* #undef HAVE___MODDI3 */ + +/* Have host's __udivdi3 */ +/* #undef HAVE___UDIVDI3 */ + +/* Have host's __umoddi3 */ +/* #undef HAVE___UMODDI3 */ + +/* Have host's ___chkstk */ +/* #undef HAVE____CHKSTK */ + +/* Have host's ___chkstk_ms */ +/* #undef HAVE____CHKSTK_MS */ + +/* Linker version detected at compile time. */ +/* #undef HOST_LINK_VERSION */ + +/* Define if overriding target triple is enabled */ +/* #undef LLVM_TARGET_TRIPLE_ENV */ + +/* Whether tools show host and target info when invoked with --version */ +#define LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO 1 + +/* Whether tools show optional build config flags when invoked with --version */ +#define LLVM_VERSION_PRINTER_SHOW_BUILD_CONFIG 1 + +/* Define if libxml2 is supported on this platform. */ +/* #undef LLVM_ENABLE_LIBXML2 */ + +/* Define to the extension used for shared libraries, say, ".so". */ +#if defined(__APPLE__) +#define LTDL_SHLIB_EXT ".dylib" +#else +#define LTDL_SHLIB_EXT ".so" +#endif + +/* Define to the extension used for plugin libraries, say, ".so". */ +#if defined(__APPLE__) +#define LLVM_PLUGIN_EXT ".dylib" +#else +#define LLVM_PLUGIN_EXT ".so" +#endif + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://bugs.freebsd.org/submit/" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "LLVM" + +/* Define to the full name and version of this package. */ - #define PACKAGE_STRING "LLVM 19.1.5" ++#define PACKAGE_STRING "LLVM 19.1.7" + +/* Define to the version of this package. */ - #define PACKAGE_VERSION "19.1.5" ++#define PACKAGE_VERSION "19.1.7" + +/* Define to the vendor of this package. */ +/* #undef PACKAGE_VENDOR */ + +/* Define to a function implementing stricmp */ +/* #undef stricmp */ + +/* Define to a function implementing strdup */ +/* #undef strdup */ + +/* Whether GlobalISel rule coverage is being collected */ +#define LLVM_GISEL_COV_ENABLED 0 + +/* Define to the default GlobalISel coverage file prefix */ +/* #undef LLVM_GISEL_COV_PREFIX */ + +/* Whether Timers signpost passes in Xcode Instruments */ +#if defined(__APPLE__) +#define LLVM_SUPPORT_XCODE_SIGNPOSTS 1 +#else +#define LLVM_SUPPORT_XCODE_SIGNPOSTS 0 +#endif + +/* #undef HAVE_PROC_PID_RUSAGE */ + +#define HAVE_BUILTIN_THREAD_POINTER 1 + +#endif diff --cc lib/clang/include/llvm/Config/llvm-config.h index 966249436723,000000000000..4ca2d0083398 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@@ -1,232 -1,0 +1,232 @@@ +/*===------- llvm/Config/llvm-config.h - llvm configuration -------*- C -*-===*/ +/* */ +/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */ +/* Exceptions. */ +/* See https://llvm.org/LICENSE.txt for license information. */ +/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ +/* */ +/*===----------------------------------------------------------------------===*/ + +/* This file enumerates variables from the LLVM configuration so that they + can be in exported headers and won't override package specific directives. + This is a C header that can be included in the llvm-c headers. */ + +#ifndef LLVM_CONFIG_H +#define LLVM_CONFIG_H + +/* Define if LLVM_ENABLE_DUMP is enabled */ +/* #undef LLVM_ENABLE_DUMP */ + +/* Target triple LLVM will generate code for by default */ +/* Doesn't use `cmakedefine` because it is allowed to be empty. */ +/* #undef LLVM_DEFAULT_TARGET_TRIPLE */ + +/* Define if threads enabled */ +#define LLVM_ENABLE_THREADS 1 + +/* Has gcc/MSVC atomic intrinsics */ +#define LLVM_HAS_ATOMICS 1 + +/* Host triple LLVM will be executed on */ +/* #undef LLVM_HOST_TRIPLE */ + +/* LLVM architecture name for the native architecture, if available */ +/* #undef LLVM_NATIVE_ARCH */ + +/* LLVM name for the native AsmParser init function, if available */ +/* #undef LLVM_NATIVE_ASMPARSER */ + +/* LLVM name for the native AsmPrinter init function, if available */ +/* #undef LLVM_NATIVE_ASMPRINTER */ + +/* LLVM name for the native Disassembler init function, if available */ +/* #undef LLVM_NATIVE_DISASSEMBLER */ + +/* LLVM name for the native Target init function, if available */ +/* #undef LLVM_NATIVE_TARGET */ + +/* LLVM name for the native TargetInfo init function, if available */ +/* #undef LLVM_NATIVE_TARGETINFO */ + +/* LLVM name for the native target MC init function, if available */ +/* #undef LLVM_NATIVE_TARGETMC */ + +/* LLVM name for the native target MCA init function, if available */ +/* #undef LLVM_NATIVE_TARGETMCA */ + +/* Define if the AArch64 target is built in */ +#ifdef LLVM_TARGET_ENABLE_AARCH64 +#define LLVM_HAS_AARCH64_TARGET 1 +#else +#define LLVM_HAS_AARCH64_TARGET 0 +#endif + +/* Define if the AMDGPU target is built in */ +#define LLVM_HAS_AMDGPU_TARGET 0 + +/* Define if the ARC target is built in */ +#define LLVM_HAS_ARC_TARGET 0 + +/* Define if the ARM target is built in */ +#ifdef LLVM_TARGET_ENABLE_ARM +#define LLVM_HAS_ARM_TARGET 1 +#else +#define LLVM_HAS_ARM_TARGET 0 +#endif + +/* Define if the AVR target is built in */ +#define LLVM_HAS_AVR_TARGET 0 + +/* Define if the BPF target is built in */ +#ifdef LLVM_TARGET_ENABLE_BPF +#define LLVM_HAS_BPF_TARGET 1 +#else +#define LLVM_HAS_BPF_TARGET 0 +#endif + +/* Define if the CSKY target is built in */ +#define LLVM_HAS_CSKY_TARGET 0 + +/* Define if the DirectX target is built in */ +#define LLVM_HAS_DIRECTX_TARGET 0 + +/* Define if the Hexagon target is built in */ +#define LLVM_HAS_HEXAGON_TARGET 0 + +/* Define if the Lanai target is built in */ +#define LLVM_HAS_LANAI_TARGET 0 + +/* Define if the LoongArch target is built in */ +#define LLVM_HAS_LOONGARCH_TARGET 0 + +/* Define if the M68k target is built in */ +#define LLVM_HAS_M68K_TARGET 0 + +/* Define if the Mips target is built in */ +#ifdef LLVM_TARGET_ENABLE_MIPS +#define LLVM_HAS_MIPS_TARGET 1 +#else +#define LLVM_HAS_MIPS_TARGET 0 +#endif + +/* Define if the MSP430 target is built in */ +#define LLVM_HAS_MSP430_TARGET 0 + +/* Define if the NVPTX target is built in */ +#define LLVM_HAS_NVPTX_TARGET 0 + +/* Define if the PowerPC target is built in */ +#ifdef LLVM_TARGET_ENABLE_POWERPC +#define LLVM_HAS_POWERPC_TARGET 1 +#else +#define LLVM_HAS_POWERPC_TARGET 0 +#endif + +/* Define if the RISCV target is built in */ +#ifdef LLVM_TARGET_ENABLE_RISCV +#define LLVM_HAS_RISCV_TARGET 1 +#else +#define LLVM_HAS_RISCV_TARGET 0 +#endif + +/* Define if the Sparc target is built in */ +#define LLVM_HAS_SPARC_TARGET 0 + +/* Define if the SPIRV target is built in */ +#define LLVM_HAS_SPIRV_TARGET 0 + +/* Define if the SystemZ target is built in */ +#define LLVM_HAS_SYSTEMZ_TARGET 0 + +/* Define if the VE target is built in */ +#define LLVM_HAS_VE_TARGET 0 + +/* Define if the WebAssembly target is built in */ +#define LLVM_HAS_WEBASSEMBLY_TARGET 0 + +/* Define if the X86 target is built in */ +#ifdef LLVM_TARGET_ENABLE_X86 +#define LLVM_HAS_X86_TARGET 1 +#else +#define LLVM_HAS_X86_TARGET 0 +#endif + +/* Define if the XCore target is built in */ +#define LLVM_HAS_XCORE_TARGET 0 + +/* Define if the Xtensa target is built in */ +#define LLVM_HAS_XTENSA_TARGET 0 + +/* Define if this is Unixish platform */ +#define LLVM_ON_UNIX 1 + +/* Define if we have the Intel JIT API runtime support library */ +#define LLVM_USE_INTEL_JITEVENTS 0 + +/* Define if we have the oprofile JIT-support library */ +#define LLVM_USE_OPROFILE 0 + +/* Define if we have the perf JIT-support library */ +#define LLVM_USE_PERF 0 + +/* Major version of the LLVM API */ +#define LLVM_VERSION_MAJOR 19 + +/* Minor version of the LLVM API */ +#define LLVM_VERSION_MINOR 1 + +/* Patch version of the LLVM API */ - #define LLVM_VERSION_PATCH 5 ++#define LLVM_VERSION_PATCH 7 + +/* LLVM version string */ - #define LLVM_VERSION_STRING "19.1.5" ++#define LLVM_VERSION_STRING "19.1.7" + +/* Whether LLVM records statistics for use with GetStatistics(), + * PrintStatistics() or PrintStatisticsJSON() + */ +#define LLVM_FORCE_ENABLE_STATS 0 + +/* Define if we have z3 and want to build it */ +/* #undef LLVM_WITH_Z3 */ + +/* Define if we have curl and want to use it */ +/* #undef LLVM_ENABLE_CURL */ + +/* Define if we have cpp-httplib and want to use it */ +/* #undef LLVM_ENABLE_HTTPLIB */ + +/* Define if zlib compression is available */ +#define LLVM_ENABLE_ZLIB 1 + +/* Define if zstd compression is available */ +#define LLVM_ENABLE_ZSTD 1 + +/* Define if LLVM is using tflite */ +/* #undef LLVM_HAVE_TFLITE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSEXITS_H 1 + +/* Define if building libLLVM shared library */ +/* #undef LLVM_BUILD_LLVM_DYLIB */ + +/* Define if building LLVM with BUILD_SHARED_LIBS */ +/* #undef LLVM_BUILD_SHARED_LIBS */ + +/* Define if building LLVM with LLVM_FORCE_USE_OLD_TOOLCHAIN_LIBS */ +/* #undef LLVM_FORCE_USE_OLD_TOOLCHAIN */ + +/* Define if llvm_unreachable should be optimized with undefined behavior + * in non assert builds */ +#define LLVM_UNREACHABLE_OPTIMIZE 1 + +/* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */ +#define LLVM_ENABLE_DIA_SDK 0 + +/* Define if plugins enabled */ +/* #undef LLVM_ENABLE_PLUGINS */ + +/* Define if logf128 is available */ +/* #undef LLVM_HAS_LOGF128 */ + +#endif diff --cc lib/clang/include/llvm/Support/VCSRevision.h index db3347a0e5a5,000000000000..76aa3f075586 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@@ -1,2 -1,0 +1,2 @@@ - #define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" ++#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" +#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Thu Jan 16 21:52:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYxRY0ngqz5kyl9; Thu, 16 Jan 2025 21:52:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYxRY00Jjz45HZ; Thu, 16 Jan 2025 21:52:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737064345; h=from:from:reply-to:subject: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=+sa7KL/GXqxUUbCVl1l54kvoBmcE5pIpSzJNGfIHsr4=; b=q2R84O5jrgBmk+xZlPubQUvGuqrur4lS+ZeANvcbogrIcSdzgu25zcoP3svkM0RVXTLGnF fCQh6FSdQVyKg9Lx24q4uCTRMel1yGgi1eC7PHoL5bdaQU1zoYllBugq/4gz30SiaALkK9 WvX6ESHq1TJ8Z6jyYK+g7tZ/dzE+Y3wnycbGT46QQ/fUL6Nr1XF/YzrQOlz6QEakpevr5V NVLczfhVLLsJVu4BdzcQIEIh51vtNLQSxWl1RMIjHSFAQk1XMrN7IQ3WR++9eTdLQdPoXe kjVQekB9H9cvjgcAYN0JXyTI9bY4jjagqc+pym6c/tfs6NhYbV1tZsRcn0A0mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737064345; h=from:from:reply-to:subject: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=+sa7KL/GXqxUUbCVl1l54kvoBmcE5pIpSzJNGfIHsr4=; b=VkZ+ECCemzmxXWHFpvv5xDj8fb+f3qP56o8nE6DhALWnvg/s0ruF7H8psf+lAMcO2gEg0L GGvqm4/RbCOA9bZ20BADERZSr58r1y0fIgKGm9xuaRTDjulcyvW/nOQK3TjpymQTVfhbfz 0FhA+FMFwgVg+QYTLIO5zEiBvd0G4KptL2ukHlP0YGUl8PkYtlKwokcxcf2F27aXO8SE6E UVpUuDu3mbxssEhwyij2+SMymbm7yNRFlhAGZZw9LyK2OvMp068qugyFgK4zIx8hCJjj95 33yKZmub5gprKgt/8iqCJguiEx9nbM/aWINXldXhFfWLo/4o57lmY7mAQFx32Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737064345; a=rsa-sha256; cv=none; b=Ln9MLrKbadjruJvlfxS6lzyDExEMb/kb0EzEc2k1rL8IirJ7CyY5w0rZMo45No3b7dgwh8 OLywhzBGaI9sleJqvbBWMraU3fTvv1ErWkEEjXiiKzS/q9bh9pqnSyyH/eUWxTWSaoEAL0 dCwLkpQuvLBfxjgOg8cQ6b6m163kJYDor0vYB5a9n6oTjdU6FkwUDysSdW4kVwrpGxC9De Yu3azfZ7aXrs2Ha5txr1NIjznW6RAVcmqX8ZolAx+liNkCOoNYnXGmLXrmG97NhXmlLV60 Dikks3X0XKvaBZNjrj/1j72IX2aLwTo4ivnQmml4DCOZiaGAd43oTf61aifxYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YYxRX27Nrz10W3; Thu, 16 Jan 2025 21:52:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> Date: Thu, 16 Jan 2025 15:52:22 -0600 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library To: Brooks Davis , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org, Warner Losh References: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> Content-Language: en-US From: Kyle Evans In-Reply-To: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/30/24 16:08, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 > > commit 9ded074e875c29cb92d5f643801990d7bb23cca4 > Author: agge3 > AuthorDate: 2024-10-21 21:42:13 +0000 > Commit: Brooks Davis > CommitDate: 2024-10-30 21:04:30 +0000 > > Refactor makesyscalls.lua into a library > > * main.lua replicates the functionality of makesyscalls.lua > * Individual files are generated by their associated module > * Modules can be called as standalone scripts to generate a specific > file > * Data and procedures are performed by objects instead of procedual code > * Bitmasks are replaced by declarative types > * Temporary files are no longer produced, writing is stored in memory > * Comments provide explanation to functions and semantics > > Google Summer of Code 2024 Final Work Product > > Co-authored-by: Warner Losh > Co-authored-by: Kyle Evans > Co-authored-by: Brooks Davis > Sponsored by: Google (GSoC 24) > Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 > Signed-off-by: agge3 > --- > sys/tools/syscalls/README.md | 49 +++ > sys/tools/syscalls/config.lua | 312 +++++++++++++++++ > sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ > sys/tools/syscalls/core/scarg.lua | 163 +++++++++ > sys/tools/syscalls/core/scret.lua | 45 +++ > sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ > sys/tools/syscalls/main.lua | 64 ++++ > sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ > sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ > sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ > sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ > sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ > sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ > sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ > sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ > sys/tools/syscalls/tools/generator.lua | 113 ++++++ > sys/tools/syscalls/tools/util.lua | 194 +++++++++++ > 17 files changed, 2768 insertions(+) > > [...] > diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua > new file mode 100644 > index 000000000000..193b1e43563c > --- /dev/null > +++ b/sys/tools/syscalls/core/freebsd-syscall.lua > @@ -0,0 +1,147 @@ > [...] > +function FreeBSDSyscall:parseSysfile() > + local file = self.sysfile > + local config = self.config > + local commentExpr = "^%s*;.*" > + > + if file == nil then > + return nil, "No file given" > + end > + > + self.syscalls = {} > + > + local fh, msg = io.open(file) > + if fh == nil then > + return nil, msg > + end > + > + local incs = "" > + local defs = "" > + local s > + for line in fh:lines() do > + line = line:gsub(commentExpr, "") -- Strip any comments. > + -- NOTE: Can't use pure pattern matching here because of > + -- the 's' test and this is shorter than a generic pattern > + -- matching pattern. > + if line == nil or line == "" then > + goto skip -- Blank line, skip this line. > + elseif s ~= nil then > + -- If we have a partial system call object s, > + -- then feed it one more line. > + if s:add(line) then > + -- Append to system call list. > + for t in s:iter() do > + if t:validate(t.num - 1) then > + table.insert(self.syscalls, t) > + else > + util.abort(1, > + "Skipped system call " .. > + "at number " .. t.num) > + end > + end > + s = nil > + end > + elseif line:match("^#%s*include") then > + incs = incs .. line .. "\n" > + elseif line:match("%%ABI_HEADERS%%") then > + local h = self.config.abi_headers > + if h ~= nil and h ~= "" then > + incs = incs .. h .. "\n" > + end > + elseif line:match("^#%s*define") then > + defs = defs .. line.. "\n" > + elseif line:match("^#") then > + util.abort(1, "Unsupported cpp op " .. line) This specifically is kind of a huge regression, and I don't really know how to cope with it. We've guaranteed for years that we'll copy preprocessor directives through to all output files. We don't use that upstream in FreeBSD, but we work with downstreams/vendors that make extensive use of it in their syscall definitions. I don't really know what the answer is to this, but we probably shouldn't have dropped it without some discussion first. This is going to be a bit of a headache... > [...] Thanks, Kyle Evans From nobody Thu Jan 16 22:43:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YYyZ41dRHz5l1Yp; Thu, 16 Jan 2025 22:43:08 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YYyZ374hdz49Vy; Thu, 16 Jan 2025 22:43:07 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737067388; 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=aMY/wnleGUiFshyaRA0mSCPajKzd5Uogozbhc4UxxsQ=; b=Dr2rn2PQ/GqRfwipcFBYdHybAok7avPpXNYdJo5OLPzSe1IQdBsuyfQEMew90p+y5MOY+c C1rbG9ZzVNCqkhbMyb1iS+sfmctaTS87Cgie6kc1iZ0ugOr00n8Ie4YQW0BVXNJLed+IAg krHL5JVIHr++Oy/SxeVYTRAUFb9ZjWzwaYJGN5KJKplwlomKnM9YC1R1G/nxYFLVedMIvx 274Utx3+mN9qNj7K7fs60zugyWI6zEpyJqvtV55BZBVW7Eyihv3jyIS7yhgkGQhpjz/294 JIJgpBhynKZn+JPr6h+xjlO1z3n5TH3Kn3tWytik2wwPvSGgZZZ5KygodmEklw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737067388; 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=aMY/wnleGUiFshyaRA0mSCPajKzd5Uogozbhc4UxxsQ=; b=QOdWsqJ8v3TMM1aifHfqqz/h7zZyXcFNg8/79vFHMculpOKsSu2oVVUGZmOEMGWW2nMxv4 /BetxNXpX2jfJMCxQLqbfWbUA9daXS6ShlmbhHFOkXRCctezlz9m3Tr7zdVbuzY6bj/QO5 HtccO9aIuBncH/4wRUBd6koIJgBhuYSOEcL2gDcgJHV1fy3sLktWLY3hB0CQpJt9bjhSNL 2VgrScnYJUbxoG/WemGrm5RbtRE1vDsGQ4JBF/QbHamhD6aHXVcuMrV+TbiI3DBgiwxxN8 WHIB/ssFQy2pZWvFXRujLKtJFZVyxdXi7KecsYo0JvOH4QbXvt+vcXb5b8jDhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737067388; a=rsa-sha256; cv=none; b=PeMqI75sTM28sep89Ve7YRdhF5tqaR9T5jFSt24pDX5OroNDQc0+ugMzO+cn/JKO7ZbM9+ DixmLoZ+iPurEyP39XjnxFOY3jvyW7iNuf2qcsjeJM7ZJMLJRrP+B/CyHKaWvkGoR5OuMj Rt7joHa/dIPDD6sfFOAzj1N6r6fLPKbxBtUH7p/EaksBzZp8wbjwiCn2uLQ1YsFuQHFNq4 W8c4kKP7eTKS9j7pFr2pGEimitYELHep/O+SaL1gsNPHLbd7JuWslx+6X+2YUYl9Q20TCF 2+Ls8AhGvqQ2/v80SXcTg5iu1m3YB/2jAnvz8YD22FkM84Afi2KLdp/KjfKXPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_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: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YYyZ363dtzywp; Thu, 16 Jan 2025 22:43:07 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 1466A3C01A0; Thu, 16 Jan 2025 22:43:07 +0000 (UTC) Date: Thu, 16 Jan 2025 22:43:07 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Warner Losh Subject: Re: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library Message-ID: References: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> On Thu, Jan 16, 2025 at 03:52:22PM -0600, Kyle Evans wrote: > On 10/30/24 16:08, Brooks Davis wrote: > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 > > > > commit 9ded074e875c29cb92d5f643801990d7bb23cca4 > > Author: agge3 > > AuthorDate: 2024-10-21 21:42:13 +0000 > > Commit: Brooks Davis > > CommitDate: 2024-10-30 21:04:30 +0000 > > > > Refactor makesyscalls.lua into a library > > * main.lua replicates the functionality of makesyscalls.lua > > * Individual files are generated by their associated module > > * Modules can be called as standalone scripts to generate a specific > > file > > * Data and procedures are performed by objects instead of procedual code > > * Bitmasks are replaced by declarative types > > * Temporary files are no longer produced, writing is stored in memory > > * Comments provide explanation to functions and semantics > > Google Summer of Code 2024 Final Work Product > > Co-authored-by: Warner Losh > > Co-authored-by: Kyle Evans > > Co-authored-by: Brooks Davis > > Sponsored by: Google (GSoC 24) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 > > Signed-off-by: agge3 > > --- > > sys/tools/syscalls/README.md | 49 +++ > > sys/tools/syscalls/config.lua | 312 +++++++++++++++++ > > sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ > > sys/tools/syscalls/core/scarg.lua | 163 +++++++++ > > sys/tools/syscalls/core/scret.lua | 45 +++ > > sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ > > sys/tools/syscalls/main.lua | 64 ++++ > > sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ > > sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ > > sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ > > sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ > > sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ > > sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ > > sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ > > sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ > > sys/tools/syscalls/tools/generator.lua | 113 ++++++ > > sys/tools/syscalls/tools/util.lua | 194 +++++++++++ > > 17 files changed, 2768 insertions(+) > > > > [...] > > diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua > > new file mode 100644 > > index 000000000000..193b1e43563c > > --- /dev/null > > +++ b/sys/tools/syscalls/core/freebsd-syscall.lua > > @@ -0,0 +1,147 @@ > > [...] > > +function FreeBSDSyscall:parseSysfile() > > + local file = self.sysfile > > + local config = self.config > > + local commentExpr = "^%s*;.*" > > + > > + if file == nil then > > + return nil, "No file given" > > + end > > + > > + self.syscalls = {} > > + > > + local fh, msg = io.open(file) > > + if fh == nil then > > + return nil, msg > > + end > > + > > + local incs = "" > > + local defs = "" > > + local s > > + for line in fh:lines() do > > + line = line:gsub(commentExpr, "") -- Strip any comments. > > + -- NOTE: Can't use pure pattern matching here because of > > + -- the 's' test and this is shorter than a generic pattern > > + -- matching pattern. > > + if line == nil or line == "" then > > + goto skip -- Blank line, skip this line. > > + elseif s ~= nil then > > + -- If we have a partial system call object s, > > + -- then feed it one more line. > > + if s:add(line) then > > + -- Append to system call list. > > + for t in s:iter() do > > + if t:validate(t.num - 1) then > > + table.insert(self.syscalls, t) > > + else > > + util.abort(1, > > + "Skipped system call " .. > > + "at number " .. t.num) > > + end > > + end > > + s = nil > > + end > > + elseif line:match("^#%s*include") then > > + incs = incs .. line .. "\n" > > + elseif line:match("%%ABI_HEADERS%%") then > > + local h = self.config.abi_headers > > + if h ~= nil and h ~= "" then > > + incs = incs .. h .. "\n" > > + end > > + elseif line:match("^#%s*define") then > > + defs = defs .. line.. "\n" > > + elseif line:match("^#") then > > + util.abort(1, "Unsupported cpp op " .. line) > > This specifically is kind of a huge regression, and I don't really know how to > cope with it. We've guaranteed for years that we'll copy preprocessor > directives through to all output files. We don't use that upstream in > FreeBSD, but we work with downstreams/vendors that make extensive use of it in > their syscall definitions. > > I don't really know what the answer is to this, but we probably shouldn't have > dropped it without some discussion first. This is going to be a bit of a > headache... This response seems rather hyperbolic. This change was up for review for months and the feature is unused in tree so there was no way to know it was important. It would be helpful to work through some examples understand what people need here and if it really has to be a refactor to pass things through or if adding some new tags and config values could do the job. The quickest workaround would probably to revert these commits locally (I took care to isolate them for exactly this reason): 5212b9500116 sysent: GC sys/tools/makesyscalls.lua 204d065dac81 sysent: switch to refactored makesyscalls.lua You might also need to revert this commit or implement it in makesyscalls.lua: bbc0f33b1317 sysent: add a NOLIB modifer to prevent stub generation If we need be, I'd even be ok with temporarily restoring makesyscalls.lua and back porting easy features, but maintaining two is certainly not viable indefinitely. -- Brooks From nobody Fri Jan 17 01:32:39 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ2Kh0lVwz5kCDW for ; Fri, 17 Jan 2025 01:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ2Kg5LJtz3W3T; Fri, 17 Jan 2025 01:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737077559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tmR9QkVAW3SeYE6G31e76bj9a/l5duqotYG2aL4LVYE=; b=yXmUwVfyq6f3XhMK/p/J5wABF4e+jRSzc3logy/wOXSiQoAZzgKafS+5yTv6ugYh+LhFji 50jnhoHTLkg08VORuebxjF1XbnjEDgzSbLy15Wr2B3cnmeM7s98ZOi4rh1KIeZn3Gn5yyT COdNnGl5jE0Ds/4rTBaov6YsOVfCRvYPzCo6baj7LfFIELnNS54tCDDo4FayNBSD3HFduL 4w4Sp97ikRMgFab9gJLa/VqGmI9k6N3oPoO8McFa7Ylfrk+ZlmTIVifQ5Q0JLrM32IuxYz A38VxE1RxQSsHJejSBqkX1ZxCf3Gl4gbHfHnx/iVWTJheXAa/aP6e+lAdgJ/1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737077559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tmR9QkVAW3SeYE6G31e76bj9a/l5duqotYG2aL4LVYE=; b=Wh/YJLwCiY4UdLCymskAh371g6S1Mmz0DBjWVQofooneENMrhyHyizwm6IXKea/AgOb/zZ NcQ/sXr6ovKil9p/6aYNYWh9r6senwDy7z9DuG9Ifrr5iGyZr/goRD+t2Iysg1nbcSC4vU FV/2USnCgG0rTViHsuFaEyukWSiizK/Qdfn8U4Rcwgy1eC/D5Q7rLAeguqBzbRp1AlRmbJ hJNbaLjkaZbzIK5D/gaIO1ncaJFxM01gfDPSsHC55xFDLTjHsWsLYYxX4ZL0D9ttL+TWTC a3hGpkzrnRMGWy3m7yuIrobU9uOjmBxaDvWiEOq+LWZm7K0ZkzQHigp/PRVq2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737077559; a=rsa-sha256; cv=none; b=FcZVGhbTm5GSSytG6EP00ckOwTkhbj3EcLx+yy0PyXjL3UXsF0qTRBWM9zEs4WmI2TKNqq aYhHgRMKpial/Ct0krMwh7Ivtiba/z/UgDA45DL2TOvvKrRpn/8cgxsfDKR71Ll6gHxPBW 5L6+NwBDS096UUnE7oroqTKPD7bEXJUzTkmrYtPoVs13BPKYPzPq7PPCLMmseBLW5d02Z3 bKOjbDxw8fHV2ucb8krVJVA1DlelGsAkoaMRzMHuGkqbWjzgeRq8ADgerwnPAfpR1oQteF 2LqVU94hToRIwzPPfQ8Jan7xl6T0cI/I6fKkT6HndCFJcZdVnzchxXH2x47eeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ2Kg4GJqzxkd; Fri, 17 Jan 2025 01:32: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 50H1Wd8c033122; Fri, 17 Jan 2025 01:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H1WdHq033121; Fri, 17 Jan 2025 01:32:39 GMT (envelope-from git) Date: Fri, 17 Jan 2025 01:32:39 GMT Message-Id: <202501170132.50H1WdHq033121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: 62ad5eff8053..b4a294ba7e60 - vendor/tzdata - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/vendor/tzdata X-Git-Reftype: branch X-Git-Commit: b4a294ba7e6013c296c42213799a25be87b635d7 X-Git-Oldrev: 62ad5eff805323c79d60cd902863fa8c29b863a8 X-Git-Newrev: b4a294ba7e6013c296c42213799a25be87b635d7 Auto-Submitted: auto-generated The branch vendor/tzdata has been updated by philip: URL: https://cgit.FreeBSD.org/src/log/?id=62ad5eff8053..b4a294ba7e60 b4a294ba7e60 Import tzdata 2025a From nobody Fri Jan 17 01:40:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ2VL5FNGz5kCkc; Fri, 17 Jan 2025 01:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ2VL4sgKz3XKh; Fri, 17 Jan 2025 01:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737078010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qDQtufBTS5Q+ehIhi2MUrpK13ESJKgRVYQx/pJA9U9A=; b=JQladfkGjZruI15KIUbwuUXwMv7d+4zEIZSMPv/u3n6hPtaXR2UIe8ppHNH5FzjHMh92JA 4xK8tDBPcint/Vz3HqEE1kaOvnvbTRmhyO7DZWrlOIrPYaGxEv1h72+fMKccQH7FgyR/Ak ehHjzH46Jkt/WBNQffHmjSGi+/BlZ83RxjKq9kIOAy5zF/fFh6R4YkNuQT5cWnW+ljTFTF yrnwozLJe0PAdP1bkZ9Lfchf33rAkOzc1l58uVffkTNtb3FjRZdaBGvKx14zzkYLEM5aIw 1SBvrLUCSwUkSybGhPfrUi3Bq08o/9VpibzsilwBmNCPIHVFaYDCwOb7oCu8uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737078010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qDQtufBTS5Q+ehIhi2MUrpK13ESJKgRVYQx/pJA9U9A=; b=vkJ3SndOlJbUP15kG8rQoMSolN+nRDrxvqLbAwUsHI8OAzGCQkQwP4niHD8YPGfjpMMOvt 2ZKRCTIGHVRu/88l31BM4b6g9cU20HKcibIlW7VeC9oIZNDZohGCFTllx5cCF5zINyaMPZ j/yl+WIcRmOQVNYXxQSPoN/5PxWKzb5WTFkrCqBRn1KzVVNl7wauWZatTgQ3sf8soaBc5w OuV0NiHphM/ZQOmGAT7KHKBi88eUNdwgG8Zg/6EAGozI7R4SgnQbU0PELZOBK8pqyoWAU2 3VtqloetxG7gZ0uhD8t761i39+U+00iFbWwLlT7AvcDCJ8e1mbwBfBmvy9o66Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737078010; a=rsa-sha256; cv=none; b=qLTRZ13sq2P9gaMSm53W19GWi7HLCudoskbyHEuhub8RyXM25OzsSJ/m79It+bhxre22UK GqiFiiClCRcSKMGLygAu9vVtDLsBCKv3qVaAO0mNTVyJ1NBk1Fet0Z0sd806r912q+tOwL 1EFOhuQhFBP7L+hj6PLyKbTnJPnkWwMr9pmSv91WCw25fnzTmrScNOrjRmFzbAhOJCtl0Q MfpSO0rDtNopvKjQ3lqTp93BxiybXgZS++xyo4vihYbizDEru8UIFOQOGf6jSfSeFCUZhs rXtywJ1slODP2etDRkwvB0BBi6rw5s3VMILWyyS7io95jPuU5k/MUOLopznmuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ2VL44w6zx9g; Fri, 17 Jan 2025 01:40: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 50H1eAjP039838; Fri, 17 Jan 2025 01:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H1e7sT038695; Fri, 17 Jan 2025 01:40:07 GMT (envelope-from git) Date: Fri, 17 Jan 2025 01:40:07 GMT Message-Id: <202501170140.50H1e7sT038695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 46226b0162ba - main - contrib/tzdata: import tzdata 2025a List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46226b0162ba03986b1de2c790804b37dd8e64d6 Auto-Submitted: auto-generated The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=46226b0162ba03986b1de2c790804b37dd8e64d6 commit 46226b0162ba03986b1de2c790804b37dd8e64d6 Merge: 6c05f3a74f30 b4a294ba7e60 Author: Philip Paeps AuthorDate: 2025-01-17 01:33:46 +0000 Commit: Philip Paeps CommitDate: 2025-01-17 01:33:46 +0000 contrib/tzdata: import tzdata 2025a Changes: https://github.com/eggert/tz/blob/2025a/NEWS MFC after: 3 days contrib/tzdata/Makefile | 32 +++++------ contrib/tzdata/NEWS | 84 +++++++++++++++++++++++++++-- contrib/tzdata/antarctica | 2 + contrib/tzdata/asia | 113 ++++++++++++++++++++++++++++----------- contrib/tzdata/australasia | 113 +++++++++++++++++++++------------------ contrib/tzdata/checknow.awk | 2 +- contrib/tzdata/checktab.awk | 39 +++++++++++++- contrib/tzdata/etcetera | 4 ++ contrib/tzdata/europe | 2 +- contrib/tzdata/factory | 10 ++++ contrib/tzdata/leap-seconds.list | 8 +-- contrib/tzdata/leapseconds | 8 +-- contrib/tzdata/northamerica | 9 ++-- contrib/tzdata/southamerica | 27 ++++++++-- contrib/tzdata/theory.html | 40 +++++++++----- contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 2 +- contrib/tzdata/zone1970.tab | 6 +-- contrib/tzdata/zonenow.tab | 9 ++-- 19 files changed, 369 insertions(+), 143 deletions(-) diff --cc contrib/tzdata/Makefile index 0087b4596515,000000000000..2130582c2deb mode 100644,000000..100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@@ -1,1381 -1,0 +1,1383 @@@ +# Make and install tzdb code and data. +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: +# On older platforms you may need to scrounge for POSIX conformance. +# For example, on Solaris 10 (2005) with Sun Studio 12 aka Sun C 5.9 (2007), +# use 'PATH=/usr/xpg4/bin:$PATH make CC=c99'. + +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh +# make CC='gcc -std=gnu23' "$@" +# +# This example script is appropriate for a circa 2024 GNU/Linux system +# where a non-default setting enables this package's optional use of C23. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# DATAFORM selects the data format. +# Available formats represent essentially the same data, albeit +# possibly with minor discrepancies that users are not likely to notice. +# To get new features and the best data right away, use: +# DATAFORM= vanguard +# To wait a while before using new features, to give downstream users +# time to upgrade zic (the default), use: +# DATAFORM= main +# To wait even longer for new features, use: +# DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. +DATAFORM= main + +# Change the line below for your timezone (after finding the one you want in +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= Factory + +# The POSIXRULES macro controls interpretation of POSIX-like TZ +# settings like TZ='EET-2EEST' that lack DST transition rules. +# If POSIXRULES is '-', no template is installed; this is the default. +# Any other value for POSIXRULES is obsolete and should not be relied on, as: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work even in tzcode, except for historical timestamps +# that precede the last explicit transition in the POSIXRULES file. +# Hence it typically does not work for current and future timestamps. +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. + +POSIXRULES= - + +# Also see TZDEFRULESTRING below, which takes effect only +# if POSIXRULES is '-' or if the template file cannot be accessed. + + +# Installation locations. +# +# The defaults are suitable for Debian, except that if REDO is +# posix_right or right_posix then files that Debian puts under +# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead +# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, +# respectively. Problems with the Debian approach are discussed in +# the commentary for the right_posix rule (below). + +# Destination directory, which can be used for staging. +# 'make DESTDIR=/stage install' installs under /stage (e.g., to +# /stage/etc/localtime instead of to /etc/localtime). Files under +# /stage are not intended to work as-is, but can be copied by hand to +# the root directory later. If DESTDIR is empty, 'make install' does +# not stage, but installs directly into production locations. +DESTDIR = + +# Everything is installed into subdirectories of TOPDIR, and used there. +# TOPDIR should be empty (meaning the root directory), +# or a directory name that does not end in "/". +# TOPDIR should be empty or an absolute name unless you're just testing. +TOPDIR = + +# The default local timezone is taken from the file TZDEFAULT. +TZDEFAULT = $(TOPDIR)/etc/localtime + +# The subdirectory containing installed program and data files, and +# likewise for installed files that can be shared among architectures. +# These should be relative file names. +USRDIR = usr +USRSHAREDIR = $(USRDIR)/share + +# "Compiled" timezone information is placed in the "TZDIR" directory +# (and subdirectories). +# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. +TZDIR_BASENAME= zoneinfo +TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) + +# The "tzselect" and (if you do "make INSTALL") "date" commands go in: +BINDIR = $(TOPDIR)/$(USRDIR)/bin + +# The "zdump" command goes in: +ZDUMPDIR = $(BINDIR) + +# The "zic" command goes in: +ZICDIR = $(TOPDIR)/$(USRDIR)/sbin + +# Manual pages go in subdirectories of. . . +MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man + +# Library functions are put in an archive in LIBDIR. +LIBDIR = $(TOPDIR)/$(USRDIR)/lib + + +# Types to try, as an alternative to time_t. +TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) +TIME_T_ALTERNATIVES_HEAD = int_least64_t.ck +TIME_T_ALTERNATIVES_TAIL = int_least32_t.ck uint_least32_t.ck \ + uint_least64_t.ck + +# What kind of TZif data files to generate. (TZif is the binary time - # zone data format that zic generates; see Internet RFC 8536.) ++# zone data format that zic generates; see Internet RFC 9636.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and was modified in tzdb 2021b to generate version 4 TZif files. +# EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to pre-2020a zic implementations and so that TZif files +# built by newer zic implementations can be read by pre-2021b libraries. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', +# but only for entries listed in the backward-compatibility file zone.tab, use +# PACKRATDATA= backzone +# PACKRATLIST= zone.tab +# If you want all the 'backzone' data, use +# PACKRATDATA= backzone +# PACKRATLIST= +# To omit this data, use +# PACKRATDATA= +# PACKRATLIST= + +PACKRATDATA= +PACKRATLIST= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. +LDLIBS= + +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". +# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime +# formats that generate only the last two digits of year numbers +# -DEPOCH_LOCAL if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# on POSIX platforms predating POSIX.1-2024 +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE__GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with POSIX.1-2017 and earlier +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H=0 if does not work*+ +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SETENV=0 if your system lacks the setenv function +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work*+ +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if does not work* +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if does not work* +# -DHAVE_UTMPX_H=0 if does not work* +# -Dlocale_t=XXX if your system uses XXX instead of locale_t ++# -DMKTIME_MIGHT_OVERFLOW if mktime might fail due to time_t overflow +# -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ +# Typically it is better to use a later standard. For example, +# with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. +# Even with -DPORT_TO_C89, the code needs at least one C99 +# feature (integers at least 64 bits wide) and maybe more. +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. - # -Dssize_t=long on hosts like MS-Windows that lack ssize_t ++# -Dssize_t=int on hosts like MS-Windows that lack ssize_t +# -DSUPPORT_C89=0 if the tzcode library should not support C89 callers +# Although -DSUPPORT_C89=0 might work around latent bugs in callers, +# it does not conform to POSIX. +# -DSUPPORT_POSIX2008 if the library should support older POSIX callers+ +# However, this might cause problems in POSIX.1-2024-or-later callers. +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions for proleptic format TZ strings lacking them, +# in the usual case where POSIXRULES is '-'. If not specified, +# TZDEFRULESTRING defaults to US rules for future DST transitions. +# This mishandles some past timestamps, as US DST rules have changed. +# It also mishandles settings like TZ='EET-2EEST' for eastern Europe, +# as Europe and US DST rules differ. - # -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) ++# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 254) +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably older ones that +# ignore or otherwise mishandle 64-bit data in TZif files; +# however, fat TZif files may trigger bugs in newer TZif readers. +# Slim TZif files are more efficient, and are the default. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# +# * Options marked "*" can be omitted if your compiler is C23 compatible. +# * Options marked "+" are obsolescent and are planned to be removed +# once the code assumes C99 or later (say in the year 2029) +# and POSIX.1-2024 or later (say in the year 2034). +# +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ - -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ ++ -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wcast-qual \ ++ -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wduplicated-branches -Wduplicated-cond -Wflex-array-member-not-at-end \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes \ + -Wmissing-variable-declarations -Wnested-externs \ + -Wnull-dereference \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ + -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wunused-macros -Wuse-after-free=3 \ + -Wvariadic-macros -Wvla -Wwrite-strings \ - -Wno-format-nonliteral -Wno-sign-compare ++ -Wno-format-nonliteral -Wno-sign-compare -Wno-type-limits +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. +# Although POSIX.1-2024 requires these fields and they are widely available +# on GNU/Linux and BSD systems, some older systems lack them. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" +# # to the "CFLAGS=" line. Although "tzname" is required by POSIX.1-1988 +# # and later, its contents are unspecified if you use a geographical TZ +# # and the variable is planned to be removed in a future POSIX edition. +# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. +# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause +# # crashes when combined with some platforms' standard libraries, +# # presumably due to memory allocation issues. +# # +# # To omit or support the external variables "timezone" and "daylight", add +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix +# # Systems Group code and are required by POSIX.1-2008 and later (with XSI), +# # although their contents are unspecified if you use a geographical TZ +# # and the variables are planned to be removed in a future edition of POSIX. +# # If not defined, the code attempts to guess USG_COMPAT from other macros. +# # +# # To support the external variable "altzone", add +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" +# # to the end of the "CFLAGS=" line; although "altzone" appeared in +# # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the following +# functions to be added to the time conversion library. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. +# "timelocal" is nearly equivalent to "mktime". +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined to nonzero the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the timezone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and POSIX conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for January days before +# January's first Monday when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. + +#CFLAGS= -O 1 + + +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. +# The commented-out values are the defaults specified by POSIX.1-2024. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make + +# Where to fetch leap-seconds.list from. +leaplist_URI = \ + https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list +# The file is generated by the IERS Earth Orientation Centre, in Paris. +leaplist_TZ = Europe/Paris + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around bugs in older applications, +# possibly at the expense of introducing bugs in newer ones, +# append "-b fat"; see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' + +# The name of a POSIX-compliant 'awk' on your system. +# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. +# Also, it is better (though not essential) if 'awk' supports UTF-8, +# and unfortunately mawk and busybox awk do not support UTF-8. +# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. +AWK= awk + +# The full path name of a POSIX-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# Name of curl , used for HTML validation +# and to fetch leap-seconds.list from upstream. +# Set CURL=: to disable use of the Internet. +CURL= curl + +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# These non-alphabetic, non-ASCII printable characters are Latin-1, +# and so are likely displayable even in editors like XEmacs 21 +# that have limited display capabilities. +UNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ +# Non-ASCII non-letters that OK_CHAR allows, as these characters are +# useful in commentary. +UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) + +# Put this in a bracket expression to match spaces. +s = [:space:] + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and +# multibyte letters are also allowed so that commentary can contain a +# few safe symbols and people's names and can quote non-English sources. +# Other non-letters are limited to ASCII renderings for the +# convenience of maintainers using XEmacs 21.5.34, which by default +# mishandles Unicode characters U+0100 and greater. +OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --format=pax --pax-option=delete=atime,delete=ctime \ + --numeric-owner --owner=0 --group=0 \ + --mode=go+u,go-w --sort=name +SETUP_TAR= \ + export LC_ALL=C && \ + if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; then \ + TAR='tar $(GNUTARFLAGS)'; \ + else \ + TAR=tar; \ + fi + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. +SETUP_DIFF_TZS = \ + if diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1; then \ + DIFF_TZS='diff -u -F^TZ='; \ + else \ + DIFF_TZS='diff -u'; \ + fi + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh + +# End of macros that one plausibly might want to tailor. +############################################################################### + + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README SECURITY theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=theory.ck tz-art.ck tz-how-to.ck tz-link.ck +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) etcetera +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward +TDATA= $(YDATA) $(NDATA) $(BACKWARD) +ZONETABLES= zone.tab zone1970.tab zonenow.tab +TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ + $(PACKRATDATA) $(PACKRATLIST) +DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) +DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ + leapseconds $(ZONETABLES) +AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) +TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs - TZS_DEPS= $(YDATA) asctime.c localtime.c \ - private.h tzfile.h zdump.c zic.c ++TZS_DEPS= $(YDATA) localtime.c private.h \ ++ strftime.c tzfile.h zdump.c zic.c +TZDATA_DIST = $(COMMON) $(DATA) $(MISC) +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checknow.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + private.h southamerica strftime.c theory.html \ + time2posix.3 tz-art.html tz-how-to.html tz-link.html \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ + ziguard.awk zishrink.awk \ + zone.tab zone1970.tab zonenow.tab + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ + -p $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +# Calculate version number from git, if available. +# Otherwise, use $(VERSION) unless it is "unknown" and there is already +# a 'version' file, in which case reuse the existing 'version' contents +# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=$$(git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty) || \ + if test '$(VERSION)' = unknown && read -r V <$@; then \ + V=$${V%-dirty}-dirty; \ + else \ + V='$(VERSION)'; \ + fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) \ + -v DATAFORM=$(@:.zi=) \ + -v PACKRATDATA='$(PACKRATDATA)' \ + -v PACKRATLIST='$(PACKRATLIST)' \ + -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk + read -r version $@.out + mv $@.out $@ + +tzdir.h: + printf '%s\n' >$@.out \ + '#ifndef TZDEFAULT' \ + '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ + '#endif' \ + '#ifndef TZDIR' \ + '# define TZDIR "$(TZDIR)" /* TZif directory */' \ + '#endif' + mv $@.out $@ + +version.h: version + read -r VERSION $@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +leapseconds: $(LEAP_DEPS) + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Awk script to extract a Git-style author from leap-seconds.list comments. +EXTRACT_AUTHOR = \ + author_line { sub(/^.[[:space:]]*/, ""); \ + sub(/:[[:space:]]*/, " <"); \ + printf "%s>\n", $$0; \ + success = 1; \ + exit \ + } \ + /Questions or comments to:/ { author_line = 1 } \ + END { exit !success } + +# Fetch leap-seconds.list from upstream. +fetch-leap-seconds.list: + $(CURL) -OR $(leaplist_URI) + +# Fetch leap-seconds.list from upstream and commit it to the local repository. +commit-leap-seconds.list: fetch-leap-seconds.list + author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ + date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ + git commit --author="$$author" --date="$$date" -m'make $@' \ + leap-seconds.list + +# Arguments to pass to submakes. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + PACKRATDATA='$(PACKRATDATA)' \ + PACKRATLIST='$(PACKRATLIST)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + +posix_only: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) tzdata.zi + +right_only: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) -L leapseconds tzdata.zi + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i $(TZS_CUTOFF_FLAG) "$$PWD/$(@:.zd=)" >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + x=$$($(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2) && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ + $(MAKE) TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + +# If $(TZS) exists but 'make tzs.ck' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + touch $@ + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + read -r VERSION $@.out + chmod +x $@.out + mv $@.out $@ + - check: check_mild back.ck ++check: check_mild back.ck now.ck +check_mild: check_web check_zishrink \ + character-set.ck white-space.ck links.ck mainguard.ck \ - name-lengths.ck now.ck slashed-abbrs.ck sorted.ck \ ++ name-lengths.ck slashed-abbrs.ck sorted.ck \ + tables.ck ziguard.ck tzs.ck + +# True if UTF8_LOCALE does not work; +# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). +UTF8_LOCALE_MISSING = \ + { test ! '$(UTF8_LOCALE)' \ + || ! printf 'A\304\200B\n' \ + | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ + || { export LC_ALL='$(UTF8_LOCALE)'; false; }; } + +character-set.ck: $(ENCHILADA) + $(UTF8_LOCALE_MISSING) || { \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ + CONTRIBUTING LICENSE README SECURITY \ + version tzdata.zi && \ + ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ + Makefile && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ + leapseconds zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA); \ + } + touch $@ + +white-space.ck: $(ENCHILADA) + $(UTF8_LOCALE_MISSING) || { \ + enchilada='$(ENCHILADA)' && \ + patfmt=' \t|[\f\r\v]' && pat=$$(printf "$$patfmt\\n") && \ + ! grep -En "$$pat|[$s]\$$" \ + $${enchilada%leap-seconds.list*} \ + $${enchilada#*leap-seconds.list}; \ + } + touch $@ + +PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ +FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} + +name-lengths.ck: $(TDATA_TO_CHECK) backzone + :;! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + touch $@ + +mainguard.ck: main.zi + test '$(PACKRATLIST)' || \ + cat $(TDATA) $(PACKRATDATA) | diff -u - main.zi + touch $@ + +PRECEDES_STDOFF = ^(Zone[$s]+[^$s]+)?[$s]+ +STDOFF = [-+]?[0-9:.]+ +RULELESS_SAVE = (-|$(STDOFF)[sd]?) +RULELESS_SLASHED_ABBRS = \ + $(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/ + +slashed-abbrs.ck: $(TDATA_TO_CHECK) + :;! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) + touch $@ + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +sorted.ck: backward backzone + $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ + backward | LC_ALL=C sort -cu + $(AWK) '/^Zone.*\// {print $$2}' backzone | LC_ALL=C sort -cu + touch $@ + +back.ck: checklinks.awk $(TDATA_TO_CHECK) + $(AWK) \ + -v DATAFORM=$(DATAFORM) \ + -v backcheck=backward \ *** 477 LINES SKIPPED *** From nobody Fri Jan 17 02:25:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ3V735R6z5kGSH; Fri, 17 Jan 2025 02:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ3V72VD7z3bSH; Fri, 17 Jan 2025 02:25:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737080703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKbHUq7I+BARafDd61OQD4jcY8KVk64v7k8xWI99CGg=; b=E9ABa9E4vflS4WMMwGNilJ1mvyK57OQEKJvvO9SJtu/WcO44ElFcCWbdIk9PwqDOjt1RSX lfIaYjFbN7tSxsDnxspWyR8Nqodk8nCZCjrf8trfNeWzwFe+pE69+/CzHh4XAGvoSUd2hl HDawK3DKZEqhOkL+oaW3ZRJd4GExt8DfFSepbaGG3/YtzWv3IUJFc5Nq285qEnrsJmAfa9 E/BIu6qKm295T/y2Pevm3j28uwdfs+wBEI1e0tc79W2x++AvJR/dLBbzuaP8Ip1fwavGSw +wjOnAhikVX9dGpby12nspli7PVeD0Qsyv7MGVIc4Zy3CBsPVmqfRpR8F5rhjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737080703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKbHUq7I+BARafDd61OQD4jcY8KVk64v7k8xWI99CGg=; b=QaOepxZJ/dZx03oxg9YmZZb6w4Y8+oMJW9i+mYvUozPdt6/m6VZ85SPIcLspyZdj3gR0q1 hkR+V+neCO6FUsjnY0byokRCjR4DdxzZfvVRw6w0f4FSg6HC5/cJho+Wtqu5USiKi+DHLx xO9Qnq6rMYApAPMe058c9NfUYWiHGMO1oPakY0+GDa3UauCkuCCHRiVjy6bzcUW8dvyood HPL6DEtN8vgtPjE5HPLDeNSv3HWiQVLD0/qR2aHb3CuObvmDw/ULiCZmNDyKpFmMaKl+Kx P1j8nGQ3AlvT8wJOBhYFCDQ/UQ1XweCC/vEPARpt/HYZCLI+WNhYmqmogEFytg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737080703; a=rsa-sha256; cv=none; b=HeCFlW/P4D/jiNPCLvCvNrk1JQabysIclT26kDB1a9EBFLt6jxEKTs9k8dB+oAQRveirS8 R4G63GTpe/OO+Iy9CF+JNaiHjthMnaKXz4P/pWE0yeDk/X0qGW8Vw+3RaY72IXkFds9loE RIU0Djd4cnlHHG8Ctc6Pe+fYQ9Ll62SZLeJgAZf2+DhByOs3EAYhLQvR3jHkf8ut7BXRqE a9ISYZisFWXF6d/GH6PeSK3vwBnX150tcj2WTqqEwnY5cB+IKkLlu92A1S031hnEUk1j7d quGx88nrNyG8I23ynH/9B/kNtvXAYRO2Hv+87RjQ8uxslGCa4wmBGEZBUQVmBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ3V71ymQzxqF; Fri, 17 Jan 2025 02:25: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 50H2P3iB028265; Fri, 17 Jan 2025 02:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H2P3HJ028262; Fri, 17 Jan 2025 02:25:03 GMT (envelope-from git) Date: Fri, 17 Jan 2025 02:25:03 GMT Message-Id: <202501170225.50H2P3HJ028262@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: 40462a376a32 - main - genl: stop using struct _getfamily_attrs, snl_genl_ctrl_mcast_group List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40462a376a324c19845a5f696c565069142ef326 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=40462a376a324c19845a5f696c565069142ef326 commit 40462a376a324c19845a5f696c565069142ef326 Author: Gleb Smirnoff AuthorDate: 2025-01-17 02:20:13 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 02:24:32 +0000 genl: stop using struct _getfamily_attrs, snl_genl_ctrl_mcast_group This program has two modes: monitor a single family and dump known families. The former uses directly snl_get_genl_family_info() which uses supposedly internal struct _getfamily_attrs as the argument. The latter uses a parser named genl_family_parser that makes a mixture of local definitions and definitions from . While the struct genl_family_parser is local, it points at struct snl_genl_ctrl_mcast_groups and struct snl_genl_ctrl_mcast_group that are supposedly private to netlink_snl_generic.h, as are hanging off the underscored _getfamily_attrs. Rewrite this mess by using same parser for both modes, that is fully implemented locally. This parser has another very important difference to the one declared in the header library. It will copy strings out of the message into memory allocated within the snl_state. With the header library parser strings point into received packet and contents will be overwritten on next netlink message. This is not a bug with existing genl(1) program, but it would be with future changes. Reviewed by: melifaro Differential Revision: https://reviews.freebsd.org/D48479 --- usr.bin/genl/genl.c | 149 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 112 insertions(+), 37 deletions(-) diff --git a/usr.bin/genl/genl.c b/usr.bin/genl/genl.c index dd0c3af30c9c..cb01c6bcdd26 100644 --- a/usr.bin/genl/genl.c +++ b/usr.bin/genl/genl.c @@ -81,43 +81,103 @@ static struct snl_attr_parser ap_nlevent_get[] = { #undef _OUT SNL_DECLARE_GENL_PARSER(nlevent_get_parser, ap_nlevent_get); +/* + * We run our own parser(s) for CTRL_CMD_GETFAMILY instead of interfaces + * provided by . One reason is that we want the parsed + * string attributes to point into long living memory, instead of inside of + * just received message, hence we use snl_attr_get_stringn() instead of the + * snl_attr_get_string(). The shared library uses the latter to avoid creating + * ambiguous memory leaks. Second reason is that genl(1) usage of the data is + * more extended than typical application that cares only of its own family and + * usually one group. We are going to cycle around all available. + */ struct genl_ctrl_op { uint32_t id; uint32_t flags; }; - struct genl_ctrl_ops { uint32_t num_ops; struct genl_ctrl_op **ops; }; - +static struct snl_attr_parser nla_p_getops[] = { #define _OUT(_field) offsetof(struct genl_ctrl_op, _field) -static struct snl_attr_parser _nla_p_getops[] = { - { .type = CTRL_ATTR_OP_ID, .off = _OUT(id), .cb = snl_attr_get_uint32}, - { .type = CTRL_ATTR_OP_FLAGS, .off = _OUT(flags), .cb = snl_attr_get_uint32 }, + { + .type = CTRL_ATTR_OP_ID, + .off = _OUT(id), + .cb = snl_attr_get_uint32 + }, + { + .type = CTRL_ATTR_OP_FLAGS, + .off = _OUT(flags), + .cb = snl_attr_get_uint32 + }, +#undef _OUT +}; +SNL_DECLARE_ATTR_PARSER_EXT(genl_ctrl_op_parser, sizeof(struct genl_ctrl_op), + nla_p_getops, NULL); + +struct genl_mcast_group { + uint32_t id; + const char *name; }; +struct genl_mcast_groups { + uint32_t num_groups; + struct genl_mcast_group **groups; +}; +static struct snl_attr_parser nla_p_getmc[] = { +#define _OUT(_field) offsetof(struct genl_mcast_group, _field) + { + .type = CTRL_ATTR_MCAST_GRP_NAME, + .off = _OUT(name), + .cb = snl_attr_get_stringn, + }, + { + .type = CTRL_ATTR_MCAST_GRP_ID, + .off = _OUT(id), + .cb = snl_attr_get_uint32, + }, #undef _OUT -SNL_DECLARE_ATTR_PARSER_EXT(genl_ctrl_op_parser, - sizeof(struct genl_ctrl_op), - _nla_p_getops, NULL); +}; +SNL_DECLARE_ATTR_PARSER_EXT(genl_mc_parser, sizeof(struct genl_mcast_group), + nla_p_getmc, NULL); struct genl_family { uint16_t id; - char *name; + const char *name; uint32_t version; uint32_t hdrsize; uint32_t max_attr; - struct snl_genl_ctrl_mcast_groups mcast_groups; + struct genl_mcast_groups mcast_groups; struct genl_ctrl_ops ops; }; +static struct snl_attr_parser nla_p_getfamily[] = { #define _OUT(_field) offsetof(struct genl_family, _field) -static struct snl_attr_parser _nla_p_getfamily[] = { - { .type = CTRL_ATTR_FAMILY_ID , .off = _OUT(id), .cb = snl_attr_get_uint16 }, - { .type = CTRL_ATTR_FAMILY_NAME, .off = _OUT(name), .cb = snl_attr_get_string }, - { .type = CTRL_ATTR_VERSION, .off = _OUT(version), .cb = snl_attr_get_uint32 }, - { .type = CTRL_ATTR_VERSION, .off = _OUT(hdrsize), .cb = snl_attr_get_uint32 }, - { .type = CTRL_ATTR_MAXATTR, .off = _OUT(max_attr), .cb = snl_attr_get_uint32 }, + { + .type = CTRL_ATTR_FAMILY_ID, + .off = _OUT(id), + .cb = snl_attr_get_uint16, + }, + { + .type = CTRL_ATTR_FAMILY_NAME, + .off = _OUT(name), + .cb = snl_attr_get_stringn, + }, + { + .type = CTRL_ATTR_VERSION, + .off = _OUT(version), + .cb = snl_attr_get_uint32, + }, + { + .type = CTRL_ATTR_VERSION, + .off = _OUT(hdrsize), + .cb = snl_attr_get_uint32, + }, + { + .type = CTRL_ATTR_MAXATTR, + .off = _OUT(max_attr), + .cb = snl_attr_get_uint32, + }, { .type = CTRL_ATTR_OPS, .off = _OUT(ops), @@ -128,11 +188,11 @@ static struct snl_attr_parser _nla_p_getfamily[] = { .type = CTRL_ATTR_MCAST_GROUPS, .off = _OUT(mcast_groups), .cb = snl_attr_get_parray, - .arg = &_genl_ctrl_mc_parser, + .arg = &genl_mc_parser, }, -}; #undef _OUT -SNL_DECLARE_GENL_PARSER(genl_family_parser, _nla_p_getfamily); +}; +SNL_DECLARE_GENL_PARSER(genl_family_parser, nla_p_getfamily); static struct op_capability { uint32_t flag; @@ -162,15 +222,15 @@ dump_operations(struct genl_ctrl_ops *ops) } static void -dump_mcast_groups( struct snl_genl_ctrl_mcast_groups *mcast_groups) +dump_mcast_groups(struct genl_mcast_groups *mcast_groups) { if (mcast_groups->num_groups == 0) return; printf("\tmulticast groups: \n"); for (uint32_t i = 0; i < mcast_groups->num_groups; i++) printf("\t - ID: %#02x, Name: %s\n", - mcast_groups->groups[i]->mcast_grp_id, - mcast_groups->groups[i]->mcast_grp_name); + mcast_groups->groups[i]->id, + mcast_groups->groups[i]->name); } static void @@ -222,39 +282,53 @@ parser_fallback(struct snl_state *ss __unused, struct nlmsghdr *hdr __unused) printf("New unknown message\n"); } -int -monitor_mcast(int argc __unused, char **argv) +/* Populated by monitor_mcast() and may be used by protocol parser callbacks. */ +static struct genl_family attrs; + +static int +monitor_mcast(int argc, char **argv) { struct snl_state ss; + struct snl_writer nw; struct nlmsghdr *hdr; - struct _getfamily_attrs attrs; struct pollfd pfd; bool found = false; bool all = false; void (*parser)(struct snl_state *ss, struct nlmsghdr *hdr); - parser = parser_fallback; - - if (!snl_init(&ss, NETLINK_GENERIC)) - err(EXIT_FAILURE, "snl_init()"); - if (argc < 1 || argc > 2) { usage(); return (EXIT_FAILURE); } - if (!snl_get_genl_family_info(&ss, argv[0], &attrs)) - errx(EXIT_FAILURE, "Unknown family '%s'", argv[0]); + if (!snl_init(&ss, NETLINK_GENERIC)) + err(EXIT_FAILURE, "snl_init()"); + snl_init_writer(&ss, &nw); + snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); + snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, argv[0]); + if ((hdr = snl_finalize_msg(&nw)) == NULL) + err(EXIT_FAILURE, "snl_finalize_msg"); + if (!snl_send_message(&ss, hdr)) + err(EXIT_FAILURE, "snl_send_message"); + hdr = snl_read_reply(&ss, hdr->nlmsg_seq); + if (hdr == NULL) + err(EXIT_FAILURE, "snl_read_reply"); + if (hdr->nlmsg_type == NLMSG_ERROR) + err(EXIT_FAILURE, "netlink(4) returned error"); + memset(&attrs, 0, sizeof(attrs)); + if (!snl_parse_nlmsg(&ss, hdr, &genl_family_parser, &attrs)) + err(EXIT_FAILURE, "snl_parse_nlmsg CTRL_CMD_GETFAMILY"); + if (argc == 1) all = true; - for (unsigned int i = 0; i < attrs.mcast_groups.num_groups; i++) { - if (all || strcmp(attrs.mcast_groups.groups[i]->mcast_grp_name, - argv[1]) == 0) { + for (u_int i = 0; i < attrs.mcast_groups.num_groups; i++) { + if (all || + strcmp(attrs.mcast_groups.groups[i]->name, argv[1]) == 0) { found = true; if (setsockopt(ss.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, - &attrs.mcast_groups.groups[i]->mcast_grp_id, - sizeof(attrs.mcast_groups.groups[i]->mcast_grp_id)) + &attrs.mcast_groups.groups[i]->id, + sizeof(attrs.mcast_groups.groups[i]->id)) == -1) err(EXIT_FAILURE, "Cannot subscribe to command " "notify"); @@ -265,6 +339,7 @@ monitor_mcast(int argc __unused, char **argv) if (!found) errx(EXIT_FAILURE, "No such multicast group '%s'" " in family '%s'", argv[1], argv[0]); + parser = parser_fallback; for (size_t i= 0; i < nitems(mcast_parsers); i++) { if (strcmp(mcast_parsers[i].family, argv[0]) == 0) { parser = mcast_parsers[i].parser; From nobody Fri Jan 17 02:31:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ3f30gl4z5kGNC; Fri, 17 Jan 2025 02:31:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ3f26dDYz3c0Y; Fri, 17 Jan 2025 02:31:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eu55K+fdjyf//fBBFl2q4GF4SdEgHOW7TghZty3JutY=; b=R/RhWyDVM4MqgZUg2VZr4ht2sIyIF9y5InzqhixCLRVB0L/DQvfnBqx2OjAPBuFiJgv6dD AAmtKZKHpQ64LAzAdGOoy8c/sNgdUh5NHzZ3L9wcBwqTubcG2aGeDoju7Bn1dwCPVOgmJ0 BYYLSHTpod3wodiLWEULs2fmCmquYaXpZxVMSf3cyHdx9H2Ea9SBIPM7IemfuBw5c/N4Bu TKeqQaqJ+LnSuJqPBMrSxF3s78de1y+r5qZOXuCwu6SFzv9X32Fqh8MXcdJByhx5YeJfTK AVbOSzPZh50J0cIHuiZuyzZvhU6b6fqZiNeTuZ1ak9BhD8pfpHUQ0g7ygzMurA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Eu55K+fdjyf//fBBFl2q4GF4SdEgHOW7TghZty3JutY=; b=EI5FO0jW9FWH/+NuKjhN0phfcUv2/En/LmiGX4b2lhFMqb71IH6wTKQnZQbmc0qXeHlZ/C 34f1ZTjZF6IV40+KiuZoPVhwQcMtXMkWQAmLXp5UDSMCc6pLFbpUqhk4fBWqBRmuo1t1U1 7FL1i7MmjzW3w9qLfZhTcbPscjAXnGWqHOre29+NG/kaDGpgFldp5SCSBFnf7qKtW7lyFI aS2UAYNnUk/T+Jp6+XBvtZ5KiwjhI6rfB98XPCILhfq+cvw6fIyMfNiMPv67RMniKYDaZA oFbxRYGTNpWP/T+kj2gZYU/er3DpCfIi/rpGJ9Bnj9tbZ4FwxLWpSUYpXwqhpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737081114; a=rsa-sha256; cv=none; b=ujqOg9WbUAQ0mKmaMNzwcmGpXRMY0gb2C9acKuSrSfLnlNsut554Docga1PFvrIlYJu9qM AtYcUa2V1XghQhWlW5qORu0I3XOMoBni8E3Ip2S5N1Fxery1Fgp2xmTJ4fkdMN3KTVYd/+ 5FmLBs1ItH3JTtlLC+nK3UdWy7rPxLwULw2nMn+cDYpj1Y5MIfnUpZ4ZGMY5BQPbfE/FhI bw+spUttQw70JSb9cY9a/jGUXHXa033kQ5gKiRZwTUnOLSnLIQ7F6aL6GYCQI+wwAmx1KR TQBQti0b6DmFJe4NzmsUHAEsrmpZ62QNI+0YXKW02LM6rWzu1ijggYSNBpD9Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ3f26DQPz106k; Fri, 17 Jan 2025 02:31: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 50H2Vsls044419; Fri, 17 Jan 2025 02:31:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H2VsT1044416; Fri, 17 Jan 2025 02:31:54 GMT (envelope-from git) Date: Fri, 17 Jan 2025 02:31:54 GMT Message-Id: <202501170231.50H2VsT1044416@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: 1e9bca400b9c - main - sockets: assert VNET set in sopeeraddr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e9bca400b9c7ae3dc3f31aa48df69cf2259e16c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1e9bca400b9c7ae3dc3f31aa48df69cf2259e16c commit 1e9bca400b9c7ae3dc3f31aa48df69cf2259e16c Author: Gleb Smirnoff AuthorDate: 2025-01-17 02:31:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 02:31:15 +0000 sockets: assert VNET set in sopeeraddr() Most callers already have the context set, it was only bare syscall that needs it to set. --- sys/kern/uipc_socket.c | 4 ++-- sys/kern/uipc_syscalls.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 426316ac6ce8..46a7053f2872 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2030,11 +2030,11 @@ sopeeraddr(struct socket *so, struct sockaddr *sa) #endif int error; - CURVNET_SET(so->so_vnet); + CURVNET_ASSERT_SET(); + error = so->so_proto->pr_peeraddr(so, sa); KASSERT(sa->sa_len <= len, ("%s: protocol %p sockaddr overflow", __func__, so->so_proto)); - CURVNET_RESTORE(); return (error); } diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index e0bb7ace92c6..91fcdf9a7a9d 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1433,7 +1433,9 @@ kern_getpeername(struct thread *td, int fd, struct sockaddr *sa) error = ENOTCONN; goto done; } + CURVNET_SET(so->so_vnet); error = sopeeraddr(so, sa); + CURVNET_RESTORE(); #ifdef KTRACE if (error == 0 && KTRPOINT(td, KTR_STRUCT)) ktrsockaddr(sa); From nobody Fri Jan 17 02:31:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ3f4244Tz5kH04; Fri, 17 Jan 2025 02:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ3f40qX2z3cMT; Fri, 17 Jan 2025 02:31:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCsuWDcy2Y3/MQL3IEIx65v91ppQOYQk5L3auj6zyEQ=; b=bxtMMeQXGxblJzFZ0Obdg4tWA8NDQpI+QIn1L4fAllBQnHzmF4qSmJUUhdUaGTOpUva+z2 RwDYc7WI9oFZdpfsGkmXMCwEQ1USXc+RCSFysOHUqSphOVsXx2BUQBzOxNSSJf//Z2znkD ZAaDUz2UowgPconwEsT/s30hvl7bvQjdF3LLsQ1bC/QOL88VwFoG3Vw9k/YMZ7/Sd1AlHd +RRabWK5rNfT1UywFnNI8lorNutUC/hBXijcEaAxdoa/+wB+/DDHlpHVqB1nQdsVKaKMIu 6ruDEfPPSGSWo7gAI7Ez0ODapNz5Gne1LKh2MJvA7HnSG0Dd95ABn/fIY7MO0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cCsuWDcy2Y3/MQL3IEIx65v91ppQOYQk5L3auj6zyEQ=; b=dqI+BzdtQ7/H5V9qjJlbYxG0ITYggl/bpR3SVurMyTRLSVSc7EbIcr2GQvP/pRr7Y5MCG0 MsGCefTiftOIaXTv0EWtXvYLcKbGcQDaeWe5kWGXNofbBYPjfFx76TldStbvySjevShy7E ijiObWSBSrfL3xPWCR/3yPwvsdhtZ3XP3yHNWYF4TPhQtDLG5m8vJF2igHBFeGaIX3UUpa Pw5Gqx0rz+td6kQqryfD60/Yr3eiipMIzQVDQMy7YEnxn+G5NdDzKQlg/qbM1Wv8cYAVcg M6OU4y8k+v8rWYKgt22LqaC94viMFpi1r9OsBxCRYTK4xUcsmZF/l91Aq3TO2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737081116; a=rsa-sha256; cv=none; b=CMtrLT0IJkxYj0YvO8jUPJ3MnoOYQ9WCQWwwTu/qAK/rW7cBqB40BR0dxwJHo9kKUdjlAE BmmfRjxd7jjjKD6QDrnuoPfwzPe0azfd3L8XS/hSlU6G34p/5xhheH9ulJQR2kUk+aWJ7O IJPBGysrbF3KqtaZBn6AgPqJ5PNjQ7HVBvtBB4iQ0SOC6Jx0/5YD1A/FUt1uUMf4A9bSe1 JFY+hTIKSkc65wj7tdxh+5+iR4sUNMqr7UkGpeppujrmwNtlFxj5CBM6NBh2qVCs+7RGkB kbO66e7P8viGNOcjuue72TG6qbFXleDPswP02WPs1C+UAlVtt9NvkHPX17n8XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ3f40QVWz106l; Fri, 17 Jan 2025 02:31: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 50H2VtJV044467; Fri, 17 Jan 2025 02:31:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H2VtNN044464; Fri, 17 Jan 2025 02:31:55 GMT (envelope-from git) Date: Fri, 17 Jan 2025 02:31:55 GMT Message-Id: <202501170231.50H2VtNN044464@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: a1be7978f187 - main - netisr: avoid VNET recursion warning in netisr_register() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1be7978f1879313c141882a1e0812b468dead57 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a1be7978f1879313c141882a1e0812b468dead57 commit a1be7978f1879313c141882a1e0812b468dead57 Author: Gleb Smirnoff AuthorDate: 2025-01-17 02:31:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 02:31:15 +0000 netisr: avoid VNET recursion warning in netisr_register() While here, move some assertions to the top of the function. --- sys/net/netisr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 4ae1aa9ab89d..e9b8fa4d833c 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -395,6 +395,9 @@ netisr_register(const struct netisr_handler *nhp) /* * Test that the requested registration is valid. */ + CURVNET_ASSERT_SET(); + KASSERT(IS_DEFAULT_VNET(curvnet), ("%s: curvnet %p is not vnet0 %p", + __func__, curvnet, vnet0)); KASSERT(nhp->nh_name != NULL, ("%s: nh_name NULL for %u", __func__, proto)); KASSERT(nhp->nh_handler != NULL, @@ -454,15 +457,12 @@ netisr_register(const struct netisr_handler *nhp) npwp->nw_qlimit = netisr_proto[proto].np_qlimit; } + V_netisr_enable[proto] = 1; #ifdef VIMAGE - /* - * Test that we are in vnet0 and have a curvnet set. - */ - KASSERT(curvnet != NULL, ("%s: curvnet is NULL", __func__)); - KASSERT(IS_DEFAULT_VNET(curvnet), ("%s: curvnet %p is not vnet0 %p", - __func__, curvnet, vnet0)); VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { + if (vnet_iter == curvnet) + continue; CURVNET_SET(vnet_iter); V_netisr_enable[proto] = 1; CURVNET_RESTORE(); From nobody Fri Jan 17 02:31:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ3f53kyFz5kGVy; Fri, 17 Jan 2025 02:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ3f51s9rz3cMX; Fri, 17 Jan 2025 02:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gv6kjQp/agWfBOgmt2LpIwHrVnE/crp8gzZIZ0eNdEM=; b=TcQ09zr0quTqtB+I1ysV41T8j0vncuwFDSwQAatlzCruPB1alouUpfysUIDtcM51IgIQfn Kf/co7sYUUDPhNtTzk0r7d3N1SMznpJXK8dOy9YbJWH5yjA08iqLCGYw1d/E7QUMC8Gi26 brRiYJ4NgSpuqrxsk/t3teXj92DIol5Qaixn2QRyRzQrSc6O2kvRAomZemxD5zXiCDVY/a QTZr5l1XyzdP2qB0eSnBXI3ELts5FpInLrUCnXAujfe9Eyb+e1y4AdkDWCy1j9qbR/0vVM OoaKhUvcPkBQtSHbCtGwqwadAEbUfVa6DOmg50b2hiAmOp0oaWjrzLZxhFvK6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737081117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gv6kjQp/agWfBOgmt2LpIwHrVnE/crp8gzZIZ0eNdEM=; b=o1qnFwfZk/Y/4kdjthKnzXSA8FPHALoD6asJx7w9u10pVM7tJG8/3jrdJfq/iYorJ2VpI6 EQ63BKXATkAzIwYVqAu4OkCjv9T2oWtlIIW5tFXJEp5bKVDGbqQgpNSB5YoZNoUNnxCWr6 99VBvzUeHMTMdDN4YQyKj7rTJQnwmHPR+4eYTMyZetdod1GjoKI1xHgDjW7V2OpvnD53Ox 3geqL7S+rB7VaKz+xnKS11CYK4hldiKa0rgv4h3pWSENyBaRkxVa3/YcktCZMdSlT37rAK CGu4BTrYXzSO3NSEL4R88XeKkE9yUWNoZj6SyYHso9RiuHDqzJdaTO/wUmRrhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737081117; a=rsa-sha256; cv=none; b=uxAtur1+Rv7xlNMg/6RHmKRDjg+P0GEoZ6IaUuozfQhvugisuKvDw4FT24qSwAu08DUaO5 68ia2oyJVvnQSxXGtmwOuqJnHG77l2g+GampaSYUbz0OMM1eVC7/Fi/j6VPRmB0wGyo7BY UmgrdyRIBHDfVS9mZJijeS5obONthjomKagKJ/cXcbLyYnA+smmGEpX0nNTQbyc3QCqoFZ OqBEz7+vcW0pMhUVMciBMXjhnhyG5h2SMPPAQmQq01Wrk6CuPHP4/gR6Ji5aWoBWLIs7Ct QPVwqi36zfi2CWNo1Jiv4j890xUyCXzIAkZvsDRu2irvQBqw7pgRTrcmuwpRlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ3f517PTz10Cm; Fri, 17 Jan 2025 02:31: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 50H2VvmX044512; Fri, 17 Jan 2025 02:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H2VvoQ044509; Fri, 17 Jan 2025 02:31:57 GMT (envelope-from git) Date: Fri, 17 Jan 2025 02:31:57 GMT Message-Id: <202501170231.50H2VvoQ044509@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: 4c0e435bfbad - main - unix: avoid VNET recursion in unp_connectat() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c0e435bfbad52358ad6c6508cf3dca2e7b45227 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4c0e435bfbad52358ad6c6508cf3dca2e7b45227 commit 4c0e435bfbad52358ad6c6508cf3dca2e7b45227 Author: Gleb Smirnoff AuthorDate: 2025-01-17 02:31:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 02:31:15 +0000 unix: avoid VNET recursion in unp_connectat() While that might be a cool feature, but you can't connect two sockets in different VNETs. It is just technically impossible right now. This CURVNET_SET() was always setting the same context. --- sys/kern/uipc_usrreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 3d7e5bcc5ad0..c1f1c07da268 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1897,6 +1897,8 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, int error, len; bool connreq; + CURVNET_ASSERT_SET(); + if (nam->sa_family != AF_UNIX) return (EAFNOSUPPORT); if (nam->sa_len > sizeof(struct sockaddr_un)) @@ -1991,11 +1993,9 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam, goto bad2; } if (connreq) { - if (SOLISTENING(so2)) { - CURVNET_SET(so2->so_vnet); + if (SOLISTENING(so2)) so2 = sonewconn(so2, 0); - CURVNET_RESTORE(); - } else + else so2 = NULL; if (so2 == NULL) { error = ECONNREFUSED; From nobody Fri Jan 17 02:53:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ46Y2dlzz5kJ1L; Fri, 17 Jan 2025 02:53:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ46Y22KCz3fBl; Fri, 17 Jan 2025 02:53:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737082389; 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=DtWuQJMYKWZLkde+2M8Hm8XcKhsOm7Oq9JQZ1kYzJLw=; b=KwX0S5Iu/pTqnnezz4rx7UOMIvr3Nbvfn8+fHRyo9Ej7SqTo8Psv4cFBKVzDgPSrZWhe1s X2evwHb+p3/RxsTluREGSjlUiQW8jQZIQiCGWsI/gGGt7qrha79M7s5dgZ9viRfETur0QZ 6BkybxVcJEInMFixrJbaEMptVkRWJO1HZvF/WMjwEo41fKSaLtmba+C5JsqTSrbM8lC9Oe +IyCuey3ErGWk1iBW6Ep5SDq08Yxn1W3MlOTgFg3GPhK2rzGH6KJonPkYw8Crj82bIXEV4 Y2DBtB0GANRUR1+PPzrq4+0FghXOB8LA4f41oCWpSzWPWCy2RKbvuKfZBB26Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737082389; 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=DtWuQJMYKWZLkde+2M8Hm8XcKhsOm7Oq9JQZ1kYzJLw=; b=ZpHf026bfj+8F2lflbr7InpnSTZyRzY6hYX3y9GTY92NWEVnIuBGzRtdJcBqrHdJRxXhAj 2BZSy8AcK7mVJZWXGKM958+OET5Px6zpYYBGf4SgI1q55M7MZO/+yyHTDXPZ24hWEO0rOb BQp98UzCX54Wv2fpYNWHB5InT5QN7MIZKp9pobi0w9CdjdFl40cpLR+3zTkEJ96EX4yf/2 somz48G50qPeGhlSUkvmnFTMYn0UahtI0N+SHRAw8+BpmGVjGmyoOHon5dwTnP2jJOdm/y JqsZtjQXpP+TKFlG7SaWDZPvrH0rLO6oKINEcNLxmzg4hDbWk0NT5la7agyKJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737082389; a=rsa-sha256; cv=none; b=YKpBL2Z36SA7v8MwHGMFiFc8X7XJaQ/OGmgVkN5dmU5tqu5pwhjVWa0p0EVnJS82DzTumZ p19Z2yWWx2ndgMSugV7BJh9g6zKWEf/Fu3Q7qzse2aFWYc6LoQek5RDuQKwhcDeZRSwc5A hWhdxJT7yDDyZn3xL5aSNmMC/hOrh1fkXKrsufcgcfTsh+NYC612UHizIonXedhN+lR4i7 RYN+6SfQ/+BGW6BRjSP5Buk04rndNBkwQfkId321jFCJRv98Rs2HzIjBXjh8Y5UJWRVD2N 9Q7Lj5MdhkhpCa0oGsiepbls2zEoKTHPPmkEr33tMY4srmHgxLrPog/p9trgKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YZ46X5lmPz154Q; Fri, 17 Jan 2025 02:53:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Thu, 16 Jan 2025 20:53:07 -0600 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Warner Losh References: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> Content-Language: en-US From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/16/25 16:43, Brooks Davis wrote: > On Thu, Jan 16, 2025 at 03:52:22PM -0600, Kyle Evans wrote: >> On 10/30/24 16:08, Brooks Davis wrote: >>> The branch main has been updated by brooks: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 >>> >>> commit 9ded074e875c29cb92d5f643801990d7bb23cca4 >>> Author: agge3 >>> AuthorDate: 2024-10-21 21:42:13 +0000 >>> Commit: Brooks Davis >>> CommitDate: 2024-10-30 21:04:30 +0000 >>> >>> Refactor makesyscalls.lua into a library >>> * main.lua replicates the functionality of makesyscalls.lua >>> * Individual files are generated by their associated module >>> * Modules can be called as standalone scripts to generate a specific >>> file >>> * Data and procedures are performed by objects instead of procedual code >>> * Bitmasks are replaced by declarative types >>> * Temporary files are no longer produced, writing is stored in memory >>> * Comments provide explanation to functions and semantics >>> Google Summer of Code 2024 Final Work Product >>> Co-authored-by: Warner Losh >>> Co-authored-by: Kyle Evans >>> Co-authored-by: Brooks Davis >>> Sponsored by: Google (GSoC 24) >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 >>> Signed-off-by: agge3 >>> --- >>> sys/tools/syscalls/README.md | 49 +++ >>> sys/tools/syscalls/config.lua | 312 +++++++++++++++++ >>> sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ >>> sys/tools/syscalls/core/scarg.lua | 163 +++++++++ >>> sys/tools/syscalls/core/scret.lua | 45 +++ >>> sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ >>> sys/tools/syscalls/main.lua | 64 ++++ >>> sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ >>> sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ >>> sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ >>> sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ >>> sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ >>> sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ >>> sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ >>> sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ >>> sys/tools/syscalls/tools/generator.lua | 113 ++++++ >>> sys/tools/syscalls/tools/util.lua | 194 +++++++++++ >>> 17 files changed, 2768 insertions(+) >>> >>> [...] >>> diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua >>> new file mode 100644 >>> index 000000000000..193b1e43563c >>> --- /dev/null >>> +++ b/sys/tools/syscalls/core/freebsd-syscall.lua >>> @@ -0,0 +1,147 @@ >>> [...] >>> +function FreeBSDSyscall:parseSysfile() >>> + local file = self.sysfile >>> + local config = self.config >>> + local commentExpr = "^%s*;.*" >>> + >>> + if file == nil then >>> + return nil, "No file given" >>> + end >>> + >>> + self.syscalls = {} >>> + >>> + local fh, msg = io.open(file) >>> + if fh == nil then >>> + return nil, msg >>> + end >>> + >>> + local incs = "" >>> + local defs = "" >>> + local s >>> + for line in fh:lines() do >>> + line = line:gsub(commentExpr, "") -- Strip any comments. >>> + -- NOTE: Can't use pure pattern matching here because of >>> + -- the 's' test and this is shorter than a generic pattern >>> + -- matching pattern. >>> + if line == nil or line == "" then >>> + goto skip -- Blank line, skip this line. >>> + elseif s ~= nil then >>> + -- If we have a partial system call object s, >>> + -- then feed it one more line. >>> + if s:add(line) then >>> + -- Append to system call list. >>> + for t in s:iter() do >>> + if t:validate(t.num - 1) then >>> + table.insert(self.syscalls, t) >>> + else >>> + util.abort(1, >>> + "Skipped system call " .. >>> + "at number " .. t.num) >>> + end >>> + end >>> + s = nil >>> + end >>> + elseif line:match("^#%s*include") then >>> + incs = incs .. line .. "\n" >>> + elseif line:match("%%ABI_HEADERS%%") then >>> + local h = self.config.abi_headers >>> + if h ~= nil and h ~= "" then >>> + incs = incs .. h .. "\n" >>> + end >>> + elseif line:match("^#%s*define") then >>> + defs = defs .. line.. "\n" >>> + elseif line:match("^#") then >>> + util.abort(1, "Unsupported cpp op " .. line) >> >> This specifically is kind of a huge regression, and I don't really know how to >> cope with it. We've guaranteed for years that we'll copy preprocessor >> directives through to all output files. We don't use that upstream in >> FreeBSD, but we work with downstreams/vendors that make extensive use of it in >> their syscall definitions. >> >> I don't really know what the answer is to this, but we probably shouldn't have >> dropped it without some discussion first. This is going to be a bit of a >> headache... > > This response seems rather hyperbolic. This change was up for review > for months and the feature is unused in tree so there was no way to know > it was important. > Re-reading, yes, this was a bit dramatic; my apologies. There's plenty of frustration here, mostly amplified by the fact that I was on the review just as much as you folks and have worked in environments that use it- it certainly should have stuck out to me, but I just didn't have the time into it that I'd hoped I would. I would've also really liked to see an "XXX" comment at a minimum drawing attention to it or a call-out in the commit message, given that the syscall definition documentation isn't that lengthy and this is one of the few guarantees we make it. I think there's some compromise to be had, but... > It would be helpful to work through some examples understand what people > need here and if it really has to be a refactor to pass things through > or if adding some new tags and config values could do the job. > ... I'll respond to this this weekend, hopefully. I'd like to condense what I'm aware of into some formal test cases in sys/tools that I can point to so that we have something less abstract to debate the merits of, and also so that we have something we can verify the functionality against. > The quickest workaround would probably to revert these commits locally > (I took care to isolate them for exactly this reason): > > 5212b9500116 sysent: GC sys/tools/makesyscalls.lua > 204d065dac81 sysent: switch to refactored makesyscalls.lua > > You might also need to revert this commit or implement it in > makesyscalls.lua: > > bbc0f33b1317 sysent: add a NOLIB modifer to prevent stub generation > > If we need be, I'd even be ok with temporarily restoring makesyscalls.lua > and back porting easy features, but maintaining two is certainly not > viable indefinitely. > This isn't urgent enough to warrant any of that- it's just something that I'd like to work out how we can solve (preferably in the short-to-mid term), because there good uses for at least a subset of what we supported before. I don't think we need to go as far as supporting arbitrary preprocessor, but if we could at least devise something for conditional syscall slots that'd probably be sufficient and workable. Thanks, Kyle Evans From nobody Fri Jan 17 04:19:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ62S3vYkz5kNqS; Fri, 17 Jan 2025 04:19:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ62S2yM6z3lJS; Fri, 17 Jan 2025 04:19:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737087584; h=from:from:reply-to:subject:subject: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+JmmmKYPQ4M2Fb2MNTkkP63XykRVKoRLP2pk2qji0Q=; b=hy5b/P9MjxtiOuPP0/Vb22mxSAHL5g3Rn388tD2gi3YsXS9+6xicTBEpRLF3LMOG56f6Ej 9Wg7tELeXiz/6DUlSYAg0Tx7iqM2ycNHHJXME2elRB8r1Flbfa5uf+iVCG+zpk1XrMzdrr meM4DNN76ecywxZEQ1iM9upmSg+SZcGl2iFexA9eNCHNE5eAnrClSw/wPQDyYmMnOXSEJa SPB1WmMb44gzpRHq+7Tbqs+nAqh5ZpW62OWv7M4aMeYSUIG2je1eqqAROdVd1kzdpKQ2+C k6aFI+I7AB3gryYbKTvZ3u0CNARkO3eXg7URb90uvF6p0hUczCbjzdCdOIdXEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737087584; h=from:from:reply-to:subject:subject: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+JmmmKYPQ4M2Fb2MNTkkP63XykRVKoRLP2pk2qji0Q=; b=pep0ZCSk0f150B0GSd6IfVfitzMQoaAhvnDIFF5D1ggQgYKii6RvlfGnLNDL2XgSswnsGS 4EvlKTnQCSMFqyxcGm9+YQrKxv9Qv/rprRbm02KPNDLVvgurYhRy45kLs1udL3fTY4dg/u g6Hi0Zm0A5WwcmSqM6APDUApdxyE+WoZqrEQFN72HJY9zmt+GWo/xkbArR9DPWaBW+cLut qXog85UstkN/mf9yJ2+qerMxq15okcw0GPrqLnG8PQn0d9ut/Wg4d7UekO5HuIB7herx1S vAi50QJLKjq9wa/7lHouLscFC21851KWpYi7U0qS8+IhdA5Vuzu7dd+nUQC5ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737087584; a=rsa-sha256; cv=none; b=NN/Lmd6NLVN1zDkDkl3lTrJCnvmndTRrKVC1rfxiooh/v26SPvLClnaXzNXXvm3VTlkzLW Z5v7oXvu8rXApDl+FsEFGelf8S8gcAwLeDX4K6oWO1QMGK1q/t+bWJ/P+wRCpSp50eRIK+ GUCcJSwmo9d1b9nc2xtVhMMqh0jMc06W62ylYKxq7LoMyhAEOhJiXXWtw41YbmRsOlvBif QXztGwpSvxmOrxFPGDO1E9yDkP+LIZwYa4kbjoKROmI6SN2xuEewPaCcRLZwrxRaX2807B 36zkBw75PpWTqUR1ji2PX5s/nW6CYogknu/qZFYERmFyD1n+lxgyR670QIS1pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ62S2CNXz12dL; Fri, 17 Jan 2025 04:19:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50H4JieY037809; Fri, 17 Jan 2025 04:19:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H4JisN037806; Fri, 17 Jan 2025 04:19:44 GMT (envelope-from git) Date: Fri, 17 Jan 2025 04:19:44 GMT Message-Id: <202501170419.50H4JisN037806@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: 13d81ef632ec - main - genl.1: Improve grammar List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d81ef632ec6ca5e6936ab77e8ac67a8c430033 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=13d81ef632ec6ca5e6936ab77e8ac67a8c430033 commit 13d81ef632ec6ca5e6936ab77e8ac67a8c430033 Author: Cy Schubert AuthorDate: 2025-01-17 04:18:24 +0000 Commit: Cy Schubert CommitDate: 2025-01-17 04:18:24 +0000 genl.1: Improve grammar Make the first sentence read more smoothly. MFC after: 3 days --- usr.bin/genl/genl.1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/genl/genl.1 b/usr.bin/genl/genl.1 index e11bfbc440ab..df9e5984f938 100644 --- a/usr.bin/genl/genl.1 +++ b/usr.bin/genl/genl.1 @@ -40,8 +40,7 @@ .Sh DESCRIPTION The .Nm -utility is design to provide access to the user to generic netlink -protocols. +utility provides user access to generic netlink protocols. .Pp The following commands are available: .Bl -tag -width indent From nobody Fri Jan 17 04:33:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZ6LQ5byLz5kPw6; Fri, 17 Jan 2025 04:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZ6LQ2tt1z3mcQ; Fri, 17 Jan 2025 04:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737088414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z6aZHG3YXet4qgtiEfBfuqTijjtEKCZRSnyyyOXbTrY=; b=n4Af6fRBffRx8Mx62CT66fg7TtfDy3hRUGQ2ImUJyq8b5jICVv8YBFGPb1hWnRcONgvGl+ P5UZpFH6G2S0tsBWmJos+iJDV4bf/WUmbRvgqkBuuQ1lcvbb0WDixpE+kjBIEqKicN4pjB 0TSJbsnmfUxemWAdTFJlLg2nOlAUoRP39xQ3TSV/U/M5iLLUBKP/fv0CeImpXLN9IvK0kf rj7ZfO5n19VoBxp966UTy7SmyF5o8NPI7K8yobZ5rUI/aWAGo4+S0j0wjQt39S05VZR9lJ Q8abdtbAClYFOeklG7pZYqFJBJ8FMJtzoafaREZn3Vy7T8M6rIPDkf7XggP/JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737088414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z6aZHG3YXet4qgtiEfBfuqTijjtEKCZRSnyyyOXbTrY=; b=T6cQtu6nkLY/Zd9OV4fj2CtIQGTHFL0KhfIKqz1e39fNnESNn54XjKqoeJfINGaPoYGV94 QuIYYy+HCcSZRhAc7y5zUCOHi/JcWo9ZTrELGpDJnl3HEJ3bJO9evj1xqPRVWpwF81LxpH xoxW0JsLYB2ZVe7Kna5j1VGx+ixL/vSak6jT5rkK5MU4cAq5oB6xJ7MKJM0IRmu/YMTNUb YTnRn8v+pXIBPHs0TScs/vkEepwLNqcUZA6DZq6x2QnWoKqjYnZNU+8/VdBk67MUyKtyUs YInfgJtzERBRH0l5JTn3V3oa7iGhw1Ncq8K76X93uBksQITwEhKLienxnicpSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737088414; a=rsa-sha256; cv=none; b=OBoNOUBvB+Do/nyTUeBdzYWhKSKGQGsnDwexhYd8r1w6vj2mhfuiWCpHZFORDAirmcICuB h8yjYA5hNEqCZPspJHT6RyYMBXEDXvaV7M+IgDW5x794EfXKp81iix72nE+rz9gm+F1fEf Gpr23Ab3UsGNrQwaP9ia5l1WUcuCOS74f3myZWGiPMYcXIwXvRlXe6MqNbqfpQ0nSFY/ZS lfGtAlLMZGjSoCCvGVJvOXst5WNvYeRGzHo1Dxep70xW267SukNKxOx4AjqxiIpj0gKyda uujGEtyig2zBws4qBdHVh3rHIfO1w/GW+6kr5KfMhP5v3EASisQQHws2Klsdqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZ6LQ2Gqcz12tT; Fri, 17 Jan 2025 04:33: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 50H4XY8x072737; Fri, 17 Jan 2025 04:33:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H4XYgN072734; Fri, 17 Jan 2025 04:33:34 GMT (envelope-from git) Date: Fri, 17 Jan 2025 04:33:34 GMT Message-Id: <202501170433.50H4XYgN072734@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: 38d947b53cbc - main - netisr: fix compilation without VIMAGE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38d947b53cbca845926bdd91272ce1c65ba59ecb Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=38d947b53cbca845926bdd91272ce1c65ba59ecb commit 38d947b53cbca845926bdd91272ce1c65ba59ecb Author: Gleb Smirnoff AuthorDate: 2025-01-17 04:29:40 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 04:32:53 +0000 netisr: fix compilation without VIMAGE - Don't use bare vnet(4) definitions in the KASSERT, they aren't available on a kernel without VIMAGE. Just through MPASS() here. This is more of documenting assertion rather than an assertion that may actually fire on an unmodified kernel. - V_netisr_enable is different to the rest of V_ prefixed globals. On a kernel without VIMAGE it basically doesn't exist, instead of being present as a single instance. Fixes: a1be7978f1879313c141882a1e0812b468dead57 --- sys/net/netisr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/net/netisr.c b/sys/net/netisr.c index e9b8fa4d833c..7b4368276c58 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -396,8 +396,7 @@ netisr_register(const struct netisr_handler *nhp) * Test that the requested registration is valid. */ CURVNET_ASSERT_SET(); - KASSERT(IS_DEFAULT_VNET(curvnet), ("%s: curvnet %p is not vnet0 %p", - __func__, curvnet, vnet0)); + MPASS(IS_DEFAULT_VNET(curvnet)); KASSERT(nhp->nh_name != NULL, ("%s: nh_name NULL for %u", __func__, proto)); KASSERT(nhp->nh_handler != NULL, @@ -457,8 +456,8 @@ netisr_register(const struct netisr_handler *nhp) npwp->nw_qlimit = netisr_proto[proto].np_qlimit; } - V_netisr_enable[proto] = 1; #ifdef VIMAGE + V_netisr_enable[proto] = 1; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { if (vnet_iter == curvnet) From nobody Fri Jan 17 07:28:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZBD608WYz5kbMt; Fri, 17 Jan 2025 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZBD56ZTNz41CQ; Fri, 17 Jan 2025 07:28:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D01kJesutVPDn7mxht/9KStaJkH93BuI6Netb6e8azo=; b=YPNIVepP3FQBewDKdKW+NUwX90/PtD9WRQt/V/WvZrcfwPPgH98J97ROpYzBjT6xFBFCgs hdj9EXFp2tiYw7rUxiKI3cLz26Oallv6nr3H+gP4WlP38DDcOjKs/apXxEfTGMRvxoV5ia ldIXjbRNrzhWCddruE49cTPfaOOin27GtkdSn45Ihfl6vtRo54BB46twP/qDMYmKr9iJ6P hI3VdIkBThWV+MkmyeQGMWQQP7xnNLywIZo1SLftyF8fPwu7I9P1cbPNyHXhIm64NwWkVx p3YYSIKcVGjTplHOVkTnt03RGCQ3RhlbyXLMzUkQC5Z3E9vTV+L4dSf/l5RA2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D01kJesutVPDn7mxht/9KStaJkH93BuI6Netb6e8azo=; b=eHNZ92MW76py4CtcmwKHezE7Rd2x0phX4L8Nv9VksOM6+JA1X+tV2RkrHKRwwFvH6yao4j eBXgL4MlVOjuJAFswcUnZF4VnC1O8zSXExCsILuIZpap+c+l1psH2gMVCp6rrixeDwj2tt m5PkfI2A/CMHbQ5sk6OspqooRPp1Mpv5VjbAsuDLakoWXCg3RifS5P74ZtCs2U1FlgI+XB rUyz5Isc38FDrrW1xL898sHaUTMisKRIiK+YxCQ1KwxKxuCxWnB/HiKUGLBVZ3GVY86QIE edIgt5uH/EguXjXK2b/yjtV3EF/P/MaH+kLLTALJipof/2kf3BiySIctiv1KIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737098901; a=rsa-sha256; cv=none; b=EROD2WY15grF/p6u/Ane7htFj58iAnb+X+x5vIiKh3JQlWg92G3bAAvVHIrS2Dz/p5RjUE AdNXkYZUSk5Uc9eRL+nKfPf7zibZYVjlCXyGje0vFhBPZJ/COy9eVaPSgOVEYlRg/UAdHC TwAWHwM1vG+0Mb8QNbGbcTN6vJV55+GlOxL/c4mwNJ/uZxGcxRlmyujmJ8XpUf9V+XpAvl r1lbtQ6T49718shyjdGh8pK8Xd5TUuXLDcH4IUG21sYN/IrvN5NJhsc9uRbRXJ9WFeSiLj hjBZLVUHAJnNklZI6RBM/P0wm+gFmRbR7vUJldokTI7f3GfIev2mImXoE/qDCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZBD55sMmz16Pt; Fri, 17 Jan 2025 07:28: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 50H7SLnf091896; Fri, 17 Jan 2025 07:28:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H7SLbU091893; Fri, 17 Jan 2025 07:28:21 GMT (envelope-from git) Date: Fri, 17 Jan 2025 07:28:21 GMT Message-Id: <202501170728.50H7SLbU091893@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: 9d04973b4adc - main - krpc/clnt_vc: remove always false check List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d04973b4adc1b6312043fc313e4bf2c85593904 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9d04973b4adc1b6312043fc313e4bf2c85593904 commit 9d04973b4adc1b6312043fc313e4bf2c85593904 Author: Gleb Smirnoff AuthorDate: 2025-01-17 03:52:34 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 07:27:21 +0000 krpc/clnt_vc: remove always false check We just initialized ct_closeit to false a few lines above. --- sys/rpc/clnt_vc.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 91556dddebaa..2f2674e694af 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -234,12 +234,8 @@ clnt_vc_create( */ xdrmem_create(&xdrs, ct->ct_mcallc, MCALL_MSG_SIZE, XDR_ENCODE); - if (! xdr_callhdr(&xdrs, &call_msg)) { - if (ct->ct_closeit) { - soclose(ct->ct_socket); - } + if (! xdr_callhdr(&xdrs, &call_msg)) goto err; - } ct->ct_mpos = XDR_GETPOS(&xdrs); XDR_DESTROY(&xdrs); ct->ct_waitchan = "rpcrecv"; @@ -252,12 +248,8 @@ clnt_vc_create( sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz); recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz); error = soreserve(ct->ct_socket, sendsz, recvsz); - if (error != 0) { - if (ct->ct_closeit) { - soclose(ct->ct_socket); - } + if (error != 0) goto err; - } cl->cl_refs = 1; cl->cl_ops = &clnt_vc_ops; cl->cl_private = ct; From nobody Fri Jan 17 07:28:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZBD71KZSz5kbN1; Fri, 17 Jan 2025 07:28:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZBD66xfwz419H; Fri, 17 Jan 2025 07:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbQKCRPsq9hFAMngOcSfUn4uhlhczcTw7AHO8AAijPU=; b=amh0L0L+v8wrxHPkGYP9aesrj1MUFWwkfePUiV8jI+bbSFoAHdLUhIwqYiIdlk9tRFyxKK phglP12+85Bopm/AZbLUXbiGHle2ji/ixf0ZvFjPrIMmc2Ky8CWe2GbHCCO0GCbqXqkWrs k44o4gZ6aA9cg9Xqc3dr7X46RklyYCh8XOEqO0NVIh+h+Wwzl9nQ9Rrb36naiV3ieC3V1j TjI6Fv2KE9oXSyx9GZeU8PFE6g9cZ1p8FsARbC6WLgJ7BQEILUjrfdmXBeFVyp6sXLiCiy N/i/IyLrfGnbkFLieGgQMM5lyLfFAh8+MiHZL9lnCDXO2/X3A1kiA2FKLOsGqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737098903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbQKCRPsq9hFAMngOcSfUn4uhlhczcTw7AHO8AAijPU=; b=qhtPUZuDt2lDKXl9Fj40ohIr4dLU5Pjpf0/JJLGeMLEO2ymLk3RBbEaNRwBXlcKUmJyrdI mh8q4pY11Y6JAaoKjETkmsHuCyAOUtPkjuFWRpJAwZ5uQ95nT4rDo/kAdOlOyH+kX8R3mR RAIO9E7haCZpfF/3yLZPbYb3VFq1RKNRXucGp7KWoZCCF1AMIT4ApTBxy9L4RjHmgkcmis xItbu42cLNZ3CdUSsTyvlqSoqHC52UHKJ32QXDfyWSI/aQdDA8w7oYPW2snz7WnY4flJtV 5x2570ZrFk5J4FSxvck5NulySmsPT8kKnRCMkMDR1nOIUFc8CEGIef6pK05oWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737098903; a=rsa-sha256; cv=none; b=e3yQJ7YALKaK5lS7DUc828uvadq1kJ3AX4M29iQCuUlkfGBqfUt0w9RRHqeLHONv25C5sT LRZ6JckrWrsreS5MtlWmh2u8XExgRCikDC8tIeL4s6sR35UcCSPm6m1A345v8G2pNYIyXt 9YhgMoiUf5IwxmZyOuxO1YqvnxUcfMxNkwp/nPRZCp8IHSI8/WuiW147TOm+g8xWQCeY7t pnVK6kfbzJndgOW9hq61rnb/m9vYY4AAzhc2kGz7I5WWUv20ZMMykMqEstLH+HFFHrtDN8 inADOhSxJ/+iun7pIhONmePsM+9Qxj4MR4Wv4W7sN2A1iiwqC+uSqlqx+f3IBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZBD66WWjz177M; Fri, 17 Jan 2025 07:28: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 50H7SMrs091952; Fri, 17 Jan 2025 07:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50H7SMLU091949; Fri, 17 Jan 2025 07:28:22 GMT (envelope-from git) Date: Fri, 17 Jan 2025 07:28:22 GMT Message-Id: <202501170728.50H7SMLU091949@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: d9f9a73a3363 - main - krpc/clnt_vc: in clnt_vc_destroy() use more lapidary logic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9f9a73a3363737aef4bae8ef6d71a2159005436 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d9f9a73a3363737aef4bae8ef6d71a2159005436 commit d9f9a73a3363737aef4bae8ef6d71a2159005436 Author: Gleb Smirnoff AuthorDate: 2025-01-17 03:59:30 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 07:27:21 +0000 krpc/clnt_vc: in clnt_vc_destroy() use more lapidary logic on whether to close the socket or leave it. --- sys/rpc/clnt_vc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 2f2674e694af..e201072b2ee7 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -849,7 +849,7 @@ static void clnt_vc_destroy(CLIENT *cl) { struct ct_data *ct = (struct ct_data *) cl->cl_private; - struct socket *so = NULL; + struct socket *so; SVCXPRT *xprt; uint32_t reterr; @@ -867,19 +867,14 @@ clnt_vc_destroy(CLIENT *cl) SVC_RELEASE(xprt); } - if (ct->ct_socket) { - if (ct->ct_closeit) { - so = ct->ct_socket; - } - } - /* Wait for the upcall kthread to terminate. */ while ((ct->ct_rcvstate & RPCRCVSTATE_UPCALLTHREAD) != 0) msleep(&ct->ct_sslrefno, &ct->ct_lock, 0, "clntvccl", hz); mtx_unlock(&ct->ct_lock); - mtx_destroy(&ct->ct_lock); + + so = ct->ct_closeit ? ct->ct_socket : NULL; if (so) { if (ct->ct_sslrefno != 0) { /* From nobody Fri Jan 17 07:38:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZBSG6JTbz5kbqV; Fri, 17 Jan 2025 07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZBSG5gw8z427M; Fri, 17 Jan 2025 07: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=1737099534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOFpTWgFjNuEpze7kdnodxyd3ypvU48wV9OyTnhpqP0=; b=Y0HF4kBAQktm6DN51edZmk+7vl87psygTgsPY3St+T8Ru/7g695TzTyrj9eaZCru393BUw e3lqCwanOFlTc0g3wn436lE5XjXSz6Ys8iOB8u4omjcQtGqxNK+AKBhUs/LROC4p39Ol+x nVuXwfc5YoIe8MpmtqoENIASMC+AiEHTNP0LisVEZVXosa4q/yXMfwIkeuE1/p7jaN4EoI 3kEbjnX5Vneuhib2T4vUMFFPdkrdVYfbPfaOiHbuEwjQrMOZY00fYJTznSOjQp5usje5ub E44cjjOQAo9Y8mNa1lrnVj8Hqvp0c2JoJqZnV7gX4HB3yN8NUhg8k4yQsaw7tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737099534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOFpTWgFjNuEpze7kdnodxyd3ypvU48wV9OyTnhpqP0=; b=t3CnQ+xw+wCOiRgvUVs6poMyiATIFhK/YLy3dZGQoyQDhl3iB1IX0mj0f910+krYB21has FupQ8+9S0JI53ee/ZlN2AjxTC+j2xb8hto9Zbb42BsWNhePhGcTldBfQIfSRC/HI8MSGLq lQ90kLt80HlnuwXjRIRDYzrmV0Sk1Yy04rbJ4PeItjo0hXQROMig+ErCxqKEofkbn/vn7C vHflmotInSufSNV1uiUrZc4nVbmar6KZxf2+ZRYnph9XwgcNV8I/Fdw6eOfmkcXBe0mE9X XPqX0N9DNC6XTKS9Mr6xCeFtv1bsSoPyIb9uPJtFNlIF5lTzr17t52OqWmxb4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737099534; a=rsa-sha256; cv=none; b=treBhNwASXm+uEdhF/N3PMISxXaRc8pkpZ0PVS/dBrcj1sOOh9Abb4hI/O7zcYRv8MbG/p Ku4D0Jy5TcGAoEiL9w4M6Eh3u+a07kQawib2N8+NO4uFyEEI4VaZFWZgS9kdHW1uBo4aun ctBBlGlTnsCHlIItjFHGrawW9c3T1zAM8jqRsFRvK4of5Sp5ijiS2VWJ4xcU97aUj3LDBC 0wi4P0AX110xGun6bW2ykhBEz+BQOKsHw3VG/6+j0+9iIug6loo3/ajwEtO3mQq3TZ7udo 0xKsI+UlgMXFIR/sOUBiNTcy6pI5TYQ/+UG99FTAaYKwXWeLfrAR+Td1MwT5Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZBSG4x1wz17s1; Fri, 17 Jan 2025 07: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 50H7cstv010722; Fri, 17 Jan 2025 07: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 50H7csAx010719; Fri, 17 Jan 2025 07:38:54 GMT (envelope-from git) Date: Fri, 17 Jan 2025 07:38:54 GMT Message-Id: <202501170738.50H7csAx010719@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: b2ff4cb1931c - main - krpc/clnt_vc: set vnet(9) context in clnt_vc kthread List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2ff4cb1931c2e1509a5741f6743322699ad1e00 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=b2ff4cb1931c2e1509a5741f6743322699ad1e00 commit b2ff4cb1931c2e1509a5741f6743322699ad1e00 Author: Gleb Smirnoff AuthorDate: 2025-01-17 07:38:43 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-17 07:38:43 +0000 krpc/clnt_vc: set vnet(9) context in clnt_vc kthread The per-client kthread to offload TLS stuff was added ab0c29af0512d. Let it run in the vnet(9) that matches associated socket. --- sys/rpc/clnt_vc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index e201072b2ee7..d26e6c294af6 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -1265,6 +1265,7 @@ clnt_vc_dotlsupcall(void *data) enum clnt_stat ret; uint32_t reterr; + CURVNET_SET(ct->ct_socket->so_vnet); mtx_lock(&ct->ct_lock); ct->ct_rcvstate |= RPCRCVSTATE_UPCALLTHREAD; while (!ct->ct_closed) { @@ -1300,4 +1301,5 @@ clnt_vc_dotlsupcall(void *data) mtx_unlock(&ct->ct_lock); CLNT_RELEASE(cl); kthread_exit(); + CURVNET_RESTORE(); } From nobody Fri Jan 17 12:06:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJNk29Mkz5ktR4; Fri, 17 Jan 2025 12:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJNk02yvz3QJB; Fri, 17 Jan 2025 12:06:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcADDBO99IGHnc7hRWu1xiJqPWX8A4rQqtbjppV5kp8=; b=U07xyG1Kx+mduBCrSF2Y/bnM9CCd0XuaQeiqskDkxHlbVmskM3DwxllCec3/0U31Q9m/1W EHlUNs8Y3bWdu9lBWqWaJkNYAnrBbSxIMitw+D5WU+83W4xaD3bC5L6+lcSXHbIdUGv0Qq dllKgKYkhd6I3VOAFAELeuFYAOGmTPgtxJFbe1hzorWkSy1pUrCTF/5+40QiHYk0XrfJCR sKwH+BqUzGxnyhM3pRPbMmvbOp5vlEreQrJ4moBm8w9nnvDUN0LYAiJfy9f54YjgffuQaz VatwVWK7Dav4oUdy9HiDbYn8cHBdeBSIIQ78e0xsrrjMkPHZXQOLuJ5LeKxIpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcADDBO99IGHnc7hRWu1xiJqPWX8A4rQqtbjppV5kp8=; b=ftE2T6gJ9PX976yzaUK1vxqynP4y5F+eseDVRFasMewUlA9T9AXrOA6wlaamNfdFmeYG9V 0gIPYMe8P5xLl111alP2Ib8XRzBLZxq7O145P2OLcs3ZWxOuTrbzoahPV9bfk2xbZO3e3t T9F0+9bA74i+XvP/u4xT3SZNxTIh7TzQMJMb69kDoS5F+TtmmZuOFzZ3YFZ8OCauO5wTmq b5F3anpN+AbnlKp/lnVeF+3hDLD/rqXMiz8tqGzLjAh/wreS+1Bb2tIyf86QCt6ocYdR0Q HzgscAzqHwEtHwzPEdz/PMaDUTYkulQwq2nEDjn6CnVPNJ+/SEGI59b8BM328A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737115574; a=rsa-sha256; cv=none; b=qYakDyyvIZCtEpQw4A9KOpEF4SAnkND+CVL14fs+68CB2Vt+iJwM4a5Z75pafEgxJR++4u bl0GQUwg1wvoJcoByM8MM8b9y2LcuDPZZ5X9IvJi88E5WlX4IJ3/VBs0ijyp3lG9GV0aU8 XU6m19tKRguv4upkzjPT6zrciFV31kQACsvqs+xhoUN4sRQNedNQT8RzTDb38YerjHlwGz WbVgfhM8RxXq+8utsCLW6uTNeAFdIlly6yvt2xf3dt+eViw6oAOgGNb1ik0ZEBfn66G0Ma j+ohCPivnxl+NpE9vyitYTKJFzTsjEK89fPtLPxdaui2r4xBMNXMacwu1r+QSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJNj6k4Fz1qj; Fri, 17 Jan 2025 12:06: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 50HC6DM9015310; Fri, 17 Jan 2025 12:06:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HC6DHg015307; Fri, 17 Jan 2025 12:06:13 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:06:13 GMT Message-Id: <202501171206.50HC6DHg015307@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: 541ea3d7828e - main - pf: verify that ABORT chunks are not mixed with DATA chunks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 541ea3d7828e0ede161ac2d8ef3e8419657ef5cb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=541ea3d7828e0ede161ac2d8ef3e8419657ef5cb commit 541ea3d7828e0ede161ac2d8ef3e8419657ef5cb Author: Kristof Provost AuthorDate: 2025-01-06 09:06:01 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 08:40:29 +0000 pf: verify that ABORT chunks are not mixed with DATA chunks RFC4960 3.3.7: DATA chunks MUST NOT be bundled with ABORT. MFC after: 2 weeks Sponsored by: Orange Business Services --- sys/netpfil/pf/pf_norm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 9f1eaf7c4d76..c9a7f7d2df04 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2138,6 +2138,14 @@ pf_scan_sctp(struct pf_pdesc *pd) if ((pd->sctp_flags & PFDESC_SCTP_SHUTDOWN_COMPLETE) && (pd->sctp_flags & ~PFDESC_SCTP_SHUTDOWN_COMPLETE)) return (PF_DROP); + if ((pd->sctp_flags & PFDESC_SCTP_ABORT) && + (pd->sctp_flags & PFDESC_SCTP_DATA)) { + /* + * RFC4960 3.3.7: DATA chunks MUST NOT be + * bundled with ABORT. + */ + return (PF_DROP); + } return (PF_PASS); } From nobody Fri Jan 17 12:06:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJNl2Vx7z5ktWH; Fri, 17 Jan 2025 12:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJNl1TnSz3Q4L; Fri, 17 Jan 2025 12:06:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEYsHSzoaoHnAH8Nm7p2nVrvfsQ2p+5i92+66LeIyW4=; b=piDyQm6Cp4h4LoL2dQf1v1z8+ustdymVuyOaORpI+PmfyCWA4vKOzvs+Ndc5BfR87VupYR 0OekhK1IkBrFCPAX53SYWD9D4Qi3zYc1S3oT/lnduUv/9wfveEcc/AqEgITi875D/gP3qM RR//AufTe5LzA4F6cxrowtLvJQ9uzUxgHh1tV38cy+LBCTMi6htMh4X7XIbupBa7dtSKON Hg1A+2H1ChXccheKyuQ+7PM6mS++yxA0GrlYVg+r0PLodffV25i9vJxvyxxsqfvXNimH7t 3OASAjP5487uRmopf2/RIxiX7ZhSxraXFv8bO66M1sqLzT5ZCc5qABrkkTlr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEYsHSzoaoHnAH8Nm7p2nVrvfsQ2p+5i92+66LeIyW4=; b=j4CJaG83tY9e5SEOIOLRLnx9MIU3hKk5YK/vLzlUaPNzP9RltHVXBw76mLb2qgj6x/SOZw JV5pQRAggjb6rR44mLtWdsahNgHFssRgBNlMtVYqPTCtQiQXe5us1t2DzTaxEvHM0UiY9s x2R+V2pRiwTNJbzKZmMCmrH2KqpjbE7Iroc7j9UqXD0c5sm5gyYTB9+541lFKF3G88zRpy jU4KN8wJFpcxhtYH5a0mPhAUHM0vFGYv/FfMRjPQnZ301FsBcPzGxEkExsnZAdqN8dUogE uM6V2qitpvxaYr/WlU5mev/C5rCX5XwiP3rLmpa49ZsmqlE0WzJOf/VQpbRrhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737115575; a=rsa-sha256; cv=none; b=Ie1b1osA7UFd31ioKWDgYGacW/jEoSRU03eYEXTaL30NyqoCfGm1SKjd2suSFCJVZ7s0Za xOO7Lc/OvW4CphT1t0IQYRCZteqKlKIZVhWr1PuKL6T1Bs7K2CaAQhxOw+slz6Rf3LqqZR GtHyXFYS80VWRGLjBnvpf5Y6h/2dhpHgPWBewf2+O4VIK5CImrZ7rlJ8mzABYFUhHW4jc9 LdIsgZDQRvQIjGvb3d4pcmNdah6Dq0hV2KqI1gONbinfdasHyACpUf0D4OlvY39TfJdsXU Hj5itz4jzwdT0L/mP/cV15jag9gAh0cSbEqOy/322HNwixf7IZguF2T1OAwH3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJNl0ykZz2jm; Fri, 17 Jan 2025 12:06: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 50HC6Fi6015363; Fri, 17 Jan 2025 12:06:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HC6FN0015360; Fri, 17 Jan 2025 12:06:15 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:06:15 GMT Message-Id: <202501171206.50HC6FN0015360@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: 4713d2fd5663 - main - pf: verify SCTP v_tag before updating connection state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4713d2fd5663eb64aa582dabced21d253c901a66 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4713d2fd5663eb64aa582dabced21d253c901a66 commit 4713d2fd5663eb64aa582dabced21d253c901a66 Author: Kristof Provost AuthorDate: 2025-01-06 09:06:58 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 08:40:32 +0000 pf: verify SCTP v_tag before updating connection state Make it harder to manipulate the firewall state by verifying the v tag before we update states. MFC after: 2 weeks Sponsored by: Orange Business Services --- sys/netpfil/pf/pf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index cfab6a828d5f..7b0ee24965b9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7149,6 +7149,9 @@ pf_test_state_sctp(struct pf_kstate **state, struct pf_pdesc *pd, return (PF_DROP); } + if (pf_sctp_track(*state, pd, reason) != PF_PASS) + return (PF_DROP); + /* Track state. */ if (pd->sctp_flags & PFDESC_SCTP_INIT) { if (src->state < SCTP_COOKIE_WAIT) { @@ -7180,9 +7183,6 @@ pf_test_state_sctp(struct pf_kstate **state, struct pf_pdesc *pd, (*state)->timeout = PFTM_SCTP_CLOSED; } - if (pf_sctp_track(*state, pd, reason) != PF_PASS) - return (PF_DROP); - (*state)->expire = pf_get_uptime(); /* translate source/destination address, if necessary */ From nobody Fri Jan 17 12:06:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJNn1452z5ksZS; Fri, 17 Jan 2025 12:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJNm3M7yz3QTG; Fri, 17 Jan 2025 12:06:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNyAKwwcQRVjoIWzoTQ0foTrVqPVY0YFK79bqD0/noM=; b=vjRFXpCbCUOYCZMHbc86dadhkZ0+Q6sBSfbM1udqKqGG+yMd/uuf26EAf6C/CQaWjAut0j ruXx53VMnErktk42PA6hRxYLAGQ++RGzs+6koutR67hsgQlo+7cHRtLV88+sTp/Sb/ru9P BZJu035RAFEMXocJR4XbYkV3U/8CmB8oLLgIPoCyV5KZd37dpuoBPuWkrKm4qX9RlLRn3L YV5LU3lTZG82+dqAOuyQMx4KR0RVK5wdodIvaQQe+6tEMUuGEugYBVuiYz+H3ytInB1TXz YP3CBtoQxDuvQvEGlJYq28lJMGT2BoaV/ny+f91vl+nZwV/bLd+TEgZKYXg89w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737115576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNyAKwwcQRVjoIWzoTQ0foTrVqPVY0YFK79bqD0/noM=; b=Z/RWfKwmGEI8vEhyAvy8QbvhXr1oKQZuzKp5iBk1QQnU/+WpfhxfnNFD1IZo6tdyxd23rO u205HqcYNcnCL/yOjPiO6TkDKEzcz1M0RVEt1LqmYl2byanawKwfaF6sEUzFBVhbwXAyFv +wDbxdBLTez1pLtQVshaB5A7GcXcxjSw/5Qc5V/0PKlVkSTu545iDFJA9q+mBppVjTvwCf R5T9E+0p1Vi0yTgoZQe9lzC2WHipVk3f73EOuvWUuFgflLsYACVs+uTtWW0JpjnHaTtyka WZ5FhbxXBBofLPNcU2Rq+T6Z+22iS/+DklIXFXvnvv56iG+rbTJGpRyQqRH9Ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737115576; a=rsa-sha256; cv=none; b=ZAOKG7jp0q4aFFwuiR1GXAdjAxVBdWbeoSZ/xPiayKdr5dNQ1zZNmjdfgWzuEF/zg5HMid ttx5yrK8QWUKaJibRprhhDeyj+SonB2M7Kzaq0Tt4mUZuPwri5alFeGRNm1+lAf4dy6k2C L/sriaeQw6pTSyLjbOGEvS3oOUwGS0ysxcggz0xzGa2rYciqLlH0QjWselPUsW4RExDT5f LyjqYSWNL4K2uKCzvxvhu8dHD/C8NRqLnUjsQ0JKqg6V8/zna3YhZEKNvJgEL7VpEXjace VP2WKTulwJZWHovukWcxnBPn25nValUEHs3Wd8+8ltPoBrbDvtlLsFURGQqrNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJNm1knBz2Vj; Fri, 17 Jan 2025 12:06: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 50HC6GdA015421; Fri, 17 Jan 2025 12:06:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HC6GoX015418; Fri, 17 Jan 2025 12:06:16 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:06:16 GMT Message-Id: <202501171206.50HC6GoX015418@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: e4f2733df8c9 - main - pf: add 'allow-related' to always allow SCTP multihome extra connections List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4f2733df8c9d2fd0c5e8fdc8bec002bf39811f3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f2733df8c9d2fd0c5e8fdc8bec002bf39811f3 commit e4f2733df8c9d2fd0c5e8fdc8bec002bf39811f3 Author: Kristof Provost AuthorDate: 2025-01-09 20:28:46 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 08:41:25 +0000 pf: add 'allow-related' to always allow SCTP multihome extra connections Allow users to choose to allow permitted SCTP connections to set up additional multihomed connections regardless of the ruleset. That is, allow an already established connection to set up flows that would otherwise be disallowed. In case of if-bound connections we initially set the extra associations to be floating, because we don't know what path they'll be taking when they're created. Once we see the first traffic we can bind them. MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D48453 --- sbin/pfctl/parse.y | 21 ++++++++++-- share/man/man5/pf.conf.5 | 6 +++- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 24 ++++++++++++++ sys/netpfil/pf/pf.h | 1 + tests/sys/netpfil/pf/sctp.py | 76 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 126 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index ff2e2d2c93b7..4a7bd3125372 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -173,7 +173,7 @@ enum { PF_STATE_OPT_MAX, PF_STATE_OPT_NOSYNC, PF_STATE_OPT_SRCTRACK, PF_STATE_OPT_MAX_SRC_CONN_RATE, PF_STATE_OPT_MAX_SRC_NODES, PF_STATE_OPT_OVERLOAD, PF_STATE_OPT_STATELOCK, PF_STATE_OPT_TIMEOUT, PF_STATE_OPT_SLOPPY, - PF_STATE_OPT_PFLOW }; + PF_STATE_OPT_PFLOW, PF_STATE_OPT_ALLOW_RELATED }; enum { PF_SRCTRACK_NONE, PF_SRCTRACK, PF_SRCTRACK_GLOBAL, PF_SRCTRACK_RULE }; @@ -526,7 +526,7 @@ int parseport(char *, struct range *r, int); %token DNPIPE DNQUEUE RIDENTIFIER %token LOAD RULESET_OPTIMIZATION PRIO %token STICKYADDRESS ENDPI MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE -%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW +%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY PFLOW ALLOW_RELATED %token TAGGED TAG IFBOUND FLOATING STATEPOLICY STATEDEFAULTS ROUTE SETTOS %token DIVERTTO DIVERTREPLY BRIDGE_TO RECEIVEDON NE LE GE AFTO %token STRING @@ -2648,6 +2648,14 @@ pfrule : action dir logquick interface route af proto fromto } r.rule_flag |= PFRULE_PFLOW; break; + case PF_STATE_OPT_ALLOW_RELATED: + if (r.rule_flag & PFRULE_ALLOW_RELATED) { + yyerror("state allow-related option: " + "multiple definitions"); + YYERROR; + } + r.rule_flag |= PFRULE_ALLOW_RELATED; + break; case PF_STATE_OPT_TIMEOUT: if (o->data.timeout.number == PFTM_ADAPTIVE_START || @@ -4490,6 +4498,14 @@ state_opt_item : MAXIMUM NUMBER { $$->next = NULL; $$->tail = $$; } + | ALLOW_RELATED { + $$ = calloc(1, sizeof(struct node_state_opt)); + if ($$ == NULL) + err(1, "state_opt_item: calloc"); + $$->type = PF_STATE_OPT_ALLOW_RELATED; + $$->next = NULL; + $$->tail = $$; + } | STRING NUMBER { int i; @@ -6432,6 +6448,7 @@ lookup(char *s) { "af-to", AFTO}, { "all", ALL}, { "allow-opts", ALLOWOPTS}, + { "allow-related", ALLOW_RELATED}, { "altq", ALTQ}, { "anchor", ANCHOR}, { "antispoof", ANTISPOOF}, diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 7e2c96c07473..a517015b5ff8 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 January 9, 2025 +.Dd January 10, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -2513,6 +2513,10 @@ Cannot be used with modulate or synproxy state. States created by this rule are exported on the .Xr pflow 4 interface. +.It Ar allow-related +Automatically allow connections related to this one, regardless of rules that +might otherwise affect them. +This currently only applies to SCTP multihomed connection. .El .Pp Multiple options can be specified, separated by commas: diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3f109d31ccde..6c9d75bb1365 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1660,6 +1660,7 @@ struct pf_pdesc { #define PFDESC_SCTP_ADD_IP 0x1000 u_int16_t sctp_flags; u_int32_t sctp_initiate_tag; + struct pf_krule *related_rule; struct pf_sctp_multihome_jobs sctp_multihome_jobs; }; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 7b0ee24965b9..07b7aa543dbd 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -464,6 +464,14 @@ BOUND_IFACE(struct pf_kstate *st, struct pf_pdesc *pd) if (st->rule->rt == PF_REPLYTO || (pd->af != pd->naf)) return (V_pfi_all); + /* + * If this state is created based on another state (e.g. SCTP + * multihome) always set it floating initially. We can't know for sure + * what interface the actual traffic for this state will come in on. + */ + if (pd->related_rule) + return (V_pfi_all); + /* Don't overrule the interface for states created on incoming packets. */ if (st->direction == PF_IN) return (k); @@ -5702,6 +5710,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, } while (r != NULL) { + if (pd->related_rule) { + *rm = pd->related_rule; + break; + } pf_counter_u64_add(&r->evaluations, 1); PF_TEST_ATTRIB(pfi_kkif_match(r->kif, pd->kif) == r->ifnot, r->skip[PF_SKIP_IFP]); @@ -7165,6 +7177,15 @@ pf_test_state_sctp(struct pf_kstate **state, struct pf_pdesc *pd, dst->scrub->pfss_v_tag = pd->sctp_initiate_tag; } + /* + * Bind to the correct interface if we're if-bound. For multihomed + * extra associations we don't know which interface that will be until + * here, so we've inserted the state on V_pf_all. Fix that now. + */ + if ((*state)->kif == V_pfi_all && + (*state)->rule->rule_flag & PFRULE_IFBOUND) + (*state)->kif = pd->kif; + if (pd->sctp_flags & (PFDESC_SCTP_COOKIE | PFDESC_SCTP_HEARTBEAT_ACK)) { if (src->state < SCTP_ESTABLISHED) { pf_set_protostate(*state, psrc, SCTP_ESTABLISHED); @@ -7378,6 +7399,9 @@ again: j->pd.sctp_flags |= PFDESC_SCTP_ADD_IP; PF_RULES_RLOCK(); sm = NULL; + if (s->rule->rule_flag & PFRULE_ALLOW_RELATED) { + j->pd.related_rule = s->rule; + } ret = pf_test_rule(&r, &sm, &j->pd, &ra, &rs, NULL); PF_RULES_RUNLOCK(); diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index 10431d9b77d9..5de85c1fe7ef 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -617,6 +617,7 @@ struct pf_rule { #define PFRULE_IFBOUND 0x00010000 /* if-bound */ #define PFRULE_STATESLOPPY 0x00020000 /* sloppy state tracking */ #define PFRULE_PFLOW 0x00040000 +#define PFRULE_ALLOW_RELATED 0x00080000 #define PFRULE_AFTO 0x00200000 /* af-to rule */ #ifdef _KERNEL diff --git a/tests/sys/netpfil/pf/sctp.py b/tests/sys/netpfil/pf/sctp.py index 38bb9f2dff74..230dbae0d327 100644 --- a/tests/sys/netpfil/pf/sctp.py +++ b/tests/sys/netpfil/pf/sctp.py @@ -426,6 +426,82 @@ class TestSCTP(VnetTestTemplate): assert re.search(r"all sctp 192.0.2.4:.*192.0.2.3:1234", states) assert re.search(r"all sctp 192.0.2.4:.*192.0.2.2:1234", states) + @pytest.mark.require_user("root") + def test_disallow_related(self): + srv_vnet = self.vnet_map["vnet2"] + + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.pf_rules([ + "block proto sctp", + "pass inet proto sctp to 192.0.2.3", + "pass on lo"]) + + # Sanity check, we can communicate with the primary address. + client = SCTPClient("192.0.2.3", 1234) + client.send(b"hello", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "hello" + + # This shouldn't work + success=False + try: + client.newpeer("192.0.2.2") + client.send(b"world", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "world" + success=True + except: + success=False + assert not success + + # Check that we have a state for 192.0.2.3, but not 192.0.2.2 to 192.0.2.1 + states = ToolsHelper.get_output("/sbin/pfctl -ss") + assert re.search(r"all sctp 192.0.2.1:.*192.0.2.3:1234", states) + assert not re.search(r"all sctp 192.0.2.1:.*192.0.2.2:1234", states) + + @pytest.mark.require_user("root") + def test_allow_related(self): + srv_vnet = self.vnet_map["vnet2"] + + ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.pf_rules([ + "set state-policy if-bound", + "block proto sctp", + "pass inet proto sctp to 192.0.2.3 keep state (allow-related)", + "pass on lo"]) + + # Sanity check, we can communicate with the primary address. + client = SCTPClient("192.0.2.3", 1234) + client.send(b"hello", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "hello" + + success=False + try: + client.newpeer("192.0.2.2") + client.send(b"world", 0) + rcvd = self.wait_object(srv_vnet.pipe) + print(rcvd) + assert rcvd['ppid'] == 0 + assert rcvd['data'] == "world" + success=True + finally: + # Debug output + ToolsHelper.print_output("/sbin/pfctl -ss") + ToolsHelper.print_output("/sbin/pfctl -sr -vv") + assert success + + # Check that we have a state for 192.0.2.3 and 192.0.2.2 to 192.0.2.1 + states = ToolsHelper.get_output("/sbin/pfctl -ss") + assert re.search(r"epair.*sctp 192.0.2.1:.*192.0.2.3:1234", states) + assert re.search(r"epair.*sctp 192.0.2.1:.*192.0.2.2:1234", states) + class TestSCTPv6(VnetTestTemplate): REQUIRED_MODULES = ["sctp", "pf"] TOPOLOGY = { From nobody Fri Jan 17 12:26:52 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrX3Qmdz5kvFc; Fri, 17 Jan 2025 12:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrX2k6bz3TJ5; Fri, 17 Jan 2025 12:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVTZsqF/itWNyYr1y+CjRfYcAgVKRe5GzZkoSYn0FD4=; b=ZlSGYjmYTUzAtASaS1nCUyIBbqfDh7N1EBjSJgs2zdgH+ix4vcy2/JE0fN5d7f57naQUW1 3GFxaehLd4OyA4RN0ln7shFZnjdVQVoPjnA1X4AcIlumotWWGCyL/c72xHWQZxUj2B+ZdN AnidQArH2Kurli2JubFesKp4VPXkwHJAutUBW8TEsSTDGxJ/044u4BvFYcW3BBdJY49gvJ MZYEC6bHf6JWhqZFuQD3moM8uhM2wBrdOjzjH+fi2Ikw9P5qE8DbYC+D6wPOSNapR/bGaX v1lCdsG8bVnNGhq+YfwlV/WWe+ecHgMq5Exq4OdDFU+l1a7tbiIhIO1zRHz6kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eVTZsqF/itWNyYr1y+CjRfYcAgVKRe5GzZkoSYn0FD4=; b=Lz+QkelMTV+sXbvTNdf0I96SPl1/5pan6zmwmEVRj4D4P6h7pBxl+qhrRODl+Eujm9qGhA oPCOrIluMLJP3qxd2KYkFV+YZ9pV58qT/SC6onrrG6VchGc8bX7zSEkP2PkHNOL4rtDPJn vCa7u05Qsv8W60YKzZE33Xdls7GNhlQ+zZUuCnnVpffsHPMg5kSpqZ/8pHJR8orK2s4a6z y8+fvjhkS7/IdqF68rMAVeEbdeWVhCsh4SSxU/2VSfOWubEI4K6oX4uNxtQUCuj0cH8aO1 ZN3U3DbzXxeAAb+2jTyz/WwTJKZ+nbR721LXFQOEwTB72+bn1L3bX0DD8g0inQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116812; a=rsa-sha256; cv=none; b=rcLDMbJgtAsPQS8pyGX2ceF6/4i2I+B+h7iSS8BOO5Cc4vw4S7U/CM28SLIhyRCHwBI752 aWI5oIcEPDBsM28q8d5Aw84NWyLbBaXBHR0Fvt3m40Zppp+atT2DSr9MOJo+spPqwlpvOl OReVkjt49qyohahootR71e0wtRUiCfVwO0pIxAsdmTaO/VwGjjeQBXB8rHr03JgTqdF44n vqeOIdrbwTw0PmfKZDiPiGYX5LT4ydhnTNtVhfz/4KgLBeZPIJOjbrfqZHAgiQsO6Yw1TT n6UFYCmVhMhnUNQkqqxf/yOoix36heq51hfm6ZiAHINdZv4NJSfUC7uF3WjimA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrX21f6z2p3; Fri, 17 Jan 2025 12:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQqni051470; Fri, 17 Jan 2025 12:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQq9C051467; Fri, 17 Jan 2025 12:26:52 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:52 GMT Message-Id: <202501171226.50HCQq9C051467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4078a7051ab1 - stable/13 - Open-code proc_set_cred_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4078a7051ab146d146e88720fac85ca164af2d4a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4078a7051ab146d146e88720fac85ca164af2d4a commit 4078a7051ab146d146e88720fac85ca164af2d4a Author: Olivier Certner AuthorDate: 2023-09-25 08:48:49 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:43 +0000 Open-code proc_set_cred_init() This function is to be called only when initializing a new process (so, 'proc0' and at fork), and not in any other circumstances. Setting the process' 'p_ucred' field to the result of crcowget() on the original credentials is the only thing it does, hiding the fact that the process' 'p_ucred' field is crushed by the call. Moreover, most of the code it executes is already encapsulated in crcowget(). To prevent misuse and improve code readability, just remove this function and replace it with a direct assignment to 'p_ucred'. Reviewed by: markj (earlier version), kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42255 (cherry picked from commit 92541c12bc25c59333d7f3b0721b6b16aaff3644) --- sys/kern/init_main.c | 2 +- sys/kern/kern_fork.c | 2 +- sys/kern/kern_prot.c | 11 ----------- sys/sys/ucred.h | 1 - 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 66db882ba4f3..f827000d9200 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -558,7 +558,7 @@ proc0_init(void *dummy __unused) curthread->td_ucred = NULL; newcred->cr_prison = &prison0; newcred->cr_users++; /* avoid assertion failure */ - proc_set_cred_init(p, newcred); + p->p_ucred = crcowget(newcred); newcred->cr_users--; crfree(newcred); #ifdef AUDIT diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 114eeeb2a943..413453f9bf8f 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1049,7 +1049,7 @@ fork1(struct thread *td, struct fork_req *fr) * XXX: This is ugly; when we copy resource usage, we need to bump * per-cred resource counters. */ - proc_set_cred_init(newproc, td->td_ucred); + newproc->p_ucred = crcowget(td->td_ucred); /* * Initialize resource accounting for the child process. diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 482472025fdd..2dc5ecd00175 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2275,17 +2275,6 @@ cru2xt(struct thread *td, struct xucred *xcr) xcr->cr_pid = td->td_proc->p_pid; } -/* - * Set initial process credentials. - * Callers are responsible for providing the reference for provided credentials. - */ -void -proc_set_cred_init(struct proc *p, struct ucred *newcred) -{ - - p->p_ucred = crcowget(newcred); -} - /* * Change process credentials. * Callers are responsible for providing the reference for passed credentials diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 876919f56fb1..f5e2757f7417 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -158,7 +158,6 @@ void crcopy(struct ucred *dest, struct ucred *src); struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); -void proc_set_cred_init(struct proc *p, struct ucred *cr); void proc_set_cred(struct proc *p, struct ucred *cr); void proc_unset_cred(struct proc *p); void crfree(struct ucred *cr); From nobody Fri Jan 17 12:26:53 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrY4qQmz5kvFg; Fri, 17 Jan 2025 12:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrY3HHjz3TNW; Fri, 17 Jan 2025 12:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHJLGw/M+pMpGOmZcdBAKDud+2CX59ivhIeZon7b1Qo=; b=k5iVlmhjKQO/7t89ul8L4uUfnPlL6uUa5opIeNxbyjQ2fY90BRpF31Hylgd0gIsVZqg23Z TMQtKYw10eseeUh4xGQI+RR2G236sKRDHOTQkqzdTWTXgf9FK3fMnAyZTODimi1tOpFEjY cfFRB9ekWl03wrk5qwp7bTE47QrAlTtpU4fftQ27TBNVfDhq74HmVVBvqBhEXyajc/dmPU r20WOfSNDdGzTzCBjzPwvPUqCTVIvUct8p39SWk5VUyBbhws7KqisiErqWl85DA65DTfL0 tHKm4fyyUx1AQZe3CStxtq7lg9Sswz7AIYBHE5mtpB2acP9/lpZppf0TgdS+Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CHJLGw/M+pMpGOmZcdBAKDud+2CX59ivhIeZon7b1Qo=; b=H9h9iO/dXXCYlkGBdtnc7XIdQZjvL9HeQLWIwaWx+Qasr0Nl7SHLDazn9dOHttKzVcn6zA 1Tqn4A+++/aGT5sRR33d/A3tx9qR0oDP6cH7bkxfdhqHUr5cfS2kNubhNvciUWanwnF9xw gELI6QejFBocz0WmCXMEh/Rk1GvmaRZ0NRRDS5tRlr1iHsKeWZlOwFLoGc0HBhlJhmgyGa 4lkRef9wDOr90M5zxUvAmkk5cwy8HSpuGEt+HdRxyAWEDB8ahEjFH8OQRrglBB8FXtR3ev QC1nbcatvIAblamMFYjrTj7N+q71iCG2GLMkQ6QctOvrAgK+2oFjpjImTWyleQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116813; a=rsa-sha256; cv=none; b=Ps5FT5FXFLqLnFNWU7OF0tzJNQaNnzOWYGlk1QUs9Q3wgLprB9VcaH5OKjkhOHk27hpd63 +dhdrb8qk8QEwJcFqR2YyIvHEwj5OMwoXp7yefOwBNkjfzqoyjD9cqaZ8eH1cJO5DVHNlp 4f4SDODjOfL8fIU9ysp0UG8dp42EypiBw7pAaMbybAR/PeY8UTrZ84qUNgahDcP8Gv9u85 vNqpBY/COIND8KbuST9KAXCbZrKV6FTpKN5Ju0uPWx8VfHwZOETervgeG2IXDtMGmBagWN DEWmisKn4MJEkjP09mt4MlKHoIXd52n8fXkEaSYrqBKWjKT2JenKGbTGtgQ//g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrY2dbyz2Wj; Fri, 17 Jan 2025 12:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQrLH051590; Fri, 17 Jan 2025 12:26:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQrLG051587; Fri, 17 Jan 2025 12:26:53 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:53 GMT Message-Id: <202501171226.50HCQrLG051587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2d03e9cf8e2e - stable/13 - Add function to OSD to get values without taking the lock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2d03e9cf8e2ee39da7dc01471e09f9895ccd304e Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2d03e9cf8e2ee39da7dc01471e09f9895ccd304e commit 2d03e9cf8e2ee39da7dc01471e09f9895ccd304e Author: Stephen J. Kiernan AuthorDate: 2024-04-04 00:12:57 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:47 +0000 Add function to OSD to get values without taking the lock. There are some cases of OSD use where the value is only initialized once at a point where successive access of the value can be done so safely without the need to take the lock. Reviewed by: markj Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D44631 (cherry picked from commit 56b274213024957cea378d27393304ae5cc8ded9) --- sys/kern/kern_osd.c | 23 ++++++++++++++++------- sys/sys/osd.h | 5 +++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 1b623d822cee..df5f771ac04e 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -293,25 +293,34 @@ osd_free_reserved(void **rsv) } void * -osd_get(u_int type, struct osd *osd, u_int slot) +osd_get_unlocked(u_int type, struct osd *osd, u_int slot) { - struct rm_priotracker tracker; void *value; - KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); - KASSERT(slot > 0, ("Invalid slot.")); - - rm_rlock(&osdm[type].osd_object_lock, &tracker); KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); if (slot > osd->osd_nslots) { value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); } else { - value = osd->osd_slots[slot - 1]; + value = atomic_load_ptr(&osd->osd_slots[slot - 1]); OSD_DEBUG("Returning slot value (type=%u, slot=%u, value=%p).", type, slot, value); } + return (value); +} + +void * +osd_get(u_int type, struct osd *osd, u_int slot) +{ + struct rm_priotracker tracker; + void *value; + + KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); + KASSERT(slot > 0, ("Invalid slot.")); + + rm_rlock(&osdm[type].osd_object_lock, &tracker); + value = osd_get_unlocked(type, osd, slot); rm_runlock(&osdm[type].osd_object_lock, &tracker); return (value); } diff --git a/sys/sys/osd.h b/sys/sys/osd.h index 1c58c4fff8de..498cad5064f9 100644 --- a/sys/sys/osd.h +++ b/sys/sys/osd.h @@ -64,6 +64,7 @@ int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value); void osd_free_reserved(void **rsv); void *osd_get(u_int type, struct osd *osd, u_int slot); +void *osd_get_unlocked(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); int osd_call(u_int type, u_int method, void *obj, void *data); @@ -79,6 +80,8 @@ void osd_exit(u_int type, struct osd *osd); osd_set_reserved(OSD_THREAD, &(td)->td_osd, (slot), (rsv), (value)) #define osd_thread_get(td, slot) \ osd_get(OSD_THREAD, &(td)->td_osd, (slot)) +#define osd_thread_get_unlocked(td, slot) \ + osd_get_unlocked(OSD_THREAD, &(td)->td_osd, (slot)) #define osd_thread_del(td, slot) do { \ KASSERT((td) == curthread, ("Not curthread.")); \ osd_del(OSD_THREAD, &(td)->td_osd, (slot)); \ @@ -98,6 +101,8 @@ void osd_exit(u_int type, struct osd *osd); osd_set_reserved(OSD_JAIL, &(pr)->pr_osd, (slot), (rsv), (value)) #define osd_jail_get(pr, slot) \ osd_get(OSD_JAIL, &(pr)->pr_osd, (slot)) +#define osd_jail_get_unlocked(pr, slot) \ + osd_get_unlocked(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_del(pr, slot) \ osd_del(OSD_JAIL, &(pr)->pr_osd, (slot)) #define osd_jail_call(pr, method, data) \ From nobody Fri Jan 17 12:26:54 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrb0dWnz5kvHd; Fri, 17 Jan 2025 12:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrZ3ggyz3TFr; Fri, 17 Jan 2025 12:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrJzSouAnyHt6iIhKeqjXZv01Zy1F6r9MKeCIXQkv6Q=; b=ID8MxSLrIMUqhW8ZuepR0QWZLljDi7dEs8PsXphiWzUtwpgJOKDLZzqjZb9tsBKkzFmwSP ut/UziK/30nfuKq5EL60vouGg0hue4UhSBmdiBMjEzw2ceHYhGJFAcX3+DcZLa0vGh3uYO yGcA7uBLgb5PRuU7TqFkj9zmxZUhIusTzNyRyz76OybvFl/kde3IpOzDtUvK9TR6BEAy/k uxwxRKalyyQKC6ZLd+kkRZ46/ZKKLK6CX7hi0bg8GuiFJGt++gYmWE8G4dCdZ0cDAp5iE8 dWSTzwAxSFseAtq1Rys3UIvtYf/nTOBTxsOlHn4DDawX0QCBO8ON6v0tZsYKYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vrJzSouAnyHt6iIhKeqjXZv01Zy1F6r9MKeCIXQkv6Q=; b=V/ENgWnc6VZkQu9zGaoQugmogfgKCvmjc0Ikbjdj17tB5x8GCHFsKZhCMGo280rBvzGE6l pDeIfjq76vcySlVxz7at+B0d7D35UOpReCIrJONAZeqZ1ZkfDfMgRjZwKqrOg1+2pNyGO+ AHDHOucdYh50HUrbi1Y5lVdLfUM00VA8U6p7/gkzLdi5V8dgA8nuh3+OsX5BZxVsj6uyEF ldXpzbjEGe+9+XDWgnQ3UrvOfjmqGkWtaWzXB/WRaYkeKWkBqmG7B3Tw+si5rJa4oP2Whf /h+5tib7pb59ZGIxFpfrO7rF0YmWHtS90hWOGifZlscZHyOgg17iZh1XuG50wQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116814; a=rsa-sha256; cv=none; b=Rp8a0AFv83fOPdma6obWEbkd84ZtEMnezwwN9gORBAC0K0Md/mZMnS2QSUWwHnoirqzfqj bstTyt1N0DXzCLnmAEJIuLBWbYJ54NNpw6lQXfiUkVIU/OS3BUbYOvnq3apfBWPPt6piOa PAaumbOEUbQwuj1lrzYm+baGzmsEotidqqQqBQD3XkjO2nN19ptDmSUi/ElODnSg0ZqSpZ XYEpMH+jZtH8Y1RVfjncFrPy11Cqwb/6Zcdq6giRt+4gRbTNtEinVMlrm9Ib1Mk8T2Hc9f jRmE+wVUvQclDwl2az+zcZUUNRChwcaxmQ44kbp25pXNRVuWYpM1OshaUzkWHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrZ3HhKz3BW; Fri, 17 Jan 2025 12:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQsT7051635; Fri, 17 Jan 2025 12:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQsKN051632; Fri, 17 Jan 2025 12:26:54 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:54 GMT Message-Id: <202501171226.50HCQsKN051632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1c22ba23b015 - stable/13 - riscv: Implement atomic operations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1c22ba23b015024fc473d5fd8ab45d29dd72a580 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1c22ba23b015024fc473d5fd8ab45d29dd72a580 commit 1c22ba23b015024fc473d5fd8ab45d29dd72a580 Author: Ruslan Bukin AuthorDate: 2024-05-22 15:07:27 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:48 +0000 riscv: Implement atomic operations Implement atomic_load_acq_16, atomic_store_rel_16. These are needed by bhyve(8) PCIe bus emulation code. Group 16-bit atomic functions similarly to 32 and 64-bit. Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D45228 (cherry picked from commit 2183004e14a863d65ca9192df1bea2625e3fdfb3) --- sys/riscv/include/atomic.h | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index ef9aa5ef057d..03c1327d74da 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2024 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -105,8 +105,6 @@ atomic_fcmpset_rel_##WIDTH(__volatile uint##WIDTH##_t *p, \ ATOMIC_CMPSET_ACQ_REL(8); ATOMIC_FCMPSET_ACQ_REL(8); -ATOMIC_CMPSET_ACQ_REL(16); -ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_cmpset_char atomic_cmpset_8 #define atomic_cmpset_acq_char atomic_cmpset_acq_8 @@ -116,11 +114,40 @@ ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_fcmpset_rel_char atomic_fcmpset_rel_8 #define atomic_cmpset_short atomic_cmpset_16 -#define atomic_cmpset_acq_short atomic_cmpset_acq_16 -#define atomic_cmpset_rel_short atomic_cmpset_rel_16 #define atomic_fcmpset_short atomic_fcmpset_16 + +ATOMIC_CMPSET_ACQ_REL(16); +ATOMIC_FCMPSET_ACQ_REL(16); + +#define atomic_load_acq_16 atomic_load_acq_16 +static __inline uint16_t +atomic_load_acq_16(volatile uint16_t *p) +{ + uint16_t ret; + + ret = *p; + + fence(); + + return (ret); +} + +static __inline void +atomic_store_rel_16(volatile uint16_t *p, uint16_t val) +{ + + fence(); + + *p = val; +} + +#define atomic_cmpset_acq_short atomic_cmpset_acq_16 #define atomic_fcmpset_acq_short atomic_fcmpset_acq_16 +#define atomic_load_acq_short atomic_load_acq_16 + +#define atomic_cmpset_rel_short atomic_cmpset_rel_16 #define atomic_fcmpset_rel_short atomic_fcmpset_rel_16 +#define atomic_store_rel_short atomic_store_rel_16 static __inline void atomic_add_32(volatile uint32_t *p, uint32_t val) From nobody Fri Jan 17 12:26:55 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrc41KKz5kvFj; Fri, 17 Jan 2025 12:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrb60tYz3TLY; Fri, 17 Jan 2025 12:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0iCT3frMAmEbZ5qY08KCoUOBW4E40spQRsWXvITiYs=; b=pBeFvdBRJS52jVFntbP1Hy4GtGc4lWbOBuK6xl2/BvsGaRAykMkBSeG9cnhWNjlmpY068X lGw1TKRXTeRZ+/H9PeW2cRhGrflmxBJrujzx+0l3hBw0VLxLmCMFPXpeuG6vzKnB7l8dmS pQuZRITz5FsoWpMpJXZ6d7scwwrXE9uVArEUrPxX9iTgzV9VDpvofP/pDgHpEdJU0Kvnqj TOdjXGNyuyIWaN3XHtgY883VBjUM3UU4s18POicpsmhkDJQNRXVuXzXMGHZ7Cf2W9C51a/ qgctt6HEQcwjazuO8oHK1rh3E+vuDLHDAGVsDTubA6+QFKeCkIluhNR0uok39w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0iCT3frMAmEbZ5qY08KCoUOBW4E40spQRsWXvITiYs=; b=w7KPkgFluj42X+xx5Hju4tz5NdopD3ZEHS4A82Puj1AAnOYzQ7O+4qKZp5SxRVDkb5iNLA appmIe+1CXTbeoRmn6DoOPCWvBnVlL/QAoMAOfceShUNyzBss6grbcANz5F2nuLF27A7SE bQzzZQyj8ZF1bnThgFbSADjCbapanTyq0TvXArWZuWTU7Hr4CawQzE4wOeulH7DdkxUvmC /pSb0B3Hd9wVm4FGevD/Bsp3itWDnpDQGHcqPpuKNAEmCOFm+hVDovcnnImW90f1x3F2eT bwAKARHXQyVK644P7mDOD1M6onx7zTUP3TyvzVcV7PTix5n4dTN/8md7MjnkMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116815; a=rsa-sha256; cv=none; b=drcaNYMQGRUKGWP7U3C4Gm29DLuamc6o7ff7rGnxYxCECLL/mZzLMda+hFBEeAThkyrZIh S/XfST42jWkK4+d1O+ElI6dPd0v/M2kPC6mm07mYZefVXYMiM1sEONSsVvEFrSKkP8Oxvi rJJsOvPToJ9AGJA3irV6v0D5Ygx8cJB6W8e3hzrar+nPPjBa4HvoJXYDhPvKaLKu40wO9F XKwzjVAuutuHVIEW7dS1slPu4xqow5TpwGnamIaL+RIbsJj73dt9fhVl8X58QOHxwW8uf5 FXGLrbusSx+QQivbslURzvvxG7Y0/nTJxV7irDw1Srxxe/xJBeFVwul2drQNrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrb4KdJz2Wk; Fri, 17 Jan 2025 12:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQtOv051678; Fri, 17 Jan 2025 12:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQtFU051675; Fri, 17 Jan 2025 12:26:55 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:55 GMT Message-Id: <202501171226.50HCQtFU051675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 08eab7b3eb49 - stable/13 - osd: Constify signature of osd_register() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08eab7b3eb49034add710863760acc8406649eed Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=08eab7b3eb49034add710863760acc8406649eed commit 08eab7b3eb49034add710863760acc8406649eed Author: Olivier Certner AuthorDate: 2024-07-01 17:10:47 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:48 +0000 osd: Constify signature of osd_register() This makes it clear that 'methods' (if not NULL) points to an array that won't be modified. Internally, this array is indeed copied into the given OSD type's larger array of all methods for all slots. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46886 (cherry picked from commit 4a26b63145a5e18610aa9050262e3b4f75aa7117) --- share/man/man9/osd.9 | 4 ++-- sys/kern/kern_osd.c | 2 +- sys/sys/osd.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man9/osd.9 b/share/man/man9/osd.9 index 82f279ef17f4..22fa2d681e3b 100644 --- a/share/man/man9/osd.9 +++ b/share/man/man9/osd.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 26, 2016 +.Dd October 07, 2024 .Dt OSD 9 .Os .Sh NAME @@ -49,7 +49,7 @@ .Fo osd_register .Fa "u_int type" .Fa "osd_destructor_t destructor" -.Fa "osd_method_t *methods" +.Fa "const osd_method_t *methods" .Fc .Ft void .Fo osd_deregister diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index df5f771ac04e..553d809259d1 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -91,7 +91,7 @@ osd_default_destructor(void *value __unused) } int -osd_register(u_int type, osd_destructor_t destructor, osd_method_t *methods) +osd_register(u_int type, osd_destructor_t destructor, const osd_method_t *methods) { void *newptr; u_int i, m; diff --git a/sys/sys/osd.h b/sys/sys/osd.h index 498cad5064f9..5d59ce5a3d9a 100644 --- a/sys/sys/osd.h +++ b/sys/sys/osd.h @@ -55,7 +55,7 @@ typedef void (*osd_destructor_t)(void *value); typedef int (*osd_method_t)(void *obj, void *data); int osd_register(u_int type, osd_destructor_t destructor, - osd_method_t *methods); + const osd_method_t *methods); void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); From nobody Fri Jan 17 12:26:57 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrf2Y7Sz5kvXW; Fri, 17 Jan 2025 12:26:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrd6ncqz3TNs; Fri, 17 Jan 2025 12:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvasjVzld3Ioj3Yvi4+R9CPUDaxDTab1shwAJ9Pp7X0=; b=Jsw2aNlApo5aS6nMDa0j1AIDP3mBkYIUhQOjO7AZ1cM2CHyKRr0oDi3O6KcRCu10td+niF kr3n38+7GtfGwMB8DerpeK/Ef47WJiAM/MO5Tm9Lx99/XMQs8rVahLB+Ync63iRdllrv5l 4uyTMY1vuYe1UMKVOPJrfI/td/rMnuXZD0IXZTPQ69+fhjxCnGa53jXiVwtGfeqgOPHHMu B5KbJ9QRtNp6WJ/g2jUDhr+J268ejl8l+GOeJ1p1tJp7FrqD3HNk6Onu8ZRcGi+aeEbaaP 6/UYQonG4qaBj4w1X+CpOLFfJGK6k6njMnuvvE4I+8j76Ssc8dk117CTZMRsVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvasjVzld3Ioj3Yvi4+R9CPUDaxDTab1shwAJ9Pp7X0=; b=UvwE9hthDMTgPDw3rrrosGfOFIkI3Y/R4TgrpgCCyRyRDZDV0hxTDy8ghEyOTkT4szKyla qVH40hnWFKmmEL0+RS3OIMTEcWUxR+4rnCB+hjbE8RvmU/dcbrnc+zutq0z6MrnI99hC66 RjPY+XFzxC2P5HagulVDoCKYKYrwquKWsjZDVzXBFUa0hZchivOz0t4dmQztn6NMqZbVrr 6CVKMv6MqItEn7pCZaJoOOajgIaO97MSsnf0fnzVs5YEl8zsAsrB59RouMsucp69Z9FhV0 9aL5gDBuF/YmVH4T4Pzt7g2HwWA66kz/07q7iK9/iPZnhOWfGTGz60+1qkz2Fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116818; a=rsa-sha256; cv=none; b=JYYpVt0MKEItJLvQqU7VMrjRi2FmgOKVB0jMGFVKv80eJCPDiWF8WzTwX4IouNhIhkv8yv Pz28NeoNuNJ6S7VzB2hYj9xaI1ERgc2eTTsqmZ5YwnZjAOTk7jntyeS6W4bvl1gJF3wQWR L4ZVWYYTAJbh78LEztyRnmvsT3xJMkUajQFk0x5ugfRSEg6TyorGCx9o2CWnMxkKsYz7Pe GqBV3sgCGi193GpNyGYpvRbm1SW5fVOZzMnSkI1uE4OBWVMWeTOCj8/A7gE7xe48LPL0MW pbqNfk5oRyDj7k40VKagjMEbFj2GkgiiY78ZIrPByajb6d31+NmxOQnij6Aa8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrd6JKVz38D; Fri, 17 Jan 2025 12:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQvOW051791; Fri, 17 Jan 2025 12:26:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQvti051788; Fri, 17 Jan 2025 12:26:57 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:57 GMT Message-Id: <202501171226.50HCQvti051788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: a8be157c098d - stable/13 - refcount: Constify refcount_load() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a8be157c098d675e2d1419174edf3b1474fa075b Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a8be157c098d675e2d1419174edf3b1474fa075b commit a8be157c098d675e2d1419174edf3b1474fa075b Author: Olivier Certner AuthorDate: 2024-07-19 15:23:45 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:48 +0000 refcount: Constify refcount_load() Reviewed by: markj Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46888 (cherry picked from commit 9dc5b3dbb063f55543ff8a0619eee2e294fb7dc5) --- sys/sys/refcount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/refcount.h b/sys/sys/refcount.h index 212e8e516271..58d4ec573931 100644 --- a/sys/sys/refcount.h +++ b/sys/sys/refcount.h @@ -65,7 +65,7 @@ refcount_init(volatile u_int *count, u_int value) } static __inline u_int -refcount_load(volatile u_int *count) +refcount_load(volatile const u_int *count) { return (atomic_load_int(count)); } From nobody Fri Jan 17 12:26:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrd2KsXz5kvcF; Fri, 17 Jan 2025 12:26:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrc65K7z3TNm; Fri, 17 Jan 2025 12:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hND496IS1poo2RM8wQcAUaQh7CGao0RtoZbGPu7YPJQ=; b=Vti4j8mRkDeWrsudYqYQvMWsaGpzQfMgPHdb4ccgH0nzjDZjEWMus8ib3Q5246Px7GUVj7 zMhITDD+vit2xGVXjFbCMWun0J9qNJ/HI8XM3hfXy/0WT0MiAQ9orgnHceBZib+qnpeTO1 lQBhyxVvAPvdb4j8AkLCjZyhjF9vXPpvbzsKvwtlG0DKuXPMGYNdcQ7nON6pq2VRbt07/m 9rgTACW3ISjsJ5GzPOHIivfTo3FXS53kdQAI/SO0kRMxNlgAx+JiQDe+x49pWlH3a2fspe qVvSV/DGmudeBBCTO8n3yK7JRLbTNOfMcmefSb+x5Lkn5q6+D8NUNrofLmFLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hND496IS1poo2RM8wQcAUaQh7CGao0RtoZbGPu7YPJQ=; b=on5/pmgo30bOEVRFanM8r+GfSaiEJceqgBzabi4Tw7VIeR4WMzQ9jnDHFav/TlgsGDwKiT TqWIJLtpfZcpvEsWMC9edYO/MGHbyMZz+x3t7VwnJgc3YkszRVLDWHVB9mY7k8hlFIuCw1 xpj0ofGEcq/bETlaJymftTz83/ooBoyqlM25OMG57a3LQ8TADzx/grUnKQDkaIzzq2FVcJ XDIQj31Qu5/VbU3meoqlki8bjcwAFRom3X8hp74b2K7S18yOhb2PcCLDP8Nu3GUMtvDX+u o31VQy5LK8nLRoFmuCP/jwhi3/KuDoyCiiATLWj85XfVGgYEIgaultinOKvfvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116816; a=rsa-sha256; cv=none; b=NvFnrhqmmLmKI3LY6CNC3JmZA9VrP8yMa1/JYyUJG6O9EJ45xwxd7xzmnvfqGiNpU/0tBC lZpGPtEpmSRoLvegrehyJn7AVUKv2AmOwr1TDnPX6H2eFGyTAVstoWsA/nsmx/2+ekskEb 3+JI9pJGOxnvc2OJi3Mp2UuInHik12wMAEBWc9SjCGCe/bD1Ux9q5FM3WBBUekC5fD0qRP bqKRUV0sT4+K5bMKFuWzGZsF1rPl2xwP9g0fhxoE4jTrnnrBQ24EVcJaq5PuAWsRMCRn7w x4+xkBl1sBp9BZalTEqP2AF6Y15mgotZ8+ja5hO2UVoc55GM5rzY6EjM86a26g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrc5LHQz2rW; Fri, 17 Jan 2025 12:26: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 50HCQuvs051755; Fri, 17 Jan 2025 12:26:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQuCv051752; Fri, 17 Jan 2025 12:26:56 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:56 GMT Message-Id: <202501171226.50HCQuCv051752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: e6e9e70e51d9 - stable/13 - atomics: Constify loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6e9e70e51d987c54535b8714dc040fae68ac148 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e6e9e70e51d987c54535b8714dc040fae68ac148 commit e6e9e70e51d987c54535b8714dc040fae68ac148 Author: Olivier Certner AuthorDate: 2024-07-19 15:23:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:48 +0000 atomics: Constify loads In order to match reality, allow using these functions with pointers on const objects, and bring us closer to C11. Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm statement's constraint for '*p' (the value to load). CMPXCHG8B always writes back some value, even when the value exchange does not happen in which case what was read is written back. atomic_load_acq_64_i586() further takes care of the operation atomically writing back the same value that was read in any case. All in all, this makes the inline asm's write back undetectable by any other code, whether executing on other CPUs or code on the same CPU before and after the call to atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will trigger a #GP(0) if the memory address is part of a read-only mapping. This unfortunate property is however out of scope of the C abstract machine, and in particular independent of whether the 'uint64_t' pointed to is declared 'const' or not. Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46887 (cherry picked from commit 5e9a82e898d55816c366cfa3ffbca84f02569fe5) --- sys/amd64/include/atomic.h | 2 +- sys/arm/include/atomic-v6.h | 8 ++++---- sys/arm64/include/atomic.h | 2 +- sys/i386/include/atomic.h | 28 ++++++++++++++++------------ sys/powerpc/include/atomic.h | 6 +++--- sys/riscv/include/atomic.h | 4 ++-- sys/sys/_atomic64e.h | 2 +- sys/sys/_atomic_subword.h | 4 ++-- sys/sys/atomic_common.h | 20 ++++++++++---------- 9 files changed, 40 insertions(+), 36 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index 399d4ce62daa..c1816ac4fb8b 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -335,7 +335,7 @@ __storeload_barrier(void) #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE res; \ \ diff --git a/sys/arm/include/atomic-v6.h b/sys/arm/include/atomic-v6.h index c7a4de4b7e7d..ae844296f09f 100644 --- a/sys/arm/include/atomic-v6.h +++ b/sys/arm/include/atomic-v6.h @@ -614,7 +614,7 @@ atomic_fetchadd_long(volatile u_long *p, u_long val) } static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) +atomic_load_acq_32(const volatile uint32_t *p) { uint32_t v; @@ -624,7 +624,7 @@ atomic_load_acq_32(volatile uint32_t *p) } static __inline uint64_t -atomic_load_64(volatile uint64_t *p) +atomic_load_64(const volatile uint64_t *p) { uint64_t ret; @@ -643,7 +643,7 @@ atomic_load_64(volatile uint64_t *p) } static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +atomic_load_acq_64(const volatile uint64_t *p) { uint64_t ret; @@ -653,7 +653,7 @@ atomic_load_acq_64(volatile uint64_t *p) } static __inline u_long -atomic_load_acq_long(volatile u_long *p) +atomic_load_acq_long(const volatile u_long *p) { u_long v; diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h index c2a8caceeb64..72fae5703fb7 100644 --- a/sys/arm64/include/atomic.h +++ b/sys/arm64/include/atomic.h @@ -457,7 +457,7 @@ _ATOMIC_TEST_OP(set, orr, set) #define _ATOMIC_LOAD_ACQ_IMPL(t, w, s) \ static __inline uint##t##_t \ -atomic_load_acq_##t(volatile uint##t##_t *p) \ +atomic_load_acq_##t(const volatile uint##t##_t *p) \ { \ uint##t##_t ret; \ \ diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 96fcfcaed2c7..2ccd206a35ec 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -289,7 +289,7 @@ atomic_testandclear_int(volatile u_int *p, u_int v) #define ATOMIC_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE res; \ \ @@ -342,8 +342,8 @@ atomic_thread_fence_seq_cst(void) #ifdef WANT_FUNCTIONS int atomic_cmpset_64_i386(volatile uint64_t *, uint64_t, uint64_t); int atomic_cmpset_64_i586(volatile uint64_t *, uint64_t, uint64_t); -uint64_t atomic_load_acq_64_i386(volatile uint64_t *); -uint64_t atomic_load_acq_64_i586(volatile uint64_t *); +uint64_t atomic_load_acq_64_i386(const volatile uint64_t *); +uint64_t atomic_load_acq_64_i586(const volatile uint64_t *); void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64_i386(volatile uint64_t *, uint64_t); @@ -393,12 +393,12 @@ atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src) } static __inline uint64_t -atomic_load_acq_64_i386(volatile uint64_t *p) +atomic_load_acq_64_i386(const volatile uint64_t *p) { - volatile uint32_t *q; + const volatile uint32_t *q; uint64_t res; - q = (volatile uint32_t *)p; + q = (const volatile uint32_t *)p; __asm __volatile( " pushfl ; " " cli ; " @@ -487,8 +487,12 @@ atomic_fcmpset_64_i586(volatile uint64_t *dst, uint64_t *expect, uint64_t src) return (res); } +/* + * Architecturally always writes back some value to '*p' so will trigger + * a #GP(0) on read-only mappings. + */ static __inline uint64_t -atomic_load_acq_64_i586(volatile uint64_t *p) +atomic_load_acq_64_i586(const volatile uint64_t *p) { uint64_t res; @@ -496,9 +500,9 @@ atomic_load_acq_64_i586(volatile uint64_t *p) " movl %%ebx,%%eax ; " " movl %%ecx,%%edx ; " " lock; cmpxchg8b %1" - : "=&A" (res), /* 0 */ - "+m" (*p) /* 1 */ - : : "memory", "cc"); + : "=&A" (res) /* 0 */ + : "m" (*p) /* 1 */ + : "memory", "cc"); return (res); } @@ -554,7 +558,7 @@ atomic_fcmpset_64(volatile uint64_t *dst, uint64_t *expect, uint64_t src) } static __inline uint64_t -atomic_load_acq_64(volatile uint64_t *p) +atomic_load_acq_64(const volatile uint64_t *p) { if ((cpu_feature & CPUID_CX8) == 0) @@ -893,7 +897,7 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_subtract_rel_ptr(p, v) \ atomic_subtract_rel_int((volatile u_int *)(p), (u_int)(v)) #define atomic_load_acq_ptr(p) \ - atomic_load_acq_int((volatile u_int *)(p)) + atomic_load_acq_int((const volatile u_int *)(p)) #define atomic_store_rel_ptr(p, v) \ atomic_store_rel_int((volatile u_int *)(p), (v)) #define atomic_cmpset_ptr(dst, old, new) \ diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index e326f5aaabfb..ef42def6fa5e 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -506,7 +506,7 @@ atomic_readandclear_long(volatile u_long *addr) */ #define ATOMIC_STORE_LOAD(TYPE) \ static __inline u_##TYPE \ -atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ +atomic_load_acq_##TYPE(const volatile u_##TYPE *p) \ { \ u_##TYPE v; \ \ @@ -538,10 +538,10 @@ ATOMIC_STORE_LOAD(long) #define atomic_store_rel_ptr atomic_store_rel_long #else static __inline u_long -atomic_load_acq_long(volatile u_long *addr) +atomic_load_acq_long(const volatile u_long *addr) { - return ((u_long)atomic_load_acq_int((volatile u_int *)addr)); + return ((u_long)atomic_load_acq_int((const volatile u_int *)addr)); } static __inline void diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h index 03c1327d74da..32ceb9a6341d 100644 --- a/sys/riscv/include/atomic.h +++ b/sys/riscv/include/atomic.h @@ -121,7 +121,7 @@ ATOMIC_FCMPSET_ACQ_REL(16); #define atomic_load_acq_16 atomic_load_acq_16 static __inline uint16_t -atomic_load_acq_16(volatile uint16_t *p) +atomic_load_acq_16(const volatile uint16_t *p) { uint16_t ret; @@ -284,7 +284,7 @@ ATOMIC_CMPSET_ACQ_REL(32); ATOMIC_FCMPSET_ACQ_REL(32); static __inline uint32_t -atomic_load_acq_32(volatile uint32_t *p) +atomic_load_acq_32(const volatile uint32_t *p) { uint32_t ret; diff --git a/sys/sys/_atomic64e.h b/sys/sys/_atomic64e.h index f7245dafb98a..82fe817f307b 100644 --- a/sys/sys/_atomic64e.h +++ b/sys/sys/_atomic64e.h @@ -55,7 +55,7 @@ int atomic_fcmpset_64(volatile u_int64_t *, u_int64_t *, u_int64_t); u_int64_t atomic_fetchadd_64(volatile u_int64_t *, u_int64_t); -u_int64_t atomic_load_64(volatile u_int64_t *); +u_int64_t atomic_load_64(const volatile u_int64_t *); #define atomic_load_acq_64 atomic_load_64 void atomic_readandclear_64(volatile u_int64_t *); diff --git a/sys/sys/_atomic_subword.h b/sys/sys/_atomic_subword.h index dc1b2f23e731..491b869b46c4 100644 --- a/sys/sys/_atomic_subword.h +++ b/sys/sys/_atomic_subword.h @@ -176,7 +176,7 @@ atomic_fcmpset_16(__volatile uint16_t *addr, uint16_t *old, uint16_t val) #ifndef atomic_load_acq_8 static __inline uint8_t -atomic_load_acq_8(volatile uint8_t *p) +atomic_load_acq_8(const volatile uint8_t *p) { int shift; uint8_t ret; @@ -189,7 +189,7 @@ atomic_load_acq_8(volatile uint8_t *p) #ifndef atomic_load_acq_16 static __inline uint16_t -atomic_load_acq_16(volatile uint16_t *p) +atomic_load_acq_16(const volatile uint16_t *p) { int shift; uint16_t ret; diff --git a/sys/sys/atomic_common.h b/sys/sys/atomic_common.h index 83e0d5af583d..e03cd93c2d4a 100644 --- a/sys/sys/atomic_common.h +++ b/sys/sys/atomic_common.h @@ -36,18 +36,18 @@ #include -#define __atomic_load_bool_relaxed(p) (*(volatile _Bool *)(p)) +#define __atomic_load_bool_relaxed(p) (*(const volatile _Bool *)(p)) #define __atomic_store_bool_relaxed(p, v) \ (*(volatile _Bool *)(p) = (_Bool)(v)) -#define __atomic_load_char_relaxed(p) (*(volatile u_char *)(p)) -#define __atomic_load_short_relaxed(p) (*(volatile u_short *)(p)) -#define __atomic_load_int_relaxed(p) (*(volatile u_int *)(p)) -#define __atomic_load_long_relaxed(p) (*(volatile u_long *)(p)) -#define __atomic_load_8_relaxed(p) (*(volatile uint8_t *)(p)) -#define __atomic_load_16_relaxed(p) (*(volatile uint16_t *)(p)) -#define __atomic_load_32_relaxed(p) (*(volatile uint32_t *)(p)) -#define __atomic_load_64_relaxed(p) (*(volatile uint64_t *)(p)) +#define __atomic_load_char_relaxed(p) (*(const volatile u_char *)(p)) +#define __atomic_load_short_relaxed(p) (*(const volatile u_short *)(p)) +#define __atomic_load_int_relaxed(p) (*(const volatile u_int *)(p)) +#define __atomic_load_long_relaxed(p) (*(const volatile u_long *)(p)) +#define __atomic_load_8_relaxed(p) (*(const volatile uint8_t *)(p)) +#define __atomic_load_16_relaxed(p) (*(const volatile uint16_t *)(p)) +#define __atomic_load_32_relaxed(p) (*(const volatile uint32_t *)(p)) +#define __atomic_load_64_relaxed(p) (*(const volatile uint64_t *)(p)) #define __atomic_store_char_relaxed(p, v) \ (*(volatile u_char *)(p) = (u_char)(v)) @@ -124,7 +124,7 @@ __atomic_store_generic(p, v, int64_t, uint64_t, 64) #endif -#define atomic_load_ptr(p) (*(volatile __typeof(*p) *)(p)) +#define atomic_load_ptr(p) (*(const volatile __typeof(*p) *)(p)) #define atomic_store_ptr(p, v) (*(volatile __typeof(*p) *)(p) = (v)) /* From nobody Fri Jan 17 12:26:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrh1ZT3z5kvXb; Fri, 17 Jan 2025 12:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrg0VVkz3T7K; Fri, 17 Jan 2025 12:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRIEomBm023vyiZB33Vj/CZtDMubiu95e10P7pv2ons=; b=ysX4Dn3jUKtOSejME4sWXZM0l3Vaf4QVW7Op6XfL1mpMXmyqw800+cO5/SClwSPuBlT/oj T7WZQkXKrjzOjwdNUP5BzMb40SJWEq7oL0tyyf0VC/LluHFSkU95v4NtjWGtu+YO7NGGlp 1DAJR6S44pyKl4HfNeM9E/lX/YRcb0RwVf7xKXheqNWHmQ0V/yEnBRr/LQHyt0DovI7SHT K6A1yTG8NUgxoRYD6IELzqYg5bfL4DaFK7wKWTUkYESg/eyBNrHyrKbzMfCq6p4vUTNTRK CX0HPIeotJ6cGYL3ZyG7J8IdXsiZg7VeSlP/cTCABmshvyy/07vTa/humxgDqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRIEomBm023vyiZB33Vj/CZtDMubiu95e10P7pv2ons=; b=U82Rk4iIH4LZBccUJbgeuWTpoTk5+x4+JubRfVklgnWzuA7627qXLcxUhobPilv283jNKg O/MNw7+o1gv//tG3sucbLKE0634Uc5QNkJ5UBkHFRNAnUlko/WJFYBUmK7sYImuAJiRPcz Io4dVIMskPAzPkzlAhCZ9fsUkwRaslLO2zqNGhtZB8MQBRzIw8rIP+o53sPiQzDShjX2Ba 9iZOx0nIGeeDVTSn0gt6DIZahRzSOevjgiTNpZQuXaRhsYv+BxET7CwmNFA6PrzsFhcF7x +kN+yvAnRMuTPYM5Kb/YFtlToqh2r8E88sXNn86N97Vu6t8UD0QnPPsTksUmlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116819; a=rsa-sha256; cv=none; b=NsfMIasyzFdd0LWqkPbRmIkWEFWFZvbL6J2mDA2aTizqywHxNsadkjxmhwRkEs4GcRaenN AKIuG9t9hB6ljiRETdlAZl6D0O+qXlEed6SQG37PXpyH+5AECN08oRBhemV1LminW7K2wO vESchFTueb4U4ZV79Oqh+01v8aqXDHwC4NELsUALu5F4zl8ppa4l3VPwAd41z65B62VywF UCyHe9B4yhU+ryPWCiMtApMCa+sNlA+2ykXqLtRqTy+7vhhx8UcVEvTK8vEt9ZXGvjxfkY 5exXAkZRZERtKtyvwVUiNuhDe0u5FU/BMgatsEiKwL0yPWei6n20Wi2sZyHfvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrg04D7z33L; Fri, 17 Jan 2025 12:26:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCQwvj051836; Fri, 17 Jan 2025 12:26:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCQw1i051833; Fri, 17 Jan 2025 12:26:58 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:26:58 GMT Message-Id: <202501171226.50HCQw1i051833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 229e81dd12fd - stable/13 - queue: New debug macros for STAILQ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 229e81dd12fd7dca2077c143ff50742e8600bf36 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=229e81dd12fd7dca2077c143ff50742e8600bf36 commit 229e81dd12fd7dca2077c143ff50742e8600bf36 Author: Olivier Certner AuthorDate: 2024-07-08 16:15:49 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:49 +0000 queue: New debug macros for STAILQ The new STAILQ_ASSERT_EMPTY() macro allows callers to assert that some STAILQ is empty. It leverages the new QMD_STAILQ_CHECK_EMPTY() internal macro. QMD_STAILQ_CHECK_EMPTY() is a check for empty STAILQ, where heads's 'stqh_last' field must point to the 'stqh_first' one. Use it in STAILQ_ASSERT_EMPTY(). QMD_STAILQ_CHECK_TAIL() checks that the tail pointed by 'head' does not have a next element. It is similar to the already existing QMD_TAILQ_CHECK_TAIL(), but without the superfluous 'field' argument and clearer documentation. Use it in STAILQ_INSERT_TAIL(). Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46889 (cherry picked from commit 34740937f7a46c7475bb57e804701ba8830bf6ed) --- sys/sys/queue.h | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 8e91ebf7949d..4e0ba068c520 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -340,6 +340,40 @@ struct { \ /* * Singly-linked Tail queue functions. */ +#if (defined(_KERNEL) && defined(INVARIANTS)) +/* + * QMD_STAILQ_CHECK_EMPTY(STAILQ_HEAD *head) + * + * Validates that the stailq head's pointer to the last element's next pointer + * actually points to the head's first element pointer field. + */ +#define QMD_STAILQ_CHECK_EMPTY(head) do { \ + if ((head)->stqh_last != &(head)->stqh_first) \ + panic("Empty stailq %p->stqh_last is %p, not head's " \ + "first field address", (head), (head)->stqh_last); \ +} while (0) + +#define STAILQ_ASSERT_EMPTY(head) do { \ + if (!STAILQ_EMPTY((head))) \ + panic("stailq %p is not empty", (head)); \ +} + +/* + * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) + * + * Validates that the stailq's last element's next pointer is NULL. + */ +#define QMD_STAILQ_CHECK_TAIL(head) do { \ + if (*(head)->stqh_last != NULL) \ + panic("Stailq %p last element's next pointer is %p, " \ + "not NULL", (head), *(head)->stqh_last); \ +} while (0) +#else +#define QMD_STAILQ_CHECK_EMPTY(head) +#define STAILQ_ASSERT_EMPTY(head) +#define QMD_STAILQ_CHECK_TAIL(head) +#endif /* (_KERNEL && INVARIANTS) */ + #define STAILQ_CONCAT(head1, head2) do { \ if (!STAILQ_EMPTY((head2))) { \ *(head1)->stqh_last = (head2)->stqh_first; \ @@ -348,7 +382,11 @@ struct { \ } \ } while (0) -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_EMPTY(head) ({ \ + if (STAILQ_FIRST(head) == NULL) \ + QMD_STAILQ_CHECK_EMPTY(head); \ + STAILQ_FIRST(head) == NULL; \ +}) #define STAILQ_FIRST(head) ((head)->stqh_first) @@ -390,6 +428,7 @@ struct { \ } while (0) #define STAILQ_INSERT_TAIL(head, elm, field) do { \ + QMD_STAILQ_CHECK_TAIL(head); \ STAILQ_NEXT((elm), field) = NULL; \ *(head)->stqh_last = (elm); \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ From nobody Fri Jan 17 12:27:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrj5RKZz5kvXd; Fri, 17 Jan 2025 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrj2Hmcz3TWh; Fri, 17 Jan 2025 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZVcMAdWM/B/fHbr9qrbfANyX74NGt3/9T76x+ge24jk=; b=TyR/SgFAIgYM4tpowP9tPd3i2XhgYAY4y0RTNZjZHpNQITIjn0P75jiFSud1ZZbZLUrXpJ hfcOJEz5rVzDcMPC5V6b1fS/GLixOyg9I77lBgy16zXjP5M8LJu156hQC4XCBEMlpWZUVD 2+981IPYwgyWhyC1fjKw40t0zVlohJ9u4uY4UTznmsDU7fP5AJ6Twn5vjYVd2HKxAjCqe3 xVvHFw+61hAEqButxrYsN29ntcN8havcfOaUGQA/JK9Gvfq9V3iKWQCVbR/nGoTU3iy1Ud qSRgSoBA6LuAJeI5mr9z2wIBMrGrQSH9sc7HJO6yJXwHiS02Szii5SYhw6WKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZVcMAdWM/B/fHbr9qrbfANyX74NGt3/9T76x+ge24jk=; b=Uj2KkBnVv2yY55anNu8sORWuOY+buB7/brKiZOJYLuSwV++IPhzVAU8+nZfUNbudhAVCpW 6GpRIJ3Ovb66EnJUVmP6H5NV2iXi+bfE+ze4XUmJtmzTvejrL4YYEg+fPHwS40W770g/2i C7/7EEIVY6QBKWyEZF2X8/qT1jd1r6G4ZFnKBbwUHYuUbLtpBj05Ybd66uBtRIIjzwU7UL 9PbakfsjSaKeTdGfBZSyaEHI5WeKAuLprtuWZqsZb4aBJ7o6NtUWbkQ5MWA66Z8jXdbvYK de9VC650KLo5OHif+J/k3uARPEW2ndaffyH0a+Tx8NqRiGHuKS3/yIh4EpjX1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116821; a=rsa-sha256; cv=none; b=XwGJBPs8NoJT6/DtunHqXzaIpRBmN116JTk4jIz9/7ttemnMUfSIvxAI4mkDe3Gh8j69KT BIyixvM92JEZPWWCcDqloh/xWMBBq7bccW5/R5iO/JQKdx1LwVsBHGD2kCD5BdtN59UvmQ QLL0hvsj1g8RE03nly4skxe//EngqEIabkgXLrDsLRJwy3TiKUlbPIcTv+Pfwg6lKLzZ3l kLmiRH0vzkdl7k6nmySPjaRKBxvL8HJOoJGTAW3EWEI4qfxFKJKGBtJ9XuzwOeWBDpzId0 nucyTUhMzHyaHXsbn2rPS+/ilE5MYnfD5KVUxDEvDCJDi7f2sNbXYs5LtyTk3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrj1qgrz33M; Fri, 17 Jan 2025 12:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR1TE051944; Fri, 17 Jan 2025 12:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR1PF051941; Fri, 17 Jan 2025 12:27:01 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:01 GMT Message-Id: <202501171227.50HCR1PF051941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b9c8344a391a - stable/13 - MAC: 'kernel_mac_support' module: Make an outdated comment more generic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b9c8344a391aaed715d1230abd958fd7bc465f65 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b9c8344a391aaed715d1230abd958fd7bc465f65 commit b9c8344a391aaed715d1230abd958fd7bc465f65 Author: Olivier Certner AuthorDate: 2024-07-03 14:23:38 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:49 +0000 MAC: 'kernel_mac_support' module: Make an outdated comment more generic No functional change. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46898 (cherry picked from commit 90678c892d7b3a90339b7fc19fde16c64fe3cb70) --- sys/security/mac/mac_framework.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index da4fe9f237e6..342389606430 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -106,7 +106,7 @@ SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD MAC policy controls"); /* - * Declare that the kernel provides MAC support, version 3 (FreeBSD 7.x). + * Declare that the kernel provides a specific version of MAC support. * This permits modules to refuse to be loaded if the necessary support isn't * present, even if it's pre-boot. */ From nobody Fri Jan 17 12:27:00 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrh3p1Lz5kvfk; Fri, 17 Jan 2025 12:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrh1CLWz3TK5; Fri, 17 Jan 2025 12:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV5FZ+d3dVGcPzdLzxAi3NnBWkC5uBW1wXCtnTNUTVw=; b=uXJIRhafRoGm5UH6RpMTkZn9G43qNVcBIOPqbxZssnjTz/CxKivPEG+kilqdH0X+/BI7H0 8tdmNdoQfXq85cXVgx1EySq0lm+6ogGkIl6kSFW5xfMmReYLPCSVbdp2dRKIqhfp5BkiEM zmY6+XqRcCIto/S45s3CSCJZL2YV7RBWR+H23KWvoITjHZCbi9qRjqnUkhhT2jUSZclxuO QkKhg0DsB/sb/jZob4HaBJ4n/spmpdSHLny6PamP16f+Em2YXgUKYB6IQhZfx7nXNRhEil Fw6ee+ggOgL1oImNSy1JrcyRldeF4NgREp50aFHjaV0gGSik3r/d6E8LU73P2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV5FZ+d3dVGcPzdLzxAi3NnBWkC5uBW1wXCtnTNUTVw=; b=qjZ8dlDtrYroBSvEOagwsXDDk8VrPk7xek0B3iInDtcSfSdiBu7gC2DLVrKzhDRsog6/pn 06MrfgAFfrK+1ZCrl9PaKchjXAwTCplxe/3np94TSVLp2I+AsLcXeehVcelGDHaiEoxkoF CYvMc+vli0sb5hBPcn5Kmx+WP1VgB8HBaxEboivo5Qwk6OnA4slJKutYkhbnXeIHayl45c PGovATs0PxI4RmXumPRyCHEwPXyJDX0Bb1oi6i1P0ajZ+k9BmwyW2eJcvT+0hJhF5IVibd qPsHQ0DxiHwRzaJlqlq/UxnCe+mlOHkdSMx9yltSK7seSVtNZIYbjuN4EP2Vxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116820; a=rsa-sha256; cv=none; b=xtZjS4Re7ceE8HCKa2xbK3jc6hOaTIL4hG2tBrJ/ux5YZkocPCiGxrK3qejaBQUHr69Niw W3Ip7Dz9hUvyRoAIiXcBZ2PTI+r1n1Eh/ZutcCmKQwsbmJjHR7rM3qIwXUYeAX4VpwjT7x UoLVlfbVHpvuYqJHrWWXfo5611AXaCsav9lFzTH0rOsYtI2CB77PxuXNPbRDbwo8s7T8kC vc6iZkLpXzKlO9bLmC4harhKuku/MhYcDNnKKeBk/stQ2nmRxMNIcN1FOC7v24qp/gHJ6v yYvgGipJ/nQ9/fPtFKOIjyUxK4MkUhtF6PpToxjI5bOPsa2Jjkoz8TIjyneKsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrh0nM5z3BX; Fri, 17 Jan 2025 12:27:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR02G051890; Fri, 17 Jan 2025 12:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR0HX051882; Fri, 17 Jan 2025 12:27:00 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:00 GMT Message-Id: <202501171227.50HCR0HX051882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: c05d82c461e7 - stable/13 - MAC: mac.h: Fix missing includes/typedefs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c05d82c461e7314823698a59f3781e0f6b7ab7b0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c05d82c461e7314823698a59f3781e0f6b7ab7b0 commit c05d82c461e7314823698a59f3781e0f6b7ab7b0 Author: Olivier Certner AuthorDate: 2024-07-29 14:21:52 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:49 +0000 MAC: mac.h: Fix missing includes/typedefs This fixes inclusion from userspace, and also kernel inclusion for source files not including explicitly nor implicitly . Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46896 (cherry picked from commit 5140ccf2268b0e771c89e46f46c60e1fee7637c3) --- sys/sys/mac.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/sys/mac.h b/sys/sys/mac.h index facdc14c332d..ae8d8d38f17b 100644 --- a/sys/sys/mac.h +++ b/sys/sys/mac.h @@ -47,6 +47,13 @@ #ifndef _SYS_MAC_H_ #define _SYS_MAC_H_ +#include + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + #ifndef _POSIX_MAC #define _POSIX_MAC #endif @@ -72,6 +79,13 @@ typedef struct mac *mac_t; #ifndef _KERNEL +#include /* For __BEGIN_DECLS and __END_DECLS. */ + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; /* process id */ +#define _PID_T_DECLARED +#endif + /* * Location of the userland MAC framework configuration file. mac.conf * set defaults for MAC-aware applications. From nobody Fri Jan 17 12:27:03 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrm2FyRz5kvnV; Fri, 17 Jan 2025 12:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrl4Mwpz3TPk; Fri, 17 Jan 2025 12:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p6ATHfX8o89O6rEt4S7hEK00lAEUGWq5l67xMTzG/E0=; b=NcBmkIvNOWpxlCf7qOGNzkEHrN94cJVeXtO+wbAeQ5lDhcmHi0OFIbsNyyirPkpvuN+VXL GwZO2NoWw7JbnluaG70MdTlxtMytIiA0kb2Gng96647GB4Q0uNNoHzlSCK/7J3RgEG14eZ jGlpCyfxVdwSaidzPOPk7g58JXcdx4kGm33fXrd40Iu1+VjZ9aC1M4OT8KebKL970xy2dy h6/1xiPfwqS0hDrWAvFDXe6H+ooJNe/d3/Z8kAbcBJLi2jf7La+otnP4y+cBoSXYFt5BOR MyoH9svgIrFA0KBZIem6QhkTfCGvaPLzz5f90Ib7rn7MrW5OI0SvgWBcyxrgWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p6ATHfX8o89O6rEt4S7hEK00lAEUGWq5l67xMTzG/E0=; b=DaHeKsY15xLH340SOhbRF1k1URKROoEntvSx9G3f7I5piqIeVOF/9g+tljbpL1CsC6rTYb dIzNSYvvP6VfRnf15b0j4L5VdzksMVC6r/sEKQwyQR1tHEJHIYzqYGbrc2t8OCWMHzAvLe KUezie6qu4GdhFhYS5a4Ktko6iMwe2/o8/Dc2fVcvgf342ofT/F+iEys7Kp0vKq6mAlA5E 3S/46ljd+YZLXNKGwdr7HZtrpJHdRvJAq1D1aDJrqWWi0SbrQWL4fgXbG3sqWuFhh3/bba VHJVqEXXhhQpJt2gFDN5GUTVQ1gwky6rwfZeCA+fiuBaMrdhUaw5LIBuU0sipg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116823; a=rsa-sha256; cv=none; b=JBRcSPTaagnEtcY1YBaxi2SY3mTklsPVS/G8Dkp8QhW7gfp8pdcV44z1RkAmygatFvBH1c vdhnxOhihTkOxE9wUqw6z9Fh5p8hb6K+8Up0oonx+15RosXWefbsfwNL7vWBVMUCHiRY2d 5WK62i+vtmg7Kk4SqlofCwuYPDXpIqNEZ52Jh4GWn9BRQ+WoftYDTVPeFenbDa8eVDoL7/ /Es44yWFf8EhBrX7Ym83SuB6G8q0WAF7UVAXHgkZv4rtuztRy0Woyb02XkTxtznybeF0Wf jG5UhiJ2BfkdRQ2qGbkppWzIcWUUkA3qff1yqUjoHOX+RCMDTwHa5J7gxR7r4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrl3xrQz3BZ; Fri, 17 Jan 2025 12:27:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR3iQ052060; Fri, 17 Jan 2025 12:27:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR30V052057; Fri, 17 Jan 2025 12:27:03 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:03 GMT Message-Id: <202501171227.50HCR30V052057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 386c6749bde5 - stable/13 - jail.h: Fix whitespace in the param macros declaration block List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 386c6749bde5453eac9183b93a2aaf7f2bfe6192 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=386c6749bde5453eac9183b93a2aaf7f2bfe6192 commit 386c6749bde5453eac9183b93a2aaf7f2bfe6192 Author: Olivier Certner AuthorDate: 2024-07-04 09:01:10 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:50 +0000 jail.h: Fix whitespace in the param macros declaration block Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46900 (cherry picked from commit f8fe6bc73bbbced506a02ed88783c0c0bb9b49e4) --- sys/sys/jail.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index db4a5cbc2831..942da2a87b81 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -370,26 +370,26 @@ extern struct sx allprison_lock; SYSCTL_DECL(_security_jail_param); #define SYSCTL_JAIL_PARAM(module, param, type, fmt, descr) \ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_STRING(module, param, access, len, descr) \ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), NULL, len, \ - sysctl_jail_param, "A", descr) -#define SYSCTL_JAIL_PARAM_STRUCT(module, param, access, len, fmt, descr)\ - SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ - CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ - sysctl_jail_param, fmt, descr) + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + CTLTYPE_STRING | CTLFLAG_MPSAFE | (access), NULL, len, \ + sysctl_jail_param, "A", descr) +#define SYSCTL_JAIL_PARAM_STRUCT(module, param, access, len, fmt, descr) \ + SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ + CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ + sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_NODE(module, descr) \ - SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_MPSAFE, \ - 0, descr) + SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_MPSAFE, \ + 0, descr) #define SYSCTL_JAIL_PARAM_SUBNODE(parent, module, descr) \ - SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, \ - CTLFLAG_MPSAFE, 0, descr) + SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, \ + CTLFLAG_MPSAFE, 0, descr) #define SYSCTL_JAIL_PARAM_SYS_NODE(module, access, descr) \ - SYSCTL_JAIL_PARAM_NODE(module, descr); \ - SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ - descr) + SYSCTL_JAIL_PARAM_NODE(module, descr); \ + SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ + descr) /* * Kernel support functions for jail(). From nobody Fri Jan 17 12:27:02 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrk6TDrz5kvlX; Fri, 17 Jan 2025 12:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrk3Hq5z3TV4; Fri, 17 Jan 2025 12:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UvwDaSoh4+H8/bozFRNuwbDbN1+eW7Cn0Ou6EweYBks=; b=L3CAygQhO5nHOBdfOAi4WuTTalVL/MZryo+fipLqNhdkiTKpjtrpEsbYxPyAOJkOOIj4a7 YNFkYBXswvjRL6FCDYOyIpPQM16o4qxyE0Dhodv1Z4S2U8aWb3AEhVyWTeoCh9FREA7gKR QIBGfzgkT6sERBl7f8eg9SiDVaIEVzhKsZAjIqFUTum+WT3BNEeti6/oplvh7tu3fz+IAX xVCeY9lQfPW8g+bp53JhVTT/4stmkeXtN0Ixrlkl+Vg8eHoHgK+im3LNWfHtWV6u7NfAQK Mlvp/Gg3lpSnto9F+1EBuA1Ltne5ChRrZAz6hFPESdmtilV3BFQFGl5YdSrYoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UvwDaSoh4+H8/bozFRNuwbDbN1+eW7Cn0Ou6EweYBks=; b=IFOChnd57l4dfODZ954qzjWG3RpCY4lLZPIGk8a3e3hVm5vjh3P+aejN+uB08LXDaJev4V NMhtPs9dfIMBIsWhQmpySiu6Ql0xX2nabiH3wztxTYKyhpmZLJ8VlG0m69ziBjnfzLvfAT neDIn59bhKcjjZtZj2Y7K0UxUKTfDPra9jPrLm5rL8B7zwo+TqE0CmsCt/BgddT/Xidvu6 GwtwBAvDr/FNhaLIe+mi9vCv8CvQCGsPRsGlziHAah1buU33yhatc42oSTFPVhxcUtDgbp iicmBdYVq45ZGEw7yEuW132muevPZyxFcCsCxdGitRN13JfR1vbeHCmOFToZQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116822; a=rsa-sha256; cv=none; b=vUCxT6T4gAxzYOdN7itci4a+HOgerRNvHgDyO6eoC3VFpnYu2Ly5ovoLItPw7gwTwcHvLH S3nG/VMgoYpJmFaW79vldltNEIoWTxUSfiiguDHE2WlAHBG9OoysqlrdVFLfe9wLhfT1TS gKW2bzEgqI575V8l4KUIQrQXIsrROUiDDYPkF9Oty10a8CmESdJkOEaFm8jPu8sG5Db2yo hNB6g7w02n6E/0dpHtJjtsgFhrz+sh0evUMzhtb18zE1XUiVYOsSMPQAK8Viu6gA+5WEic /OLLtzCrmIY1VeDHyvRwm8n58RCdCeYaSnOLrehOJ5TLKNOaZGFhA/rCYF4cAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrk2vYsz3BY; Fri, 17 Jan 2025 12:27:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR2dM052006; Fri, 17 Jan 2025 12:27:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR2O6052003; Fri, 17 Jan 2025 12:27:02 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:02 GMT Message-Id: <202501171227.50HCR2O6052003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ae2383c0dd16 - stable/13 - MAC: Define a common 'mac' node for MAC's jail parameters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae2383c0dd16e06991a0462758107e0489ec53a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ae2383c0dd16e06991a0462758107e0489ec53a7 commit ae2383c0dd16e06991a0462758107e0489ec53a7 Author: Olivier Certner AuthorDate: 2024-07-03 14:30:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:49 +0000 MAC: Define a common 'mac' node for MAC's jail parameters To be used by MAC/do. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46899 (cherry picked from commit 5041b20503dbb442cc9ebd0a6e4db26905102c72) --- sys/security/mac/mac_framework.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 342389606430..ae18dead6840 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -105,6 +106,11 @@ SDT_PROBE_DEFINE1(mac, , policy, unregister, SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD MAC policy controls"); +/* + * Root sysctl node for MAC modules' jail parameters. + */ +SYSCTL_JAIL_PARAM_NODE(mac, "Jail parameters for MAC policy controls"); + /* * Declare that the kernel provides a specific version of MAC support. * This permits modules to refuse to be loaded if the necessary support isn't From nobody Fri Jan 17 12:27:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrn2VVGz5kvZH; Fri, 17 Jan 2025 12:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrm5P9zz3TXM; Fri, 17 Jan 2025 12:27:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVBIK46P74ESRDQI+IEdZE4rkAwP/tKQB35GzZncHag=; b=b4uM4pt9sOShJ819hdRNRxGy1oUXtF+apHz8Z1ywlDHCGUIYGhlX2P/DO4zOpHPsNrNh4h 7UjVsw2a3oWdr4StEBz7SIHfXoyAexduLydcg7KTHcxWs+Vd/M/8uyWj1v2mIkH33rZf6J uVEqEWC8Vt5hkNSd1GDqCXO3d5lCiopiPvDGihbCV7i6d4GbD8nc6DzczHwsjX8eoYvAXX +gS5zX8BnbAe4ylMnVS39SPOLuHR6+KUZPF3o+F6K4Mod+26OL36lxHRY79fe+q2OFBRq5 YMHaIIjAp95F4pZl8+xr3Rbm5Mcnl6Bj+lqcA884nKBRsMPJhHdatpTWERuOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVBIK46P74ESRDQI+IEdZE4rkAwP/tKQB35GzZncHag=; b=k/5tiOEgblRmaFAVCSBw/A6azhqXDWE3yAq9HzEsknv8dZwRqSyJAdqZ/ipKZ37S+74fVl g4zrBw29UyK0Ohqgx1S51C+RWG7fa7cUE6QI12EGYFJTn8mgyPzeR2i+RnUvpr/JcoDgrV MmFa3ti367IL35RdPA20XSssUgAVECC11aCfMe4fQRZNbCJemNF7qlYiZ3pQW81svGxOD2 6Si4eb250JLwB8ANgzZbnlpX8lFZZJVjGtBY4T5nfkGBfh126KyPztZiTBAl6MDP4b+bBJ mCOdSVMbovIe3zUr1fuuYFxI8a3NCGNFG2Rm7D8pQPMO9NcN7IIKYAFJBag1Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116824; a=rsa-sha256; cv=none; b=vq9GIep/e/VXviNOxuAQp//TQyCUAKPSoO1Ta8qdysy4prg2HKR5QtvH4+0BzJghUs9nfp qMLZWEARdcIivuupCGjW2cjbD/Lmhi2LIyZSy4EWFNYBs4eirfyAyj+XMbniu3TMkFR0df W9APje2+PFmslXWLILPt9l8si7n75jMyh3fCTE77ZF8TyvJc5mEpwqWj2dvnO1thxh1UZT ZerToKD8IdT9qJbwIjwr7h7yPxoB4R7DWtQXT4pbXDsZ88zexD2dBv/LB8WHXreO8D2uE2 K9z6CDphLWH9/1Qmym18mFxBZD/U34rAztANF/yNA6orDPHnI1POx81g/2RClQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrm4rtRz3Bb; Fri, 17 Jan 2025 12:27: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 50HCR4s8052096; Fri, 17 Jan 2025 12:27:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR43G052093; Fri, 17 Jan 2025 12:27:04 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:04 GMT Message-Id: <202501171227.50HCR43G052093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f30f1a14f772 - stable/13 - jail.h: New SYSCTL_JAIL_PARAM_SYS_SUBNODE() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f30f1a14f772cb31e745b779936db6a6b301b4c0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f30f1a14f772cb31e745b779936db6a6b301b4c0 commit f30f1a14f772cb31e745b779936db6a6b301b4c0 Author: Olivier Certner AuthorDate: 2024-07-04 09:05:44 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:50 +0000 jail.h: New SYSCTL_JAIL_PARAM_SYS_SUBNODE() Same as SYSCTL_JAIL_PARAM_SYS_NODE() but allowing another level of hierarchy. To be used with MAC policies, so that they can have their own node under "security.jail.param.mac". Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46901 (cherry picked from commit 9f8020e65ba8f2398bf79505037b75670340e5fa) --- sys/sys/jail.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 942da2a87b81..11d3745ba2d2 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -390,6 +390,10 @@ SYSCTL_DECL(_security_jail_param); SYSCTL_JAIL_PARAM_NODE(module, descr); \ SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ descr) +#define SYSCTL_JAIL_PARAM_SYS_SUBNODE(parent, module, access, descr) \ + SYSCTL_JAIL_PARAM_SUBNODE(parent, module, descr); \ + SYSCTL_JAIL_PARAM(_##parent##_##module, , CTLTYPE_INT | (access), \ + "E,jailsys", descr) /* * Kernel support functions for jail(). From nobody Fri Jan 17 12:27:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrp5P8sz5kvfx; Fri, 17 Jan 2025 12:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrn74tkz3TVX; Fri, 17 Jan 2025 12:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBR629KGALkMzEkDQCSuGQvN1VLfPo0KS1Z6oC3+u/s=; b=vvp7MgB9htlkgxHiUXLZzjILE48CPC3RMAaFj1ltz+PJ2lhF2+/+AxZiaIkUVL9uPXCAXB aUPnZhTEv0VpRvQikw5f9udWJxxepJRd0UhY3gyanPDbPpBe60T2gqvfp3B2ZPMKJkPeCX kDZ+fPtuG81xqv88XNE4KY0TKDiFWv8iSwzqwu6u1tCvzDXwJiNbPKXOkHT1wSPNU2+8SK MQp3LUKXGFcQlzMF18uoa7C+RoAsZtN202xkeiEKrnT1VdfWyzZ5NMD5fj9YPjSqLCFEPy zX0x6uht4sQNDV6tWgEfGrwo12Ris0y/xLXctfl94N31IkEkxK19o3jkzfZlCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBR629KGALkMzEkDQCSuGQvN1VLfPo0KS1Z6oC3+u/s=; b=uCXj5ZJ8VwEq3Uw/osR7I8H6lO7QmFkZc7VMuKubyUkSa5KAA71+1HbR+tjAQ2oDog4Ohq AI7L6PdBYq+xFxjI5lrHUmNsQhclPTsIFb+3pWCmSusreJWhs2TnwcVT2lGxzafOZuoLZz A6uK4o/GRYWjd78v16kpkaJC7AUisZKgh3tsME4xoV8qGKg1xVaqjSu42G8ktUvBxS4N2X d8LOF2l0epU1K/e43SWWAeNwZLeTupZCGkDpkdukdlMlvjc2PgPPnjTHgKLgQIrobVSMld GJoWdCM2VCXrfXQJS89p2DxTKgReoX6BM5okQtnwxGhDE7n6RuAN8Xr/L8Mrig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116826; a=rsa-sha256; cv=none; b=Ruo3Y1S3YQabfmyk7pH/9lfS5CfaLH5OzUP4pOePu8JPs79SExYsRaw3FR5/ftDfynH65I xBB3UCqk3MYFLQUcvT5ZcXkfQyeu3yK+QV4OKIKHlX8zYs5xXKupmkKsO8iuRNIW/ug6Y3 QW3lA9ui3+3Xzf+9DWmmRIzmxJC8ctl5jD3K3i+MF9QW5cINZbOv4FFVpwZRWbAAMRHUvI TLg4/XSe8RqO04hHuFep5NuGtjzo1cGme4pNwMQCFxx+dTtHuqm+CMuy916ZLakYYlmTLv R6OliPCN3MAuvzn4pru23yW/4GHPsy6yOuZPdbZMNKWSVD5lV1H9FXS/e7NARQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrn5XL7z2rX; Fri, 17 Jan 2025 12:27:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR5dF052132; Fri, 17 Jan 2025 12:27:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR5ln052129; Fri, 17 Jan 2025 12:27:05 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:05 GMT Message-Id: <202501171227.50HCR5ln052129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4c2602473d12 - stable/13 - jail.h: New SYSCTL_JAIL_PARAM_DECL() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c2602473d127604dd643815622d5cd39f90ec54 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4c2602473d127604dd643815622d5cd39f90ec54 commit 4c2602473d127604dd643815622d5cd39f90ec54 Author: Olivier Certner AuthorDate: 2024-07-04 09:50:04 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:50 +0000 jail.h: New SYSCTL_JAIL_PARAM_DECL() Like SYSCTL_DECL(), additionally prepending the well-known jail parameters' sysctl prefix. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46902 (cherry picked from commit f7bda491ef05717fb4fe6c89083485599db951b8) --- sys/sys/jail.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/jail.h b/sys/sys/jail.h index 11d3745ba2d2..2a8c18cf23a6 100644 --- a/sys/sys/jail.h +++ b/sys/sys/jail.h @@ -369,6 +369,8 @@ extern struct sx allprison_lock; */ SYSCTL_DECL(_security_jail_param); +#define SYSCTL_JAIL_PARAM_DECL(name) \ + SYSCTL_DECL(_security_jail_param_##name) #define SYSCTL_JAIL_PARAM(module, param, type, fmt, descr) \ SYSCTL_PROC(_security_jail_param ## module, OID_AUTO, param, \ (type) | CTLFLAG_MPSAFE, NULL, 0, sysctl_jail_param, fmt, descr) From nobody Fri Jan 17 12:27:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrq4q8Jz5kvfy; Fri, 17 Jan 2025 12:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrq0J9Dz3TZS; Fri, 17 Jan 2025 12:27:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXWXSfcC3V0cz/OcS7ly9uvPAed5b+Fwr2es812CQG8=; b=cSlXJ2J9nPkAyxMU8ngr7xwKIashqzFhvve2GEb7sN0gGb9gF7uAz8hXLmKhrF8LrkuDAw QOU9jVx41jXmiCTCStLwh84TuEqBYc/yU2ZMbdHuc+MNZUDMwVLbDAHR48K6tjY+WTZj/S 2cLA6sXRZfB4DoFkxT8An54WsrNXR56haWzXKf0s6ekgKbw94MpyGU1OWjbcT9lYT1Ct8F 3+NvdsF5e1tKF7uz3JVLnV2ST9RHgLrMYx28ob2ToYB/OrsH1xX94UTh1jm+GwJH0VRO3J qGk+MDwNUKVBV/O89auPYT780Dr3/gTYcDGMuikX1CmPWoFlDrKvgS8sicKQXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sXWXSfcC3V0cz/OcS7ly9uvPAed5b+Fwr2es812CQG8=; b=FSVJephGa8bYYqwjz8Tji4mfZo5URCUkznnF66iygBSiKBkmLxdobPUDmEFReMZGNEGx7N TnmDRVY9GsVv021T2sQcddGJID2M5HnLFkp5V0tsRdk8mk2mQq3Pf2GSS3rhboOTv/gesq fyh119XTdHAOVm7TnHfylOjzvOS0an4bKF2InzYPsr8A+tIAnjNF8lcKFCzvAauwolf+zq cs7iNAfqoOODw1bw+rv6CXmaP67j9juTBdqR0i7IkykIvxwyCCmy82U+xLldRk5ot3P6hY THVxvoei6HNHyJ3HwcYAdGvnk7rxAP0NXl2HIx+vMuPXl4lHodrXBoWlk32VnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116827; a=rsa-sha256; cv=none; b=VBCkObtF+kFetUtmbZ1d1hXqg08ORiAAMf7qIqf+DgBlSEi6m69WJJiaWykHQq3c132fgG YuZbp16OJIzOGUmUwlrBiId1syr+VTNPHOI4Tni1UmP7wPfdyspyBlg6HLBHe0pJMDfJQL K0/ffWCfv6ooi51Guo+4BJ4TpSDP0JFYP8H/ac+XEfosryPfTEb0ZJgweZ+Tc0bgv6gYeg EJWoxGAj2Xl1bycmReRvWe6PKkAvSXf3xRwQ9Qvhab5IpsQdPVd6nz1js80rFD4hB6dvHC tCkPgWVOCauFeF18j4x+RFKEjodMVKy8Xe8RZrvSocsCnguaZQvg0z/bzluXrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrp6yvrz2rY; Fri, 17 Jan 2025 12:27:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR6RZ052189; Fri, 17 Jan 2025 12:27:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR6a1052186; Fri, 17 Jan 2025 12:27:06 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:06 GMT Message-Id: <202501171227.50HCR6a1052186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: fbac48f4b460 - stable/13 - MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbac48f4b460f03def43165c80c6082b6c3c4d2c Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fbac48f4b460f03def43165c80c6082b6c3c4d2c commit fbac48f4b460f03def43165c80c6082b6c3c4d2c Author: Olivier Certner AuthorDate: 2024-07-04 14:08:20 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:50 +0000 MAC: mac_policy.h: Declare common MAC sysctl and jail parameters' nodes Do this only when the headers for these functionalities were included prior to this one. Indeed, if they need to be included, style(9) mandates they should have been so before this one. Remove the common MAC sysctl declaration from , as it is now redundant (all its includers also include ). Remove local such declarations from all policies' files. Reviewed by: jamie Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46903 (cherry picked from commit db33c6f3ae9d1231087710068ee4ea5398aacca7) The original changes in 'sys/security/mac_grantbylabel/mac_grantbylabel.c' were removed as MAC/grantbylabel has not been MFCed. --- sys/security/mac/mac_internal.h | 7 ------- sys/security/mac/mac_policy.h | 15 +++++++++++++++ sys/security/mac_biba/mac_biba.c | 2 -- sys/security/mac_bsdextended/mac_bsdextended.c | 2 -- sys/security/mac_ifoff/mac_ifoff.c | 2 -- sys/security/mac_lomac/mac_lomac.c | 2 -- sys/security/mac_mls/mac_mls.c | 2 -- sys/security/mac_ntpd/mac_ntpd.c | 2 -- sys/security/mac_partition/mac_partition.c | 2 -- sys/security/mac_portacl/mac_portacl.c | 2 -- sys/security/mac_priority/mac_priority.c | 2 -- sys/security/mac_seeotheruids/mac_seeotheruids.c | 2 -- sys/security/mac_stub/mac_stub.c | 2 -- sys/security/mac_test/mac_test.c | 2 -- sys/security/mac_veriexec/mac_veriexec.c | 2 -- 15 files changed, 15 insertions(+), 33 deletions(-) diff --git a/sys/security/mac/mac_internal.h b/sys/security/mac/mac_internal.h index 4b2be98b4e03..c35504e04ea9 100644 --- a/sys/security/mac/mac_internal.h +++ b/sys/security/mac/mac_internal.h @@ -56,13 +56,6 @@ #include #include -/* - * MAC Framework sysctl namespace. - */ -#ifdef SYSCTL_DECL -SYSCTL_DECL(_security_mac); -#endif /* SYSCTL_DECL */ - /* * MAC Framework SDT DTrace probe namespace, macros for declaring entry * point probes, macros for invoking them. diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h index 3c8eec69f17e..89239c0869c3 100644 --- a/sys/security/mac/mac_policy.h +++ b/sys/security/mac/mac_policy.h @@ -1034,4 +1034,19 @@ int mac_policy_modevent(module_t mod, int type, void *data); intptr_t mac_label_get(struct label *l, int slot); void mac_label_set(struct label *l, int slot, intptr_t v); +/* + * Common MAC Framework's sysctl and jail parameters' sysctl nodes' declarations. + * + * Headers and normally have to be included before + * this header as style(9) hints to. If they weren't, just forego the + * corresponding declarations, assuming they are not needed. + */ +#ifdef SYSCTL_DECL +SYSCTL_DECL(_security_mac); +#endif + +#ifdef SYSCTL_JAIL_PARAM_DECL +SYSCTL_JAIL_PARAM_DECL(mac); +#endif + #endif /* !_SECURITY_MAC_MAC_POLICY_H_ */ diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 2d0df254f94c..8b683dc380eb 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -88,8 +88,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, biba, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_biba policy controls"); diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c index 95efc537735a..8a6549214380 100644 --- a/sys/security/mac_bsdextended/mac_bsdextended.c +++ b/sys/security/mac_bsdextended/mac_bsdextended.c @@ -68,8 +68,6 @@ static struct mtx ugidfw_mtx; -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD extended BSD MAC policy controls"); diff --git a/sys/security/mac_ifoff/mac_ifoff.c b/sys/security/mac_ifoff/mac_ifoff.c index b5a65f4765b2..97fc306990ee 100644 --- a/sys/security/mac_ifoff/mac_ifoff.c +++ b/sys/security/mac_ifoff/mac_ifoff.c @@ -58,8 +58,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, ifoff, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_ifoff policy controls"); diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index 761214db07e4..d878f9a7b965 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -89,8 +89,6 @@ struct mac_lomac_proc { struct mtx mtx; }; -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, lomac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_lomac policy controls"); diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c index 4c87b4c7f5ce..3cdf438ea6b9 100644 --- a/sys/security/mac_mls/mac_mls.c +++ b/sys/security/mac_mls/mac_mls.c @@ -89,8 +89,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, mls, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_mls policy controls"); diff --git a/sys/security/mac_ntpd/mac_ntpd.c b/sys/security/mac_ntpd/mac_ntpd.c index 3125bc057be8..1aeaeb032bb8 100644 --- a/sys/security/mac_ntpd/mac_ntpd.c +++ b/sys/security/mac_ntpd/mac_ntpd.c @@ -34,8 +34,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, ntpd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_ntpd policy controls"); diff --git a/sys/security/mac_partition/mac_partition.c b/sys/security/mac_partition/mac_partition.c index 2cff042cb33a..2f0189b79ace 100644 --- a/sys/security/mac_partition/mac_partition.c +++ b/sys/security/mac_partition/mac_partition.c @@ -61,8 +61,6 @@ #include #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, partition, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_partition policy controls"); diff --git a/sys/security/mac_portacl/mac_portacl.c b/sys/security/mac_portacl/mac_portacl.c index 184ec4b4738c..b3a5e06c0e2a 100644 --- a/sys/security/mac_portacl/mac_portacl.c +++ b/sys/security/mac_portacl/mac_portacl.c @@ -79,8 +79,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, portacl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_portacl policy controls"); diff --git a/sys/security/mac_priority/mac_priority.c b/sys/security/mac_priority/mac_priority.c index f460e5195cb9..1e5bfb5386cb 100644 --- a/sys/security/mac_priority/mac_priority.c +++ b/sys/security/mac_priority/mac_priority.c @@ -35,8 +35,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, priority, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_priority policy controls"); diff --git a/sys/security/mac_seeotheruids/mac_seeotheruids.c b/sys/security/mac_seeotheruids/mac_seeotheruids.c index 1677b092daad..9cd2e0f3c0fc 100644 --- a/sys/security/mac_seeotheruids/mac_seeotheruids.c +++ b/sys/security/mac_seeotheruids/mac_seeotheruids.c @@ -59,8 +59,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, seeotheruids, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_seeotheruids policy controls"); diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c index 1014aff07980..8406392443bf 100644 --- a/sys/security/mac_stub/mac_stub.c +++ b/sys/security/mac_stub/mac_stub.c @@ -85,8 +85,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, stub, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_stub policy controls"); diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c index ff7990162e56..dca14d033b66 100644 --- a/sys/security/mac_test/mac_test.c +++ b/sys/security/mac_test/mac_test.c @@ -76,8 +76,6 @@ #include -SYSCTL_DECL(_security_mac); - static SYSCTL_NODE(_security_mac, OID_AUTO, test, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_test policy controls"); diff --git a/sys/security/mac_veriexec/mac_veriexec.c b/sys/security/mac_veriexec/mac_veriexec.c index caba5dfe9d51..11046b160ad4 100644 --- a/sys/security/mac_veriexec/mac_veriexec.c +++ b/sys/security/mac_veriexec/mac_veriexec.c @@ -73,8 +73,6 @@ static int sysctl_mac_veriexec_state(SYSCTL_HANDLER_ARGS); static int sysctl_mac_veriexec_db(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_security_mac); - SYSCTL_NODE(_security_mac, OID_AUTO, veriexec, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "MAC/veriexec policy controls"); From nobody Fri Jan 17 12:27:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrv0s37z5kvZL; Fri, 17 Jan 2025 12:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrt3FQyz3Tpq; Fri, 17 Jan 2025 12:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Swgouq3xRhZBvQqHkvaqAXuheaChNefX47wwmO+6Rvc=; b=fQZYln1eTKz/xkjbx+HfOHabUzHsOLLOcXON/4AZwCoRjlftUPEQjjX81rgHeiLWixp0/9 2PDjI321koLxLc7jW3Xw26VgPWdx6ERs3uXt7Y4kCbZ1Vrc3FWKAI8hK19iDpGtaZZyYkx KNkSqdErT9qvxTSgqF4D8fvJ9N1oqFa8O4S6MnXC50/aAaW9Nx4F1FCOeJhFsmURugU4Bz 7pc/xsFHHdU9SZtvdLDJ6Ncw1pnnt0gd8a1qWeSjELmFx6Hyx+HbAGbVoN7Bz2ndohcHwf e8ZCfxXrwAdi/ErJbN8HSBDbCSKGvB6gSzNsRqCD8I28Z+h1B88jc1zYoUyofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Swgouq3xRhZBvQqHkvaqAXuheaChNefX47wwmO+6Rvc=; b=OtNXNvbSh5c/rSB/jAxNjcqbVW/KPIJRq07Jka33ugDsiwYNrtSSUbB+dUfaUaXA3cBnui bECdI/6ElIJquGG2CYTfYrorPynZvoNl7PuF3cRi0H8tijkPeOQ0Bdk0bLzuzGlzAOj5Up NurdoY+POgleQiUMhFOxjdSjbPRvRAORxCv7FMXsZQDtDnIv9c2F/2S5pyr/7qhuj/1Sww C+ChyEqNpMQ+cBBJx4ceClDKYm20J8yNOB5z0nk22H+W1AKuAq/bmjeilTcl8UAm/XBgOG Q0P1mxhVOaAww7sasuJeF7uMx9gkjmBgBKm0Eler+C2MbVB04wld5qPm9aJFAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116830; a=rsa-sha256; cv=none; b=TKVTnVQBFnrXyDnrGyYHdFU24JlzLUU6CVHcIiEmkvhE3lRzO7cp/h5jb9oU04pafmPI9g egTyx0kWQfhxOzIBWHaCvHkGnbHqurXaiXx/IJO4JQ+SFCKaknlLzKI+EeQC+2TyodPONQ 9KIFQ+xwmRxa7cW9oeLi1ZFWB/fRcYNtR8EwzWjoo1DRDk7oqQESQEJ+JoeCHAsvksHyKe UIANJr3bnuFJac4qS3uD8MJwuRQs5ZTSUynALjfr4lMIJdVHd4FT8K423qxIsI9Pa5LsTa ynmgIFiCrXWCYW1ZxOvQGy61T72q8z1LZ7i9RZ9cUd49ZASM05BTXVZPYaonFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrt2pS1z2lw; Fri, 17 Jan 2025 12:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRA7e052330; Fri, 17 Jan 2025 12:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRAJ5052327; Fri, 17 Jan 2025 12:27:10 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:10 GMT Message-Id: <202501171227.50HCRAJ5052327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0c0cd622f279 - stable/13 - mountd(8): parsecred(): Remove "duplicate compression" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c0cd622f2797214e76d19bd45bbbfaa4dd21cf4 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0c0cd622f2797214e76d19bd45bbbfaa4dd21cf4 commit 0c0cd622f2797214e76d19bd45bbbfaa4dd21cf4 Author: Olivier Certner AuthorDate: 2024-09-26 17:00:26 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:51 +0000 mountd(8): parsecred(): Remove "duplicate compression" No functional change (intended). This code dates back to 4.4BSD, became wrong after some getgrouplist() (nssswitch-related) change in 2007, was fixed only in 2020 and since then underwent cosmetic changes. It is likely that in fact it never served any useful purpose in FreeBSD, except perhaps at the very beginning. It's most probably not the case today: NFS credentials are normally only used to check for file accesses, whose group is checked against all groups of a credentials indiscriminately (except for the real GID). Consequently, having a single duplicate, which the code would actually remove only if in the first supplementary group slot, doesn't change behavior. Moreover, we are going to regain one slot in a subsequent commit. Discussed with: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46920 (cherry picked from commit f2d2318fafbb16c8a7773fe20c724c986f424fa2) --- usr.sbin/mountd/mountd.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 47bb5758ee1e..ebd88d3fdd66 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3569,7 +3569,6 @@ static void parsecred(char *namelist, struct expcred *cr) { char *name; - int inpos; char *names; struct passwd *pw; struct group *gr; @@ -3611,23 +3610,12 @@ parsecred(char *namelist, struct expcred *cr) ngroups = NGROUPS_MAX + 1; } - /* - * Compress out duplicate. - */ - if (ngroups > 1 && groups[0] == groups[1]) { - ngroups--; - inpos = 2; - } else { - inpos = 1; - } if (ngroups > NGROUPS_MAX) ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) cr->cr_groups = malloc(ngroups * sizeof(gid_t)); cr->cr_ngroups = ngroups; - cr->cr_groups[0] = groups[0]; - memcpy(&cr->cr_groups[1], &groups[inpos], (ngroups - 1) * - sizeof(gid_t)); + memcpy(cr->cr_groups, groups, ngroups * sizeof(gid_t)); return; } /* From nobody Fri Jan 17 12:27:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrr2gCNz5kvqx; Fri, 17 Jan 2025 12:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrr1qY8z3Tgx; Fri, 17 Jan 2025 12:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uqBpZSA1rr5FZYP96LjNL8tN+nKXVKVjFi+pXCmapWA=; b=PABaQQAkswNQQOf7l2URNCRmfAqG1zXOVK8dSNfPJ02D799Mp1UgDvpZUyZbti5Ex6eCqh pIpMfBkYwvj0MYd/Q93UVv1r94fX5zEzQrKnlEb+nxeAuvMd/tcSg8zeBlIRT9GjK0zVBI +0rLMvYSUAh/Eh+mdsTwwreOmc8JO3it1pu1akjXBvMwFz16I+PhSCtspSa9UB46d2vgKH wGHT8ESLJk9Q56RsdvB5eZI4xumwJPQn/LclrwE43RVnvpcm17TxqMCwMnIAQuKZNdUcQz +9MQEzGlID0eOmufi4+ByL6uVRwvJ/qTy4mZfLNxEqq6OayckTpjIzkwcEJRmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uqBpZSA1rr5FZYP96LjNL8tN+nKXVKVjFi+pXCmapWA=; b=dI2TY/2bQmbIcHNg7QOR0lJx7Kpg/sE8QlsDcxCpm0zgrUcUZamSJbeh36VkJA0KSfHFOY 9NER5GR2GoTfwXRJUhuo5fh1Gh1mNPjNoJ7JZ2yJB/3M2NmQlwUrgXK5su2F22uBNht63q X1s2JZH9oASx3vb3td4r5ZUfPuozX0dGcQ0RVJAYmvP/aore96YD/ZmmqriK3vlP8CgWRk nhRY9qIpJQK59E0VQW1UIQF4TJ8Xl2OgLnSdGAVpHLAoXc4y0G5wiMGCVZG49xYFTNLdn7 yR4AkLo/HGBnCdfKJ8qVstdZKOq1RxvijoI7G3AzX8Qky7r5UI4aRdOi7NsJgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116828; a=rsa-sha256; cv=none; b=NJ/9PJSvuP2cRLL1O0STlgc41b9A77jNqKWRNOB3iDnozcmDOiz1S0YI/6IpCU2PfVOPoM Vv6sGfOVR3wGUBSLMnWJsMa+ZAhYjFsyeV/F0uo1klmE4be4zIt2AVVETn54uj8ONfXHcV isnQPF2v15YWAY+NZP8ruQ4h6DK13VCEouV90okq+qD9o71Dw4ZivGc9Z1nHkYBCQBZCFD A2rFTElvJ8xZsdDqEwEzI2OBptrPg9easuvv3FTxe1l0UGFH8NoK6dmHoG5jN5Kng/USIX ASr3tbOuQ0mStr1Daw7y/gsGnVmGpHjdayPDblE8H0dlN79ykJhMNMHjSogGtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrr109pz33N; Fri, 17 Jan 2025 12:27:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR8PC052237; Fri, 17 Jan 2025 12:27:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR8CJ052234; Fri, 17 Jan 2025 12:27:08 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:08 GMT Message-Id: <202501171227.50HCR8CJ052234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 5f7586197e84 - stable/13 - cred: crget(): Compute initial 'cr_agroups' with nitems() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f7586197e84caa22013bbdb7bef1f5c5ac6c4ca Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5f7586197e84caa22013bbdb7bef1f5c5ac6c4ca commit 5f7586197e84caa22013bbdb7bef1f5c5ac6c4ca Author: Olivier Certner AuthorDate: 2024-07-16 20:32:19 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:51 +0000 cred: crget(): Compute initial 'cr_agroups' with nitems() No functional change (intended). Reviewed by: mhorne, emaste Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46910 (cherry picked from commit f5b46856918cc6cc3ea49e3ab95163d318563ece) --- sys/kern/kern_prot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 2dc5ecd00175..5fe587bdc421 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2117,8 +2117,7 @@ crget(void) mac_cred_init(cr); #endif cr->cr_groups = cr->cr_smallgroups; - cr->cr_agroups = - sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]); + cr->cr_agroups = nitems(cr->cr_smallgroups); return (cr); } From nobody Fri Jan 17 12:27:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrt3pVFz5kvr0; Fri, 17 Jan 2025 12:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrs2WF4z3TdR; Fri, 17 Jan 2025 12:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mo2Rw8zj0iIBbIhYarPukP/9DS8IZp4NAydr2HojLyA=; b=iq4LnWACqjDTseo7qLa8O9eg29kGnaruiQrbJQe0H00PymtLtqESSkzFIAv+69hgYdJO51 vaaDLsTfaN+pWQQFyoNvEgGxveheo8AQSauGyGZulQMTWf/zFzKAJpa480aHMKcQqDi7jV e2OBzPi6P/elee5xKTD8vh8wOkOWPypKSnlj8BgA3A2ZeVYZyRRnOdaJiJD4WkpyRmC2wE XmoL/V1BiD1vX63LAexthkayZdiXQUdyDeoJMM9z9j/WnPfxGM789AOnma/xzg3Wp4nA96 Hb5GclQKZI3P69K0wogfE+1LNY0NSCkRMB8dhL38xKjtXDSBXBxM92+93hlbRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mo2Rw8zj0iIBbIhYarPukP/9DS8IZp4NAydr2HojLyA=; b=YcHyOFbrnksPpj7ePQ8nfFdC6YQ6BCKjiRNerYibFj7Lb+JIRhkiNfov+HivunpMAEsvoH bGcWG/oOOz+emgMa5BjSbzSeBCku8xoRhwDUNxH8Ypb8Y2IESEP/Nka36y22oHOw9QjN0M kevjCnhYu8j0YSAL86PEzclFxLdg3X1EVjWtkKJBccnw3BpYLrx7Jhb4TZmDv//g8MLwU+ U+NB2wZdl3IXvTBSAfqNoK/o3RsYH3zLroS+lOhPYs3oHej9qHKw5QtAckjEDcLgwgUx2V CHYS/4KFzx5zqb1PhFWPnrSOxKdWDu8oQjKoWcygt6VC0JX2PAxXRDUnaBmt7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116829; a=rsa-sha256; cv=none; b=lnoKuYB/dUNC1Nn+4Sy7c/U0v5Lo//GzeITjXkt3JRm9yvKn+6UDeudMbqry1WeXK21vpL rkhUqRaS1rbNubBv0GlKZOZWg2HbUKPRev3eQAWD5VBA9h21EjzyK7+io3HDpdotGy6lYc D1oVGsjTB/2M0bZF8SvBH/1iplCmvLpe8S5mS7taVT/5F3MqqsLR1fIt69Ic1XNbrJn/jy OabQSyEJFfcR41UoMCRvYWRmNUUjtuBR2RfYIRLTQIH69nyfPkrRfnFqzDhyZV49HU2Z62 1ZuUyPCBKgyjjyB27OeI/q+5OR47BQwz+fzfHklyViNGqdva1lgSge+1CBxrRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrs24P1z2p4; Fri, 17 Jan 2025 12:27:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCR96i052286; Fri, 17 Jan 2025 12:27:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCR9H5052283; Fri, 17 Jan 2025 12:27:09 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:09 GMT Message-Id: <202501171227.50HCR9H5052283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 73c073d99157 - stable/13 - mountd(8): parsecred(): uid:gid:... loop: Simplify a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 73c073d99157d587a5c50b61d63264882dec6ac5 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=73c073d99157d587a5c50b61d63264882dec6ac5 commit 73c073d99157d587a5c50b61d63264882dec6ac5 Author: Olivier Certner AuthorDate: 2024-09-26 16:16:16 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:51 +0000 mountd(8): parsecred(): uid:gid:... loop: Simplify a bit No functional change intended. Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46919 (cherry picked from commit ae22a4bb7437019e34fc593e101a6ac14c9d7959) --- usr.sbin/mountd/mountd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 492d7a5e3647..47bb5758ee1e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3643,7 +3643,9 @@ parsecred(char *namelist, struct expcred *cr) cr->cr_uid = name_ul; } cr->cr_ngroups = 0; - while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) { + while (names != NULL && *names != '\0') { + gid_t group; + name = strsep_quote(&names, ":"); name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) { @@ -3651,13 +3653,16 @@ parsecred(char *namelist, struct expcred *cr) syslog(LOG_ERR, "unknown group: %s", name); continue; } - groups[cr->cr_ngroups++] = gr->gr_gid; + group = gr->gr_gid; } else { - groups[cr->cr_ngroups++] = name_ul; + group = name_ul; + } + if (cr->cr_ngroups == NGROUPS_MAX) { + syslog(LOG_ERR, "too many groups"); + break; } + groups[cr->cr_ngroups++] = group; } - if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX) - syslog(LOG_ERR, "too many groups"); if (cr->cr_ngroups > SMALLNGROUPS) cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); From nobody Fri Jan 17 12:27:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrx2qWhz5kvr9; Fri, 17 Jan 2025 12:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrw5DD5z3Tdt; Fri, 17 Jan 2025 12:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kyq10yL/S77eivPu9v+urYg0oawq7rJbcwzZlU1OtDI=; b=Q9wMiA4kY9AKFPZ7Y6mbrtMTkX/rB6b9MfJ7dpw3b2mloDTpcQhH6sjmpZ688h/mzVrKXD XZQHCPw5rQCH46ZhyBI1yiGigwItHrxDGnNTVhl0kK7valA77JesRUApkWNFnWmfYyzLA8 6qKpS2FHjTSzbmnyW3yNOGbJB+8pekYwKOX3mDMifoFRqARWDxfpOSpIK4VKBZh4OkOzFj 6+x+ThyPcsBNX6wB5uoPiWfENLff9EBgAeIWPwvXHhxjUud1lSX0q9c3D9w24uVAhJboOk 2iOskzSGlH/fax4G/R05WiXMj3CzSzT0UPAURDIir9k3+osbO5f3tcDfu87R5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kyq10yL/S77eivPu9v+urYg0oawq7rJbcwzZlU1OtDI=; b=gZV0KRqZXMHzDvpEovZRLQez6jJ9falONSWVbMxa/8IKqwPUHo84w3uucbgCtJcpLavQz3 TKqsooW+90c3zIwlenq93WnCINh2dHN+fQQL/cOKVXqKuEd/AHbqIoaDfStjfRRWS7QurZ SKDKT8GyDKJ73kgOU3fM0YqBz/3mx5SDmyY9jnPE0OhFL39YQj1tOkolToYLPzt3PU77I3 oPb+NLOXOjHhoAjbHsUqwupvYSbgsgtPNk5a+lUExVzF2bdj3vgGcRo73dfQYop8IS1hcJ rXMTg23NV8r5iZQ87gfRV78aqQk7p+ZSvMfFI5VPm9KR5yiWZ7ABGD8CLEE5zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116832; a=rsa-sha256; cv=none; b=FdVSySmfLkBh8d8SeWKy/lL7IjvmSrfJ6CqIL+sez6vYfHUIbKS44dcUsTwudZ3MIiX/fO Vw3Aabsps4AsNgEI0nWQ6DZ2v53D/9Dv0qBWBHw3KIC3zmAGxoqk/VodIMlKn2+Ny8HACB CdH1dgLOkQ796q0MlNIUFhpUHnO5WcSYFsLxO0rTJ2C/eEJTdsaZBlUvXefsYlnWTTZQ+6 n+m6CWh3p3vPykd/i7Ngu6v8qdHbJDjTF6zRZy53FSjL7bhyxN1K6FQyfZ4Q43XP7EY3Tc xqE/lv36LIL+cEae82HotOt8bevI6gVyHVjXe20Eooi0d2K4OtOybaFxFayy4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrw4mrZz3Bc; Fri, 17 Jan 2025 12:27: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 50HCRCjW052432; Fri, 17 Jan 2025 12:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRCh1052429; Fri, 17 Jan 2025 12:27:12 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:12 GMT Message-Id: <202501171227.50HCRCh1052429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 70d657d7380c - stable/13 - exports(5): -maproot, -mapall: Explain the fallback on no group List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 70d657d7380c1c5c056508d4c122e691ed104042 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=70d657d7380c1c5c056508d4c122e691ed104042 commit 70d657d7380c1c5c056508d4c122e691ed104042 Author: Olivier Certner AuthorDate: 2024-10-08 09:34:44 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:51 +0000 exports(5): -maproot, -mapall: Explain the fallback on no group Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47012 (cherry picked from commit 2ef608de90629df37c29043afc638f8ff99ecfc4) --- usr.sbin/mountd/exports.5 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index d135184cd464..dfbc16c28639 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -27,7 +27,7 @@ .\" .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" -.Dd April 7, 2024 +.Dd October 08, 2024 .Dt EXPORTS 5 .Os .Sh NAME @@ -142,8 +142,23 @@ The user string may be quoted, or use backslash escaping. The colon separated list is used to specify the precise credential to be used for remote access by root. The elements of the list may be either names or numbers. -Note that user: should be used to distinguish a credential containing -no groups from a complete credential for that user. +Note that +.Cm user: +should be used to specify a credential containing no groups, in which case the +established credential will use +.Ql nogroup , +else 65533 +.Pq Dv GID_NOGROUP , +as the fallback group +.Pq a credential object must have at least one group internally . +Using just +.Cm user +.Pq without colon at end +falls into the +.Sm off +.Fl maproot Li = Sy user +.Sm on +case described above. The group names may be quoted, or use backslash escaping. .Pp .Sm off From nobody Fri Jan 17 12:27:11 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrw3CKPz5kvcw; Fri, 17 Jan 2025 12:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrv43Fsz3Tdj; Fri, 17 Jan 2025 12:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s1IKdbU2DukJqO4vJk6k6vUaho0PKbamOf79Mnb/mUs=; b=oQhcbHY54cv5NUdsCs9lH0HFpeRDZYFiev1SkSA0CPkQsSmw93LyPkOQ8Q1sfWmI8k+MxG L/vL3W2SESjjHvWha0l2UY4xd7EWK4rlOmauh/q+O0oPltbazpBixRNZssQ7U3gwkpGauF DaKyG2btZfRb990QqksuPSChrDbe0Qx4SnCOgqhzTMeOPpKRBCFyjAXsDdZFwV2rBLyCtp AvRj23mqHF3qcFJBd4SoNLfMBnOozq9JCWfpTfoVPrHrlDgqts2P+6XcB7urbXtB+/kzgb 2JiCKqdgB+V/tYh+4zWqAfZK5PXGPcMZ9/vb/a6NTJzZj339VTnkfpaBsLdhvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s1IKdbU2DukJqO4vJk6k6vUaho0PKbamOf79Mnb/mUs=; b=lHCUgz0hu5gSC0iVuPl8pEar75dGo1PaCBuoBPsuoKPn8LaErP1mzDlCU7hHplopvegF9Z 7RypMwaJ13nZOMPDOMYQobbg9hcZuJ3YHTe2sDKAUhV7Wv+oSuDgOQGLsZ2QAuw2+bAgdL x/8ZPUKDBIciXB16HDTZuvgvTDI2VJy7u5JRfYh4KE0Yf6O1a1+TkX9SDVZ5eH7w5yvTK5 gRGmGRer/kHwDAGaCzSL+G0k2XtC+0OcTFGdXBFmS6YO4RUuZSIvyUfLTTSZoIHEdGFZ6T PLPv25YMmtckvB0VmsxerkxIEIpkAKlZC/fNynIlUimnpjkK6s9r6sXm28S3Mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116831; a=rsa-sha256; cv=none; b=pUSgrAUbOiNQ6U3ObJWuGfHGvIb3FJobN2CHSdD0mzht150/PgqhSyhtlKFppqBHpk+b6j qOu9Jxr1BqG06uB+KcGJ+RVdNkt40Rm9Q2Veq4OuapChMyfLxz3ENVRw0BvoDB3HfV0mr8 RgkHfSSO1ySdxK0mhCxgT1iF5iWQgd+XVH80+blJ5MiGCGiUmBhr6qLWS3+GUjDq6TBTKW Ax2X3LavPAX3P/trqUm5h6G/J4yN6m1yUqBOLB7ThLs/YXPPT2838uN20vzJC10BYAxlbx 5q06s+exIS3Hwvagna/P/mu8YZVgQrKoeosFg9utWiwGY88sbqtzB/4ErQJWTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrv3cGnz2lx; Fri, 17 Jan 2025 12:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRBgx052378; Fri, 17 Jan 2025 12:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRB1m052375; Fri, 17 Jan 2025 12:27:11 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:11 GMT Message-Id: <202501171227.50HCRB1m052375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 29a0511b184d - stable/13 - mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 29a0511b184d6d59c6b0fee72dd6f48e6b8d0081 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=29a0511b184d6d59c6b0fee72dd6f48e6b8d0081 commit 29a0511b184d6d59c6b0fee72dd6f48e6b8d0081 Author: Olivier Certner AuthorDate: 2024-10-08 09:21:17 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:51 +0000 mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP In the 'uid:gid:gid:...' case (for '-maproot' or '-mapall'), if no GID is specified at all (i.e., input is of the form 'uid:', with the colon at the end), mountd(8) would pass credentials with an empty array of groups to the kernel. For security reasons, we have put in place a kernel fallback a while ago, which is to use the single group GID_NOGROUP (see commits cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have at least one group") and 5169d4307eb9 ("nfs: Fallback to GID_NOGROUP on no groups")). Here, as we are in userland, we first try to find the GID number corresponding to "nogroup", and only then fall back to GID_NOGROUP, as nfsuserd(8) does. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47011 (cherry picked from commit bdc259ef382f76b1821d4356049d5b856c42901a) --- usr.sbin/mountd/mountd.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index ebd88d3fdd66..6b3a9af1c279 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -273,6 +273,8 @@ static int xdr_mlist(XDR *, caddr_t); static void terminate(int); static void cp_cred(struct expcred *, struct expcred *); +static gid_t nogroup(); + #define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) static struct exportlisthead *exphead = NULL; static struct exportlisthead *oldexphead = NULL; @@ -1577,7 +1579,7 @@ get_exportlist_one(int passno) anon.cr_groups = anon.cr_smallgrps; anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; - anon.cr_groups[0] = GID_NOGROUP; + anon.cr_groups[0] = nogroup(); exflags = MNT_EXPORTED; got_nondir = 0; opt_flags = 0; @@ -3582,7 +3584,7 @@ parsecred(char *namelist, struct expcred *cr) */ cr->cr_groups = cr->cr_smallgrps; cr->cr_uid = UID_NOBODY; - cr->cr_groups[0] = GID_NOGROUP; + cr->cr_groups[0] = nogroup(); cr->cr_ngroups = 1; /* * Get the user's password table entry. @@ -3651,6 +3653,11 @@ parsecred(char *namelist, struct expcred *cr) } groups[cr->cr_ngroups++] = group; } + if (cr->cr_ngroups == 0) { + /* cr->cr_groups[0] filled at start with nogroup(). */ + cr->cr_ngroups = 1; + return; + } if (cr->cr_ngroups > SMALLNGROUPS) cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); @@ -3989,3 +3996,19 @@ cp_cred(struct expcred *outcr, struct expcred *incr) memcpy(outcr->cr_groups, incr->cr_groups, incr->cr_ngroups * sizeof(gid_t)); } + +static gid_t +nogroup() +{ + static gid_t nogroup = 0; /* 0 means unset. */ + + if (nogroup == 0) { + const struct group *gr = getgrnam("nogroup"); + + if (gr != NULL && gr->gr_gid != 0) + nogroup = gr->gr_gid; + else + nogroup = GID_NOGROUP; + } + return (nogroup); +} From nobody Fri Jan 17 12:27:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs028Qkz5kvZR; Fri, 17 Jan 2025 12:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrz0DCNz3Tqd; Fri, 17 Jan 2025 12:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mV7uVmyLtIdWz0P2r+L05aFjU1hKU6Vecye/P1kAwEQ=; b=Bj0rEf9wQ9eAn2Pn0HuqUrdIhqqBEOMnBadQL4Kwv6T5Cu5zzf67p+AKfYaoo7XMwtx5a0 WDuuROdhFl0aNo/m28lpK21KoI3XcO0uUgkPbr1YEmFaZgS6jwvgrCDBdk8dBF8deE+nUC cQszPH5bIe/bwzo6BvuD4Uq0ypS/dw8XMX8V5NMvwF5x1NPz70OJz1hxWHbCT1zEmL/QAo kPoEy4R8f+xr1PWBvNuMmdLT1dvhtGMPiAKToyLIyf41oce9SJGXeNOcMqqVcI0aSv0/mU r8KlIhQCO+uHped2Ha8UOjbvzlJIl1hT32zCQ3G+3yXZJHvA5K3g0akejK5sDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mV7uVmyLtIdWz0P2r+L05aFjU1hKU6Vecye/P1kAwEQ=; b=sA1FxleLaJa3LIuPnXCxKtietpsxAQdda3Axy4O77CYTrIZKKmCYuUVzlPFaT/8DTVR5+f la9aXr3XcVgv2FDUHPkZj54J1gSFjlb7E91fT29DB4N/sAAffvrr0BjYmYm/FU+5OvkpYO +oFhjamImSLhZwqMhHAL4sa6IK9u+FkFdjoxiwtiHmOj4c+XoMx0QyS+B+ENrw/cbMZ7MP CLBYdYisJNzKJX81XGqWSM6QytaHTnUNTIsBw44PSzsj4RgDyTDqmMfC2Kb9ekFYhOUq5f Af7r/wKhDE30iWpQ6/C5CXz59fvjitwuHbnOcXDg/Mi5t9SXGXxzaCvPOAfQiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116835; a=rsa-sha256; cv=none; b=bjhP7ufIUa4j6ST2mPj3o8Im52DDTQJ0xJZW93HQOseuaz6d43YUSyhJ5vfuuFhthzllmF hY+9j2nT9++uPGuY8Pa/fw6JI57+8+Ao+UXilbLhx1QtawdS7EB+9eMHna34Yo2MwLC4vE MGtJn7xKeSMruSxRRXW3FIz9nMY7u+ImtDnhNHmgv8bkKB/5ydW7C9mGtM2O+u4BrnGDQe yG2Z1tSpSmnfI3C5sUFmJIkfWaccwA6CWlG6majQRbFRYrveHN7StQR37ZTJ5YzumGNyy9 IiR07vaXHyjDD/VVhrFZ6l+YnQE0kCCU/yCaEo23oHUTnaHNGT13dM+tEtquKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJry6x6kz2m0; Fri, 17 Jan 2025 12:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCREN0052543; Fri, 17 Jan 2025 12:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCREoZ052540; Fri, 17 Jan 2025 12:27:14 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:14 GMT Message-Id: <202501171227.50HCREoZ052540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 46f0ef933d28 - stable/13 - nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 46f0ef933d288c151accc95cc4717cf6abada83d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=46f0ef933d288c151accc95cc4717cf6abada83d commit 46f0ef933d288c151accc95cc4717cf6abada83d Author: Olivier Certner AuthorDate: 2024-10-08 09:39:08 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:52 +0000 nmount(2), NFS: Accept 'ngroups_max + 1' groups in "export" credentials There is no technical reason to limit that to NGROUPS_MAX, which is off by one and just our minimum maximum value. Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47013 (cherry picked from commit 84337218786b13f0ebfa834d28de41dce02bc937) --- sys/kern/vfs_mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 8cee38c7ec2e..11e3ddc2c64c 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1339,7 +1339,7 @@ vfs_domount_update( bcopy(bufp, &export, len); grps = NULL; if (export.ex_ngroups > 0) { - if (export.ex_ngroups <= NGROUPS_MAX) { + if (export.ex_ngroups <= ngroups_max + 1) { grps = malloc(export.ex_ngroups * sizeof(gid_t), M_TEMP, M_WAITOK); export_error = copyin(export.ex_groups, From nobody Fri Jan 17 12:27:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJrz4lHWz5kvJ9; Fri, 17 Jan 2025 12:27:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJrx65gbz3TkR; Fri, 17 Jan 2025 12:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TKOBb7l9pKsfGdzmnIS4GT63VeG381NdU+xTaP5RoZA=; b=K0wtlZyy+nb8F7+Znfv/C2uV+s0amjKhl+FSxGO2v0Nvl5qE7kOS3osFR9h2Wcds/IJ4xL o4aB7TomaLq7C3fO7aUZNLEAxRlECbXcyEYlsC7VuaF2W4zNIyWNKNXl+RMT55nJk/xPzo OmeMVauBmJo7XFsr100i5jE9o4wU6zOdifXCohPQm8DDYFf90iY5yFkPJQfaJ20e7ijo0p DhYr3T9/hThVu0FRPsJeXVttAlz06GUxc+Ba3oNbNQ7f+e3ADHf8N7J7l+i5d0DslMWC8n T2uBxclkt4d3c6kSb0gwSHAfFRD6GWtjgTHJRRNenSiPlY5py5YYXT2+6eNaEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TKOBb7l9pKsfGdzmnIS4GT63VeG381NdU+xTaP5RoZA=; b=kY+t0kR/TJGHZVvrhmrha+7bbGZe3+ZztJgGtaXROz2XaR1PpPMoqjSZrXU2fb8qBc0c4P 6cLn0iqsSaLrTr7jwgKcCJTWJTn9Pya6hjU+1sWaMuamwkBsRp4Q5xtGHS34p7JA2LmCoL a0ikXJx3CcrFa4aBoAtMhu84lB/cc4ZHWjuzuTEgJ51ivOgspzR/mMj2M+pAD7D0zmZisk /T44vfYw82fivYW6GYtxCcm2DRKR/BrAFNWF5ANDqyE3WVHj9x58ciisl0bHaqOP9tXXNd 7jZGswodwSCFitxw/KAqRQrxs/iCGkZZ7P97TflQdOsVpfbkPGBdOD2ZYTinjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116833; a=rsa-sha256; cv=none; b=YulamOYlUSVLDYUKiDIxiTOYa9bZSTNmR06UB6+sJVe8VwCPrWoGqKN0IGyjVftWQvsobk c9lSYb0UCNHaI7WT4FgVMMOJRP7paJ77d8s4/bu6XopCA1jH3ZhWq/urXUtseWqHAGSgCk tYc5CmwOT7ie0aHJHanwwhoMr3+iCw6FnTb9/xDMDea53vtrOGuBjib5r+8AmJOQXQD0sg a/leXOj0sJbU74SLQcxBCD6kO82S9xlqMUIO33iHXNwQGtFQIp2u7QTj9H8EadBxW6IDQW W16dBvv8P3sDwVquAi8Y5++aTPjGj35qvgC0+gxnOyy09WjKwgNlq8JfAgo8iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJrx5j96z2ly; Fri, 17 Jan 2025 12:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRD6O052486; Fri, 17 Jan 2025 12:27:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRDUq052483; Fri, 17 Jan 2025 12:27:13 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:13 GMT Message-Id: <202501171227.50HCRDUq052483@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 043e259e41d3 - stable/13 - mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 043e259e41d3f17f3c9415db0135ad82cb532f1f Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=043e259e41d3f17f3c9415db0135ad82cb532f1f commit 043e259e41d3f17f3c9415db0135ad82cb532f1f Author: Olivier Certner AuthorDate: 2024-10-03 14:49:40 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:52 +0000 mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1 Lift this unnecessary limitation. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46921 (cherry picked from commit 7f7f3b6cafac6e8ab993a14386e34991224f86f3) --- usr.sbin/mountd/mountd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 6b3a9af1c279..cdf42de2fcdb 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3612,8 +3612,6 @@ parsecred(char *namelist, struct expcred *cr) ngroups = NGROUPS_MAX + 1; } - if (ngroups > NGROUPS_MAX) - ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) cr->cr_groups = malloc(ngroups * sizeof(gid_t)); cr->cr_ngroups = ngroups; @@ -3647,7 +3645,7 @@ parsecred(char *namelist, struct expcred *cr) } else { group = name_ul; } - if (cr->cr_ngroups == NGROUPS_MAX) { + if (cr->cr_ngroups == NGROUPS_MAX + 1) { syslog(LOG_ERR, "too many groups"); break; } From nobody Fri Jan 17 12:27:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs237s0z5kvlt; Fri, 17 Jan 2025 12:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs13nfZz3TnZ; Fri, 17 Jan 2025 12:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiqnB/CQaafCTWFbtIGs6fWPEk7eZdPL0H2w7hbAyNc=; b=ZWglmzVWWiAX27SzuXBuL3sXoWH5S8vxcx6iaAfkJbuQ7Db3+1lmAaffsvHcLSwC+uqDSU 3bAYtRASuz6HDiGz87RI88ut3AZSEhS/fzwboclG2tUJsKCKwVxgZVu1+gULjjpAuNnt9x Qy6v/jAcPfBi1XDWKWBP+cTyxVmu91+TErdkUjZIZ8ZnVoYbfnjkB4UWBxwPuJfWDjdyxV WZ6yAEvAUks1Dr6knDS3cBPCZcP7h+fJaXHHE15nqcSOCMqcwMtBEGVTZeOL04fviqHQm5 8rext7qL/Z3kJ3XSeaSDRvFcw3WPNIeWCdtV61CZSklzLVAcxvq2ISabUtFcmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hiqnB/CQaafCTWFbtIGs6fWPEk7eZdPL0H2w7hbAyNc=; b=pWZDZcCox18kUR6bNgzNe4zXVjLCakb52YdWU9JI9OpMhTRXBmx4v1VAKC+zU13JxbJLeL fUdSx2aJ5EqbsaK7mCeJjk7OY+CMPpnF1WiB2Lq64psxImHBQFe8NAECEdCrAG0lmU5Z8q jhCy0wKI41p8nSPSUJemoFtpGR+uwbR8N+yUA1XdrE+US39+uN3abV2m2+utRmxxSxhaJY jMTYJRqyK7T0Y0YfF+tFFcdqRk5IqaL5bkT2GJx9IUVJXbRw8MbLoFa8pAB9MUWARDsGY3 0on7kY23nfguRAnCHmpm0CTZZJ1DdEMfYdy5XlaY8oF6LAPj5HY9CsWxMNfB1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116837; a=rsa-sha256; cv=none; b=tPJmN8xhN0GFGzSL8+fC9G9mimRfqLYUX4H73IrvMNi3Dy68GZ0TTSXKw1FByZRuzupQME osJGeppXZi4xUyc+L0rscld/Noyfrc6wJROBP7/h0aAOoNRKf8zcnQ4XyoAXj4/SdiseFT SOrqzIQyuW7bxZHhzJ8AQkku55agF8mL0VfMY68o7U9E9ztoOdWx27oZV6JbjqjgfsAtA+ UmSXENgBf7odBU8BlGffCzlbJrFFaPrSEE3OLlWilGHxu3CXQt+XWD2V2ZKHG2tgpbyH0P kTf+vJ8ydW+TRbfmyCnvmLnujTHm9ownzg5OKLH++IJcG6x+L6HgzdYbtWyPKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs11rfwz2p5; Fri, 17 Jan 2025 12:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRHSX052638; Fri, 17 Jan 2025 12:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRHGY052635; Fri, 17 Jan 2025 12:27:17 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:17 GMT Message-Id: <202501171227.50HCRHGY052635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f8e47b137a80 - stable/13 - mountd(8): parsecred(): Re-order operations for clarity List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8e47b137a80ca4c3e8d932d1b4b8f89c3d02942 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e47b137a80ca4c3e8d932d1b4b8f89c3d02942 commit f8e47b137a80ca4c3e8d932d1b4b8f89c3d02942 Author: Olivier Certner AuthorDate: 2024-10-08 10:06:55 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:52 +0000 mountd(8): parsecred(): Re-order operations for clarity No functional change (intended). Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47015 (cherry picked from commit a20d50245f280be404cb8e3b5c9d570ded9594b9) --- usr.sbin/mountd/mountd.c | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 8ddedbb16f24..ac1a652f349e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3573,21 +3573,14 @@ parsecred(char *namelist, struct expcred *cr) char *name; char *names; struct passwd *pw; - struct group *gr; gid_t groups[NGROUPS_MAX + 1]; int ngroups; unsigned long name_ul; char *end = NULL; /* - * Set up the unprivileged user. - */ - cr->cr_groups = cr->cr_smallgrps; - cr->cr_uid = UID_NOBODY; - cr->cr_groups[0] = nogroup(); - cr->cr_ngroups = 1; - /* - * Get the user's password table entry. + * Parse the user and if possible get its password table entry. + * 'cr_uid' is filled when exiting this block. */ names = namelist; name = strsep_quote(&names, ":"); @@ -3596,13 +3589,25 @@ parsecred(char *namelist, struct expcred *cr) pw = getpwnam(name); else pw = getpwuid((uid_t)name_ul); + if (pw != NULL) { + cr->cr_uid = pw->pw_uid; + } else if (*end != '\0' || end == name) { + syslog(LOG_ERR, "unknown user: %s", name); + cr->cr_uid = UID_NOBODY; + goto nogroup; + } else { + cr->cr_uid = name_ul; + } + /* - * Credentials specified as those of a user. + * Credentials specified as those of a user (i.e., use its associated + * groups as specified in the password database). */ if (names == NULL) { if (pw == NULL) { - syslog(LOG_ERR, "unknown user: %s", name); - return; + syslog(LOG_ERR, "no passwd entry for user: %s, " + "can't determine groups", name); + goto nogroup; } cr->cr_uid = pw->pw_uid; ngroups = NGROUPS_MAX + 1; @@ -3617,20 +3622,14 @@ parsecred(char *namelist, struct expcred *cr) memcpy(cr->cr_groups, groups, ngroups * sizeof(gid_t)); return; } + /* - * Explicit credential specified as a colon separated list: + * Explicit credentials specified as a colon separated list: * uid:gid:gid:... */ - if (pw != NULL) { - cr->cr_uid = pw->pw_uid; - } else if (*end != '\0' || end == name) { - syslog(LOG_ERR, "unknown user: %s", name); - return; - } else { - cr->cr_uid = name_ul; - } cr->cr_ngroups = 0; while (names != NULL && *names != '\0') { + const struct group *gr; gid_t group; name = strsep_quote(&names, ":"); @@ -3650,14 +3649,16 @@ parsecred(char *namelist, struct expcred *cr) } groups[cr->cr_ngroups++] = group; } - if (cr->cr_ngroups == 0) { - /* cr->cr_groups[0] filled at start with nogroup(). */ - cr->cr_ngroups = 1; - return; - } + if (cr->cr_ngroups == 0) + goto nogroup; if (cr->cr_ngroups > SMALLNGROUPS) cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); + return; + +nogroup: + cr->cr_ngroups = 1; + cr->cr_groups[0] = nogroup(); } #define STRSIZ (MNTNAMLEN+MNTPATHLEN+50) From nobody Fri Jan 17 12:27:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs11qFnz5kvd4; Fri, 17 Jan 2025 12:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs01Hw6z3Tkk; Fri, 17 Jan 2025 12:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntAFb1vNsJtgeCw92CIIqmKVX3vl33ZGQwZ7iPMAyL8=; b=SQqEsP3F0cS1A5KyNKDQGHo8tEEZTOkr0c6uCI1U2Jhm3m6/i7di+PqwF8UyAxWBU8k50w TxmyzQqNww25cnuW7VjvfELn1SNb+QurZ5iNCjIi4ptjBGvGNDq9dm5BNnSMzv+WMlsZ0S B+o/nMnQiyzOoyYi/5fiOUgOLJTJ4D7AmGjIWOENQ1jbSRpyRW4K0gJMXRPsyiAWm8jFvQ njxSidM+0mziyYXcjHjrz5aGsAJLkv+V9kqW5UX9MfWqoiY3B+A0fR34O10CGC9Fi1YAgS E7K9i3NO2HEXY19uMklxZFCeL5pkMw6/qZVSq0pMNc+7CEzw3S4WTyd7HW/O7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntAFb1vNsJtgeCw92CIIqmKVX3vl33ZGQwZ7iPMAyL8=; b=hCmARPdTupe/vShSO0OU1H3v6qI+WZdmD3m2bY3e0SSFRnY7tCTgGNkFUbK2yvJYjU3mk1 150Y4s3lCsx/nNRgbLtY+CJMBIq7lUv8wxA/L2YjUygTc+F98r3zqzKY11MgZF3Sar5bX3 gMEgImP8VBIZ8YqUyfxROtA3wh2YQv7GYn1lfbsvTH1YnHiEvmbseHWTjwTI6gCz0S9Uym jwLaN2+YnDJ1JXlvhIM27+2keaezq7VlXOxi05CkyVHIks2zhOgB/gDuS7r5EZwOYtHq0u mCiS2quGE2dMSFM1W8rUke4LRa1s3D5roE6aPDxdn2vmELLGI8zySdwTrtOVmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116836; a=rsa-sha256; cv=none; b=ruR3abxHu+WuCVKZIVTYco4yitORXUZT/P3f1RzIdO+Zpe+TK9Y0mKOetarkm4aWdeSJAf MzJ6zSJHRFyrWG2YRyd4c6JJR8B5+7jwkTBr1z2lYLooeqAXWwDjllhRDk3oQkJJPGAzH1 CIWco45zj+UVEwCXyAzhLMNDdOrDMZOWK9vInp/SEdPQhG7axAKH7ebV7as0segoLr9Nju AYLuIgJX2j9k8BRoKVo3OfcvKr1dSuisrrsfjLOgblF6AAoM+EwlKql+METMRuk1vg4SgG 90Hg2/8/40a9z3/eb3oOBNjBsSIeb9nT6CHALBzzArc7NSPtcc+LfQtFERWh8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs00sJ3z3Bd; Fri, 17 Jan 2025 12:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRGhd052591; Fri, 17 Jan 2025 12:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRGkn052588; Fri, 17 Jan 2025 12:27:16 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:16 GMT Message-Id: <202501171227.50HCRGkn052588@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 111c7322f71e - stable/13 - mountd(8): parsecred(): Remove comment on non-existent bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 111c7322f71ec653447fd79382ae75c6b11605cd Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=111c7322f71ec653447fd79382ae75c6b11605cd commit 111c7322f71ec653447fd79382ae75c6b11605cd Author: Olivier Certner AuthorDate: 2024-10-08 09:44:06 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:52 +0000 mountd(8): parsecred(): Remove comment on non-existent bug 'name' can never be NULL, as it is equal to 'names' and 'namelist', which was passed by do_cred() only if the actual parameter wasn't NULL. Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47014 (cherry picked from commit 0b011b5cddb5b17cf5b8f50ff580f3eb4abaeeef) --- usr.sbin/mountd/mountd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index cdf42de2fcdb..8ddedbb16f24 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3591,7 +3591,6 @@ parsecred(char *namelist, struct expcred *cr) */ names = namelist; name = strsep_quote(&names, ":"); - /* Bug? name could be NULL here */ name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) pw = getpwnam(name); From nobody Fri Jan 17 12:27:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs33FmCz5kvjf; Fri, 17 Jan 2025 12:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs25djZz3Tff; Fri, 17 Jan 2025 12:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vs2RC0xE7gXnPage1aB23aGBWcPz6FDhAZAMn18JCNM=; b=rvffruuE9FSlsiC43azLfChVNv/VTKgxvkOimYHH1lJ8i9ap6Z9onHY3udhaMS4s30GjSZ 9ivMn5tPA4jGyPKQrN/fGeSKIGClsG9xsaArrKGobfCiJY8oKQ8qlPhddODsA0bZI8Z7G1 YAJM5HHg+FhlUrmKZcJ0W43hhoBUOmbOiP8oZnjY6excWVMcoPHVNay8UbM/27brfcbpQj fomXeWmJO4rq47RGTqpyxC/tqWkATK1MKChg4GwQfioOG1d/sXY0RrfpukoQfr8Rd3GJ1w BA5GnC0HxmJNLpt1WzpSP8nQs9myvzZqr3Ap5PlolNEnHUErC+u7NALeZYBIcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vs2RC0xE7gXnPage1aB23aGBWcPz6FDhAZAMn18JCNM=; b=CsFVn1ATUk/hV/d/kqM8a3c1QFannlq2h4ItPH7yQNred/5Aw4I0uQYZ/427aZi9+/9yr4 nIDRmlKZnctzw4YqwCFndusa47gdFHdyji1gMs/1XJ2Oq5BO1tdXsruFookFh4JSAM2ac3 AI632xtK68rk6StFH+TgGsOLJUQjn1yRZWk0WvVNpL80jca91vnQNvhOVTFjAFpkJKByMO EpWNgRfWf7zCFqB3yNB4zWtjqxlkKsiml6CtooeDEU76tRNjU76OfFm8ke0EgFo1ixqqiS FV+FGp9DMIBbJwf+oatcFiv4CNf8EmTdnca+nd3iDQSOhL7XdcgC94snaGiAyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116838; a=rsa-sha256; cv=none; b=b7xzalf8aznHeyNEZybtouzFJUZgLP6PgLHEya+TKDUzA1pGc5/wsO7v3SbTuJ9EMiR6/a OwU/nWBoyDlicjaSSIa02XpKYuTG+Lfl6bOQr5rKvl9w4SeiyXFDDR3g9YwboGFHpXuSBw Y5nSJVlhcMmfo/rvyWcKOoZqJalYNH377BEvCbprSlGIyl4TYVdfQqAs9DkePD5Ri8TxVj LHKNgX3B1kpeeLAiZXZ32idUhQiz7QcwjeUILzeXiR3YDIpvp78Ww0oc7eRtxy8HaYH2is 9Lm24nYTEYhoxsaxTZOjxBJGyIqwT0+qLTgMfXns0iA9kwzndSrpDDuPvGpyNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs22Yq3z2rZ; Fri, 17 Jan 2025 12:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRI76052695; Fri, 17 Jan 2025 12:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRISn052692; Fri, 17 Jan 2025 12:27:18 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:18 GMT Message-Id: <202501171227.50HCRISn052692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 927d7d57793a - stable/13 - mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 927d7d57793abc0acab85aaf453e42775755793f Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=927d7d57793abc0acab85aaf453e42775755793f commit 927d7d57793abc0acab85aaf453e42775755793f Author: Olivier Certner AuthorDate: 2024-10-08 12:30:03 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:53 +0000 mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups NGROUPS_MAX is just the minimum maximum of the number of allowed supplementary groups. The actual runtime value may be greater. Allow more groups to be specified accordingly (now that, a few commits ago, nmount(2) has been changed similarly). To this end, we just allocate once and for all a static array called 'tmp_groups' big enough to hold {NGROUPS_MAX} + 1 groups (the maximum number of supplementary groups plus the effective GID, which we store in a variable named 'tngroups_max' to avoid confusion with the kernel variable 'ngroups_max' holding only the maximum number of *supplementary* groups) in main() and use this temporary space in get_exportlist_one(), do_opt() and parsecred(). Doing so in passing fixes a (benign) memory leak in case "-maproot" and/or "-mapall" were specified multiple times and the first option comprised more than SMALLNGROUPS. parsecred() does not use 'cr_smallgrps' anymore, but we have kept 'cr_smallgrps'/SMALLNGROUPS as 'struct expcred' is also included in 'struct exportlist' and 'struct grouplist', and thus this preallocated field still results in an optimization for the common case of small number of groups (although its real impact is probably negligible and arguably was not worth the trouble). While here, in do_mount(), remove some unnecessary groups array allocation and copying. Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47016 (cherry picked from commit e87848a8150ed75da29d99a7d0c0bba6cc5129b8) --- usr.sbin/mountd/mountd.c | 69 +++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index ac1a652f349e..251b36e39d8b 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -70,6 +70,7 @@ static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; #include +#include #include #include #include @@ -254,7 +255,7 @@ static void huphandler(int sig); static int makemask(struct sockaddr_storage *ssp, int bitlen); static void mntsrv(struct svc_req *, SVCXPRT *); static void nextfield(char **, char **); -static void out_of_mem(void); +static void out_of_mem(void) __dead2; static void parsecred(char *, struct expcred *); static int parsesec(char *, struct exportlist *); static int put_exlist(struct dirlist *, XDR *, struct dirlist *, @@ -308,6 +309,11 @@ static int has_publicfh = 0; static int has_set_publicfh = 0; static struct pidfh *pfh = NULL; + +/* Temporary storage for credentials' groups. */ +static long tngroups_max; +static gid_t *tmp_groups = NULL; + /* Bits for opt_flags above */ #define OP_MAPROOT 0x01 #define OP_MAPALL 0x02 @@ -440,6 +446,18 @@ main(int argc, char **argv) warn("cannot open or create pidfile"); } + openlog("mountd", LOG_PID, LOG_DAEMON); + + /* How many groups do we support? */ + tngroups_max = sysconf(_SC_NGROUPS_MAX); + if (tngroups_max == -1) + tngroups_max = NGROUPS_MAX; + /* Add space for the effective GID. */ + ++tngroups_max; + tmp_groups = malloc(tngroups_max); + if (tmp_groups == NULL) + out_of_mem(); + s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (s < 0) have_v6 = 0; @@ -533,7 +551,6 @@ main(int argc, char **argv) exnames = argv; else exnames = exnames_default; - openlog("mountd", LOG_PID, LOG_DAEMON); if (debug) warnx("getting export list"); get_exportlist(0); @@ -1562,7 +1579,6 @@ get_exportlist_one(int passno) uint64_t exflags; v4root_phase = 0; - anon.cr_groups = NULL; dirhead = (struct dirlist *)NULL; while (get_line()) { if (debug) @@ -1576,9 +1592,9 @@ get_exportlist_one(int passno) * Set defaults. */ has_host = FALSE; - anon.cr_groups = anon.cr_smallgrps; anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; + anon.cr_groups = tmp_groups; anon.cr_groups[0] = nogroup(); exflags = MNT_EXPORTED; got_nondir = 0; @@ -1877,10 +1893,6 @@ nextline: free_dir(dirhead); dirhead = (struct dirlist *)NULL; } - if (anon.cr_groups != anon.cr_smallgrps) { - free(anon.cr_groups); - anon.cr_groups = NULL; - } } } @@ -3146,11 +3158,11 @@ do_mount(struct exportlist *ep, struct grouplist *grp, uint64_t exflags, eap->ex_flags = exflags; eap->ex_uid = anoncrp->cr_uid; eap->ex_ngroups = anoncrp->cr_ngroups; - if (eap->ex_ngroups > 0) { - eap->ex_groups = malloc(eap->ex_ngroups * sizeof(gid_t)); - memcpy(eap->ex_groups, anoncrp->cr_groups, eap->ex_ngroups * - sizeof(gid_t)); - } + /* + * Use the memory pointed to by 'anoncrp', as it outlives 'eap' which is + * local to this function. + */ + eap->ex_groups = anoncrp->cr_groups; LOGDEBUG("do_mount exflags=0x%jx", (uintmax_t)exflags); eap->ex_indexfile = ep->ex_indexfile; if (grp->gr_type == GT_HOST) @@ -3340,7 +3352,6 @@ skip: if (cp) *cp = savedc; error_exit: - free(eap->ex_groups); /* free strings allocated by strdup() in getmntopts.c */ if (iov != NULL) { free(iov[0].iov_base); /* fstype */ @@ -3568,21 +3579,19 @@ get_line(void) * Parse a description of a credential. */ static void -parsecred(char *namelist, struct expcred *cr) +parsecred(char *names, struct expcred *cr) { char *name; - char *names; struct passwd *pw; - gid_t groups[NGROUPS_MAX + 1]; - int ngroups; unsigned long name_ul; char *end = NULL; + assert(cr->cr_groups == tmp_groups); + /* * Parse the user and if possible get its password table entry. * 'cr_uid' is filled when exiting this block. */ - names = namelist; name = strsep_quote(&names, ":"); name_ul = strtoul(name, &end, 10); if (*end != '\0' || end == name) @@ -3609,17 +3618,13 @@ parsecred(char *namelist, struct expcred *cr) "can't determine groups", name); goto nogroup; } - cr->cr_uid = pw->pw_uid; - ngroups = NGROUPS_MAX + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { + + cr->cr_ngroups = tngroups_max; + if (getgrouplist(pw->pw_name, pw->pw_gid, + cr->cr_groups, &cr->cr_ngroups) != 0) { syslog(LOG_ERR, "too many groups"); - ngroups = NGROUPS_MAX + 1; + cr->cr_ngroups = tngroups_max; } - - if (ngroups > SMALLNGROUPS) - cr->cr_groups = malloc(ngroups * sizeof(gid_t)); - cr->cr_ngroups = ngroups; - memcpy(cr->cr_groups, groups, ngroups * sizeof(gid_t)); return; } @@ -3643,17 +3648,14 @@ parsecred(char *namelist, struct expcred *cr) } else { group = name_ul; } - if (cr->cr_ngroups == NGROUPS_MAX + 1) { + if (cr->cr_ngroups == tngroups_max) { syslog(LOG_ERR, "too many groups"); break; } - groups[cr->cr_ngroups++] = group; + cr->cr_groups[cr->cr_ngroups++] = group; } if (cr->cr_ngroups == 0) goto nogroup; - if (cr->cr_ngroups > SMALLNGROUPS) - cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); - memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); return; nogroup: @@ -3975,6 +3977,7 @@ huphandler(int sig __unused) static void terminate(int sig __unused) { + free(tmp_groups); pidfile_remove(pfh); rpcb_unset(MOUNTPROG, MOUNTVERS, NULL); rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL); From nobody Fri Jan 17 12:27:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs35rbfz5kvjl; Fri, 17 Jan 2025 12:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs33zvLz3Tp0; Fri, 17 Jan 2025 12:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pVXQHPSortiMipANORbhnC8WdUTvMWM/IXrKWrkj+Ew=; b=YlPGj1FUgAuRxpuhORN6CPNO6VV5n9NyC5wr7lxJLnMugEQbxEPuP4IQbK51wUj9egRqkN CyhWc3RV+NUPoO0uwh9s/A5mAmD1G/rMCtv2L/idu3FBuzWP27a3jTOvuduBd0jSNuskog Kv30U3FMfvFdkLyc1BdX2TVtjKgjgf33O3lPESiJO43LL/tn5Y6mTr8GZ0D4vGUactoO0Q 3GOuTjnfv/S8oF68m5nejHRiLa6pMqFIefuiL5iRI5HWeia6QhVWTbd8ATHI7HeptNLfYf ChdCZs6c/KVdQOcTFUaJfIZticvJ3rt89iaBMBgbQF3UrVXgOdHjPtwpEoad5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pVXQHPSortiMipANORbhnC8WdUTvMWM/IXrKWrkj+Ew=; b=DrcF6msRkAdEzb/DLfvzZmYNqz3iuOQgY6KGiTWVQWyK/ruuwFWC1/sxSkSyGvf0x6/U8d owN6bBWcegQVVUPGJ5hxciCCCM08Wh7ThRycKV36T2CRaXuuqiJuycM6rYoi59Ll+0M2KB Y9MQMZ8s+lzDb7dsH55btAvRUvTGqno3Ie2trjitgLSQvGM33tC7T+sf5NIA+f/CPIlOFk M1AjYAxP0q0mRjMLp6J37c4wry6lrMExewL4BdwJe1gvkNeF4m5KCs2a4KZi2k1Uymrxpi OWP28x0V9GewAsNdtxH8ULSXIdSeKLvUYi2yDnuJOiKjHIq848Mzm5oVh/og7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116839; a=rsa-sha256; cv=none; b=dxBX7nDu8nTBg5V387PYBKl1tD7T8YSF2ewGdTgBHH+ftI5jYEJ7RoB5B9qN6MccE8Y8sl tF2CE6U86S1Cv6WVX2hfPoYZqpWg0/jJ06EJY+g62hZ9pRyaYgXTTkE21ktHiEgqc1a9Kq 4V+NKzcFRig1oNnJBWCpcQl8YWv6+XLm/2A51h8a0XzXDZJ048xetK5U7nzwpTFBuZuGpf Y8PgQw1rhvojoxWNSZBtCjuFeCMc35QmycylPfRPvfUiagKUEecHNeI7SkYhh5w/UqFrGM SpMNNjZcbyCWr7N/E1qXk+ylLTkvQLzlYveK1YEbw6gMgtiVkr7hdblHns3YIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs33SgHz2rb; Fri, 17 Jan 2025 12:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRJ8g052737; Fri, 17 Jan 2025 12:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRJGO052734; Fri, 17 Jan 2025 12:27:19 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:19 GMT Message-Id: <202501171227.50HCRJGO052734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 5c09fafd8398 - stable/13 - cred: proc_set_cred(): Remove obsolete comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c09fafd8398181a149c0457d56c5b7c2518b370 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5c09fafd8398181a149c0457d56c5b7c2518b370 commit 5c09fafd8398181a149c0457d56c5b7c2518b370 Author: Olivier Certner AuthorDate: 2024-08-01 10:19:52 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:53 +0000 cred: proc_set_cred(): Remove obsolete comments These have been obsoleted since they were first written (in commit "cred: add proc_set_cred helper", daf63fd2f9a8d040, r280130) by some subsequent commits ("proc: refactor clearing credentials into proc_unset_cred", 5a90435ccfed8e1e, r361448; "cred: distribute reference count per thread", 1724c563e62fa800, r361993). No functional change. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46922 (cherry picked from commit 07c9edac7bcd75095724ff3c91d0aeec792a4f26) --- sys/kern/kern_prot.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 5fe587bdc421..755bdca4fd73 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2278,11 +2278,6 @@ cru2xt(struct thread *td, struct xucred *xcr) * Change process credentials. * Callers are responsible for providing the reference for passed credentials * and for freeing old ones. - * - * Process has to be locked except when it does not have credentials (as it - * should not be visible just yet) or when newcred is NULL (as this can be - * only used when the process is about to be freed, at which point it should - * not be visible anymore). */ void proc_set_cred(struct proc *p, struct ucred *newcred) From nobody Fri Jan 17 12:27:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs52FGRz5kvJJ; Fri, 17 Jan 2025 12:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs45QyCz3Tfv; Fri, 17 Jan 2025 12:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e3YvK8nBllJRUhU3PJ53XsZBWmn7wcsZ8pSi+FMCV3g=; b=BUW0BLE8xAdGtyuM+suvitJzTTCDPbQOBAc+x6furYFDgTm+/YhnMXkpA50PPfjRCf96+v XqCPzurubvrzLETl4taZ03e+0fwH4nPTt5YB/G7i/JdQN3OzmXJHQz0QgrDJbnRCVIr02h egnMTr+CH/kH/lr+iNskP8TeXxuOJkBeHREr6JojnWxEx2zhE63AYIGYSwMKBC8pIcvZYZ wdx4zMrBOFTaxbOkb1vSOXRoSuzLc4j/2t5fO5W8cMZLmt/JCyMzbW+0xCsaaGi+7Lrxg3 4MUqXLjuvREyYmY7kOAmzjb62ojdoMo26MsuqLd8vdqhat37PhXzmOIM5eYy6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e3YvK8nBllJRUhU3PJ53XsZBWmn7wcsZ8pSi+FMCV3g=; b=Cd1zh7/S+QMNFhYt6nT4/ma8kSSOigmJ258xS+rcC8eHyg3/ZVwo7nyZrf/LCSJCCCBDYH 8DA4xkVHk44FfAZ8/wIxLcMgAI20F8S8S+14SJ7Ag6BYe9w3o0+GazwEFDgUSuPnB3kPaA Px6/N3lx7hrMlmEWYKZXpilTcwNPtorbnRdOWTEdmPDYI66V8glDdupOCpsdt/kAiM2V2N x/OWHiV/eB4V2Utl6S8thAB4+wmgAmC02h84yCYHvaLOLaQseJnVBR/MvFqkpzU0zQ2k7D 5llmmw+94/2gXJieZQhQlwu/+1tS9MRj5JyBIymu03wHCa/zN6DeUpOzckwtow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116840; a=rsa-sha256; cv=none; b=o7OVPw/f+KUEAK20BaUKc3jaGf2Ag0rr8flPcpSxmYdesmv2a6JhYLz7cczEGzVxjjIuVS lLLwJmFWJ/RMvRxitR2sVHn5i3MxJJfZ+m/ASjYehI2GfjzB8c6RB6AgzW0Qk1j6wEyAYe zjpfLhJAykeBerHoBWQq2jld2k52skYBLaJSm7F4uQ99V/Tdzvck3dqNWnKxKiuhVywO8Q bK1zB7m4Y6HvtofK2ICQdTx8iTgmCBtgcRBV1dZ+RBzMYa39gPEQTD4F9PYIJbk2e69rRz a/VvbYQqT4vUrctrMjpTPWPKu9rjO8L/dnGvE5G19ho9Q92XFTIOVA144QUBXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs44kQxz2rc; Fri, 17 Jan 2025 12:27: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 50HCRKHc052788; Fri, 17 Jan 2025 12:27:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRKVg052785; Fri, 17 Jan 2025 12:27:20 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:20 GMT Message-Id: <202501171227.50HCRKVg052785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f872814e2d7a - stable/13 - cred: proc_set_cred(), proc_unset_cred(): Update user's process count List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f872814e2d7a8841411569fc707b028463c7656b Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f872814e2d7a8841411569fc707b028463c7656b commit f872814e2d7a8841411569fc707b028463c7656b Author: Olivier Certner AuthorDate: 2024-08-02 15:57:51 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:53 +0000 cred: proc_set_cred(), proc_unset_cred(): Update user's process count As a process really changes credentials at the moment proc_set_cred() or proc_unset_cred() is called, these functions are the proper locations to perform the update of the new and old real users' process count (using chgproccnt()). Before this change, change_ruid() instead would perform that update, although it operates only on a passed credential which is a priori not tied to the calling process (or not to any process at all). This was arguably a flaw of commit b1fc0ec1a7a49ded, r77183, based on its commit message, and in particular the portion "(...) In each case, the call now acts on a credential not a process (...)". Fixing this makes using change_ruid() more natural when building candidate credentials that in the end are not applied to a process, e.g., because of some intervening privilege check. Also, it removes a hack around this unwanted process count change in unionfs. We also introduce the new proc_set_cred_enforce_proc_lim() so that callers can respect the per-user process limit, and will use it for the upcoming setcred(). We plan to change all callers of proc_set_cred() to call this new function instead at some point. In the meantime, both proc_set_cred() and the new function will coexist. As detailed in some proc_set_cred_enforce_proc_lim()'s comment, checking against the process limit is currently flawed as the kernel doesn't really maintain the number of processes per UID (besides RLIMIT_NPROC, this in fact also applies to RLIMIT_KQUEUES, RLIMIT_NPTS, RLIMIT_SBSIZE and RLIMIT_SWAP). The applied limit is currently that of the old real UID. Root (or a process granted with PRIV_PROC_LIMIT) is not subject to this limit. Approved by: markj (mentor) Fixes: b1fc0ec1a7a49ded MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46923 (cherry picked from commit d2be7ed63affd8af5fe6203002b7cc3cbe7f7891) Additional changes for this MFC: 1. was added as an include in , as some of its types are necessary whether the header is included by the kernel or userland. Some later -CURRENT commits added it, but are not planned to be MFCed (mac_do(4) series, which doesn't exist in stable/13). 2. A number of files in 'lib/libprocstat' that include (indirectly) with _KERNEL defined were patched to include beforehand, so that 'bool', which is part of the new signature for proc_set_cred*(), is defined when is processed ( does not define it when _KERNEL is defined). --- lib/libprocstat/msdosfs.c | 1 + lib/libprocstat/smbfs.c | 2 ++ lib/libprocstat/udf.c | 2 ++ lib/libprocstat/zfs.c | 1 + sys/fs/unionfs/union_subr.c | 6 ---- sys/kern/kern_exit.c | 10 ++---- sys/kern/kern_fork.c | 2 +- sys/kern/kern_prot.c | 81 +++++++++++++++++++++++++++++++++++---------- sys/sys/ucred.h | 6 ++-- 9 files changed, 78 insertions(+), 33 deletions(-) diff --git a/lib/libprocstat/msdosfs.c b/lib/libprocstat/msdosfs.c index 2af34f856e50..7e73360757bc 100644 --- a/lib/libprocstat/msdosfs.c +++ b/lib/libprocstat/msdosfs.c @@ -35,6 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include #include #include diff --git a/lib/libprocstat/smbfs.c b/lib/libprocstat/smbfs.c index f705ccd207dd..854fd3eb986c 100644 --- a/lib/libprocstat/smbfs.c +++ b/lib/libprocstat/smbfs.c @@ -25,6 +25,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include + #include #include #include diff --git a/lib/libprocstat/udf.c b/lib/libprocstat/udf.c index 43e79c39a62d..dc6cadeeea6d 100644 --- a/lib/libprocstat/udf.c +++ b/lib/libprocstat/udf.c @@ -25,6 +25,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include + #include #include #include diff --git a/lib/libprocstat/zfs.c b/lib/libprocstat/zfs.c index 9ca43d6f6331..a84083a054db 100644 --- a/lib/libprocstat/zfs.c +++ b/lib/libprocstat/zfs.c @@ -25,6 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include #include #define _KERNEL diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 22c8ffe88bde..56c16fc9ed6e 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -775,11 +775,6 @@ unionfs_mkshadowdir(struct unionfs_mount *ump, struct vnode *udvp, /* Authority change to root */ rootinfo = uifind((uid_t)0); cred = crdup(cnp->cn_cred); - /* - * The calls to chgproccnt() are needed to compensate for change_ruid() - * calling chgproccnt(). - */ - chgproccnt(cred->cr_ruidinfo, 1, 0); change_euid(cred, rootinfo); change_ruid(cred, rootinfo); change_svuid(cred, (uid_t)0); @@ -831,7 +826,6 @@ unionfs_mkshadowdir_free_out: unionfs_mkshadowdir_abort: cnp->cn_cred = credbk; - chgproccnt(cred->cr_ruidinfo, -1, 0); crfree(cred); return (error); diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index bd820aae8197..64fef905daa4 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -976,11 +976,6 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) ruadd(&q->p_stats->p_cru, &q->p_crux, &p->p_ru, &p->p_rux); PROC_UNLOCK(q); - /* - * Decrement the count of procs running with this uid. - */ - (void)chgproccnt(p->p_ucred->cr_ruidinfo, -1, 0); - /* * Destroy resource accounting information associated with the process. */ @@ -994,9 +989,10 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options) racct_proc_exit(p); /* - * Free credentials, arguments, and sigacts. + * Free credentials, arguments, and sigacts, and decrement the count of + * processes running with this uid. */ - proc_unset_cred(p); + proc_unset_cred(p, true); pargs_drop(p->p_args); p->p_args = NULL; sigacts_free(p->p_sigacts); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 413453f9bf8f..29b3e5d8d682 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1087,7 +1087,7 @@ fail0: #endif racct_proc_exit(newproc); fail1: - proc_unset_cred(newproc); + proc_unset_cred(newproc, false); fail2: if (vm2 != NULL) vmspace_free(vm2); diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 755bdca4fd73..655ee776b6a7 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -564,7 +564,7 @@ sys_setuid(struct thread *td, struct setuid_args *uap) #endif { /* - * Set the real uid and transfer proc count to new user. + * Set the real uid. */ if (uid != oldcred->cr_ruid) { change_ruid(newcred, uip); @@ -590,6 +590,9 @@ sys_setuid(struct thread *td, struct setuid_args *uap) change_euid(newcred, uip); setsugid(p); } + /* + * This also transfers the proc count to the new user. + */ proc_set_cred(p, newcred); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); @@ -2276,31 +2279,76 @@ cru2xt(struct thread *td, struct xucred *xcr) /* * Change process credentials. + * * Callers are responsible for providing the reference for passed credentials - * and for freeing old ones. + * and for freeing old ones. Calls chgproccnt() to correctly account the + * current process to the proper real UID, if the latter has changed. Returns + * whether the operation was successful. Failure can happen only on + * 'enforce_proc_lim' being true and if no new process can be accounted to the + * new real UID because of the current limit (see the inner comment for more + * details) and the caller does not have privilege (PRIV_PROC_LIMIT) to override + * that. */ -void -proc_set_cred(struct proc *p, struct ucred *newcred) +static bool +_proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) { - struct ucred *cr; + struct ucred *const oldcred = p->p_ucred; - cr = p->p_ucred; - MPASS(cr != NULL); + MPASS(oldcred != NULL); PROC_LOCK_ASSERT(p, MA_OWNED); KASSERT(newcred->cr_users == 0, ("%s: users %d not 0 on cred %p", __func__, newcred->cr_users, newcred)); - mtx_lock(&cr->cr_mtx); - KASSERT(cr->cr_users > 0, ("%s: users %d not > 0 on cred %p", - __func__, cr->cr_users, cr)); - cr->cr_users--; - mtx_unlock(&cr->cr_mtx); + KASSERT(newcred->cr_ref == 1, ("%s: ref %ld not 1 on cred %p", + __func__, newcred->cr_ref, newcred)); + + if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) { + /* + * XXXOC: This check is flawed but nonetheless the best we can + * currently do as we don't really track limits per UID contrary + * to what we pretend in setrlimit(2). Until this is reworked, + * we just check here that the number of processes for our new + * real UID doesn't exceed this process' process number limit + * (which is meant to be associated with the current real UID). + */ + const int proccnt_changed = chgproccnt(newcred->cr_ruidinfo, 1, + enforce_proc_lim ? lim_cur_proc(p, RLIMIT_NPROC) : 0); + + if (!proccnt_changed) { + if (priv_check_cred(oldcred, PRIV_PROC_LIMIT) != 0) + return (false); + (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); + } + } + + mtx_lock(&oldcred->cr_mtx); + KASSERT(oldcred->cr_users > 0, ("%s: users %d not > 0 on cred %p", + __func__, oldcred->cr_users, oldcred)); + oldcred->cr_users--; + mtx_unlock(&oldcred->cr_mtx); p->p_ucred = newcred; newcred->cr_users = 1; PROC_UPDATE_COW(p); + if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) + (void)chgproccnt(oldcred->cr_ruidinfo, -1, 0); + return (true); +} + +void +proc_set_cred(struct proc *p, struct ucred *newcred) +{ + bool success = _proc_set_cred(p, newcred, false); + + MPASS(success); +} + +bool +proc_set_cred_enforce_proc_lim(struct proc *p, struct ucred *newcred) +{ + return (_proc_set_cred(p, newcred, true)); } void -proc_unset_cred(struct proc *p) +proc_unset_cred(struct proc *p, bool decrement_proc_count) { struct ucred *cr; @@ -2315,6 +2363,8 @@ proc_unset_cred(struct proc *p) KASSERT(cr->cr_ref > 0, ("%s: ref %d not > 0 on cred %p", __func__, cr->cr_ref, cr)); mtx_unlock(&cr->cr_mtx); + if (decrement_proc_count) + (void)chgproccnt(cr->cr_ruidinfo, -1, 0); crfree(cr); } @@ -2599,8 +2649,7 @@ change_egid(struct ucred *newcred, gid_t egid) /*- * Change a process's real uid. * Side effects: newcred->cr_ruid will be updated, newcred->cr_ruidinfo - * will be updated, and the old and new cr_ruidinfo proc - * counts will be updated. + * will be updated. * References: newcred must be an exclusive credential reference for the * duration of the call. */ @@ -2608,12 +2657,10 @@ void change_ruid(struct ucred *newcred, struct uidinfo *ruip) { - (void)chgproccnt(newcred->cr_ruidinfo, -1, 0); newcred->cr_ruid = ruip->ui_uid; uihold(ruip); uifree(newcred->cr_ruidinfo); newcred->cr_ruidinfo = ruip; - (void)chgproccnt(newcred->cr_ruidinfo, 1, 0); } /*- diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index f5e2757f7417..d8729b49c2dd 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -34,6 +34,7 @@ #ifndef _SYS_UCRED_H_ #define _SYS_UCRED_H_ +#include #if defined(_KERNEL) || defined(_WANT_UCRED) #include #include @@ -158,8 +159,9 @@ void crcopy(struct ucred *dest, struct ucred *src); struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); -void proc_set_cred(struct proc *p, struct ucred *cr); -void proc_unset_cred(struct proc *p); +void proc_set_cred(struct proc *p, struct ucred *newcred); +bool proc_set_cred_enforce_proc_lim(struct proc *p, struct ucred *newcred); +void proc_unset_cred(struct proc *p, bool decrement_proc_count); void crfree(struct ucred *cr); struct ucred *crcowsync(void); struct ucred *crget(void); From nobody Fri Jan 17 12:27:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs64mNBz5kvnq; Fri, 17 Jan 2025 12:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs56JN1z3TrR; Fri, 17 Jan 2025 12:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qfXWh90rgz9LTkyLEcGoly6dzsfyfyxaXYx+7SrtI/0=; b=v+JYxNwHsw9vdwLtTngPaEeDNU1U3dUdEBMcPiMfWyj4AaWa/hauBfhlutATmSuRedI67J wm9Ue9hKIPeROTsoRz9fZOEkdUxCxZxTkuWbquHHLBpUdGFPEMQ/R2G7dJ7eUdqfH5aS/A nc525dZF2ffDnHPvyAd+JM3qZfA3F4vvGf69Fbr35uALPKh7ilanMUT98c3jmDIG6DBPim a5HcJB/0K1mqc/1w0lU7DKMB+ms/2ePSj8eW5cH3st/7Rh6mIz9hFksZ5ZRY7r2dCL+F32 9p7raak0SpyjjUpfZ6+OMN9V/auIScxuPjA4M+pGj12hOyEX3N6Gj/o21bx9vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qfXWh90rgz9LTkyLEcGoly6dzsfyfyxaXYx+7SrtI/0=; b=RAzEEmZAcBzFx7H8t7DBoB6UMKhv71k0hXjmb+vyBgM3jsGxPhepOV7WRwk7m/o8mwDtNe snxL8QGzxFOxv6vj3bynx/z1p07YWlO4Fj/I2aJWh/rYhYZW29UD45SUfNNUkTEFv0vUby cllorTHfuSrxvekuwwuPT1I9/WmdelRRhmQ6NmGHXSax+QmPJsL/m/VxiqJLSqEkYcmU40 et4PMEUBaynid12uy6IAq8Gyut5yd2f1VflVnfbQEivvk4EmW5ubwkN+lQryUCZFT0HHYh s86AsvY5ltJ2E4021Qj25nLjrmWOfgq4L00U3VCUGW2liDN8mGFxhQTFRaffWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116841; a=rsa-sha256; cv=none; b=QLDWb0Ec5ZMc8Tfa83hMSK4CQXBu9ckR8BAginlq1NMQhNZhfyjck06ccWcRrJFYo8u2bp YQlAhGwQThxRunnwqGqKZOtqWWqRVAY9UgMkvaRawmULgJlRCjKaFbfb8VSnhTNboRivZ7 6O0kAya42hAEdDO7duZAqh7gPBLSDInwhvgQtPFLg5/Kn8235ZdGvYHavHx57UlESzKcTk RWC0tsNsQqvOkagQiaulH6d0CMqiZeJLpbUNK2EzlVFPQh8qafa2VVi6wcjdaZbD2Oueyb UIxBDGyeIRSw+inTzs35smNnCIj3rMo/hzEoBN0cG614F9QSGjyl6flFm3aRAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs55lFBz2Wl; Fri, 17 Jan 2025 12:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRLQj052833; Fri, 17 Jan 2025 12:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRLMu052830; Fri, 17 Jan 2025 12:27:21 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:21 GMT Message-Id: <202501171227.50HCRLMu052830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: afeec66ce393 - stable/13 - syscallsubr.h: Header inclusions: Explicit , sort List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: afeec66ce393f6d4e18907934db8f96821e37394 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=afeec66ce393f6d4e18907934db8f96821e37394 commit afeec66ce393f6d4e18907934db8f96821e37394 Author: Olivier Certner AuthorDate: 2024-12-02 15:06:29 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:53 +0000 syscallsubr.h: Header inclusions: Explicit , sort is currently brought in by other headers but some of its type definition are directly used in this header, so it should appear explicitly. It is necessary as lots of prototypes in there use types it defines ( wouldn't be enough). Additionally, and need constants from , so just include instead of . Sort header inclusions as per style(9). No functional change (intended). Approved by: markj (mentor) MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47881 (cherry picked from commit 8cdb0458e12e6fac577cfb2277e7e85d3c21fa09) --- sys/sys/syscallsubr.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index 78de8876e51b..736cd3019453 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -28,13 +28,14 @@ #ifndef _SYS_SYSCALLSUBR_H_ #define _SYS_SYSCALLSUBR_H_ -#include -#include -#include -#include +#include #include #include #include +#include +#include +#include +#include struct __wrusage; struct cpuset_copy_cb; From nobody Fri Jan 17 12:27:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs921Vxz5kvkK; Fri, 17 Jan 2025 12:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs81FBPz3V0R; Fri, 17 Jan 2025 12: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=1737116844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=91o2DM11o/a/g9bnk1tY/HvaNvH6SAOdf2jTwLKcaCU=; b=O18KoOC5MRa/Bs+SbtBc8JQTrUIzEGJ962hWw2mkntJX6n17fB1ZhARQ3wZkQVcHxBkefs bFjyUSjmJmXqXoXB1BdVMEiYJPAk9oUF1rgmsiDyYItjQlCF2vcAD5cdwq7KiPhwPSAwx+ vqlRHO3QZAtDXiLgqwrn6tGuYLZEBu6zb/7PjipsX328scYRTZcdfMQyOecc0WonIweJTU gEcdmmrttBs1AtV5PcnjeVq+ZFX1vy5XzkNegAj6sRadwEnsT8WRJ9TZn1IHIQR/JsnJW0 5C6HgzZTs9oTbr/aF5FLprVpjXmjUqoZ9dJM56o8zx7CP729i4FJGtZ9Kj4A5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=91o2DM11o/a/g9bnk1tY/HvaNvH6SAOdf2jTwLKcaCU=; b=TWj4QEKIJUD+XyoimKs2qHJQPAtjG92c0SqkoAQwILvVVueTHhghmaN0SCpKhDdQq75M7Y pJZt3bgWxf7Ka33RUjsHZ5w0P5xhyi+SX7YAdFLS1qnNY/hwAVU+Ilit14xkvwj/ZAfTRS JFRY5mwdjb4zfwPyczbAFBvCn9eDJoOT65QgrRM5H1QeDbFceGUyUOzjAa56I6Wh6qq9W3 7jqlZsqYCIreMzvoS9Rx+8ccusVIDYb3xbUyIavLw9dnQx7NP4dFcYxRpRM7uxx9vX77KL /19/3jXDjFdWhJ6Vz5KaVbh97ZC1aPEhdFaFe6vDHKJo3PL9OSyTJYDXVAkqcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116844; a=rsa-sha256; cv=none; b=TfFTyepnzvjNQmMdAPHI5UWyJggzzvCTrmOwgmiJh1rIWgSCvzicEXmyyZA+PMnBeQO7NO GKq4eWwWGZrYkmYTGhR/BiriIwIxZmYDOFfFgOxnFnx27BLJkzJor1/COyCjL/2oLs2xjB Mc6Y97+GoFyMjhhBEIBrMIJqgPjTshMOXrbtBjqmYjW/HfPnVZHE6j80xzGlHjkgYfksyG fdyR115JPn1uNg6zeLfkNnk0lORFMXoj8squAccpPz8W1Lnj0J2aj1mZaCblm7/ktVtSK8 mk8YYliWD/4JOGG9cY9L6uXiRdrBQDvy5vr2pZMnPKgJDrLJXmYnhLShS8oydA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs80lvYz35j; Fri, 17 Jan 2025 12: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 50HCROGl052930; Fri, 17 Jan 2025 12: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 50HCRN9U052927; Fri, 17 Jan 2025 12:27:23 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:23 GMT Message-Id: <202501171227.50HCRN9U052927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 05d0bce0e808 - stable/13 - atomic(9): Update manpage after constifying atomic loads List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 05d0bce0e808c118b80334a4d6df071ef0b4999a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=05d0bce0e808c118b80334a4d6df071ef0b4999a commit 05d0bce0e808c118b80334a4d6df071ef0b4999a Author: Olivier Certner AuthorDate: 2024-12-16 17:58:50 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:54 +0000 atomic(9): Update manpage after constifying atomic loads MFC after: 5 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 32c45723fa53d384e19ce52aec15972e73305a8c) --- share/man/man9/atomic.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9 index 98d392dd6032..0bbe58f45e0d 100644 --- a/share/man/man9/atomic.9 +++ b/share/man/man9/atomic.9 @@ -20,7 +20,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 January 16, 2023 +.Dd December 16, 2024 .Dt ATOMIC 9 .Os .Sh NAME @@ -60,7 +60,7 @@ .Ft void .Fn atomic_interrupt_fence "void" .Ft -.Fn atomic_load_[acq_] "volatile *p" +.Fn atomic_load_[acq_] "const volatile *p" .Ft .Fn atomic_readandclear_ "volatile *p" .Ft void From nobody Fri Jan 17 12:27:22 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs753h0z5kvtT; Fri, 17 Jan 2025 12:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs72K47z3V05; Fri, 17 Jan 2025 12:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cj9EoUbbhoAb6Nei5muqCemTbRmIGlFZZwyaCB+o5wc=; b=m0ACOraRFCcsJM/bIkRNQfl298uoohTKX6tvHm55fLZQwrJ2jEsMaqdauz3WF64SAxGjp0 xGjcNHLCh/HLbCkpG6aSkY0IqGmsRL2DbkV7/mqDYSjdKat/gY8T8OQl2KLzc4uj/XZp6j oJ3X6ETJrOeAwUWLOBKNXZoc3KXoW5gVxwjocxle9beMq3nVLNBOSyJCjEaq0HF1L29iX2 Q6LVppexZMecO0KY2RbfiUt0Bus+bvUB40MjfOrnW36kplYPxUujrV+Ir4XjACHbC3G+Ht uh6eS6Ba8UxK6qu2gFIVx5H0HWOBQNztbtuVV8PO6p48aa/PESHRMD1aRhWXCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cj9EoUbbhoAb6Nei5muqCemTbRmIGlFZZwyaCB+o5wc=; b=koBsiLfkVzv71y6noJl4/i8OtSk0WRkhbVei6akAks960t6SZPWSs+D4Ugc+RKU4KLmVsq v+4WcddlFdlKXdYhbeh4W9HXy4BIJI0j9lK4NJgKWDtz8mAAWs+g4onFqDBjN4Yvlb/kqN vtGT4Vwiwtz2OTq0ejhONYJZUqgvhtkJwXR2DQXZZM8modZmkcjqRUHyFxMdka8SxnUIaH HIqcbNK3Y3ac/jEDqFVFOWcfhFGSfwje2kaek4o1nDazgYYtqCDNYOuZBoUrSlEl1auhnu 94joaFrJdPvU89OQGe1pVsdEvtGZEMtAPKfrNhClrBv4Zidmwt9C04jWKh/dcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116843; a=rsa-sha256; cv=none; b=iEG3Yf8Qd/v4FprHfIuyox47W5YfgtnFwFq8qPVnCAOqWGaVnIUoDAK3Hl5064hiMfDFAd AWEZ/gM9bu1gec6O15FXx/HYwkA0OBMeRaEq7ib1oQZeQgqGqrwvYNv9Y6+U4GXfhm/x+d hO/4gUpdfEqgEXGPyopPTobWYiCCEdbBaCByVxqHef7U3pCo4dRtQwBGMaadYhVJ6nKwWn fXKX309b0xRVl31KOJoCMlAeVAA9WfMDwlIcvFZBNqjI5MhVIbG/WtSig7IMLSgk+fhVG6 GeKZYUiIuq9hRyDIL0/w/xxqAQCBQpPl34uuiAVwZMoUOplsyjJ3xyd5C1IAcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs66RWlz35h; Fri, 17 Jan 2025 12:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRMV9052875; Fri, 17 Jan 2025 12:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRMTB052872; Fri, 17 Jan 2025 12:27:22 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:22 GMT Message-Id: <202501171227.50HCRMTB052872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b6a3bda9bc2e - stable/13 - x86 atomics: Remove unused WANT_FUNCTIONS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b6a3bda9bc2eebbc7630ec7a9ccb27ca923ef596 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b6a3bda9bc2eebbc7630ec7a9ccb27ca923ef596 commit b6a3bda9bc2eebbc7630ec7a9ccb27ca923ef596 Author: Olivier Certner AuthorDate: 2024-12-09 16:13:09 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:53 +0000 x86 atomics: Remove unused WANT_FUNCTIONS This macro has not been in use since commit "inline atomics and allow tied modules to inline locks" (r335873, f4b3640475cec929). Reviewed by: markj, kib, emaste, imp MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48061 (cherry picked from commit fa368cc86cebe7185b3a99d4f6083033da377eee) --- sys/amd64/include/atomic.h | 3 --- sys/i386/include/atomic.h | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/sys/amd64/include/atomic.h b/sys/amd64/include/atomic.h index c1816ac4fb8b..da4e42cd0763 100644 --- a/sys/amd64/include/atomic.h +++ b/sys/amd64/include/atomic.h @@ -418,7 +418,6 @@ ATOMIC_LOADSTORE(long); #undef ATOMIC_LOAD #undef ATOMIC_STORE #undef ATOMIC_LOADSTORE -#ifndef WANT_FUNCTIONS /* Read the current value and store a new value in the destination. */ #ifdef __GNUCLIKE_ASM @@ -632,8 +631,6 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_swap_ptr atomic_swap_long #define atomic_readandclear_ptr atomic_readandclear_long -#endif /* !WANT_FUNCTIONS */ - #endif /* !SAN_NEEDS_INTERCEPTORS || SAN_RUNTIME */ #endif /* !_MACHINE_ATOMIC_H_ */ diff --git a/sys/i386/include/atomic.h b/sys/i386/include/atomic.h index 2ccd206a35ec..d8c7d231cc73 100644 --- a/sys/i386/include/atomic.h +++ b/sys/i386/include/atomic.h @@ -339,17 +339,6 @@ atomic_thread_fence_seq_cst(void) #ifdef _KERNEL -#ifdef WANT_FUNCTIONS -int atomic_cmpset_64_i386(volatile uint64_t *, uint64_t, uint64_t); -int atomic_cmpset_64_i586(volatile uint64_t *, uint64_t, uint64_t); -uint64_t atomic_load_acq_64_i386(const volatile uint64_t *); -uint64_t atomic_load_acq_64_i586(const volatile uint64_t *); -void atomic_store_rel_64_i386(volatile uint64_t *, uint64_t); -void atomic_store_rel_64_i586(volatile uint64_t *, uint64_t); -uint64_t atomic_swap_64_i386(volatile uint64_t *, uint64_t); -uint64_t atomic_swap_64_i586(volatile uint64_t *, uint64_t); -#endif - /* I486 does not support SMP or CMPXCHG8B. */ static __inline int atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t expect, uint64_t src) @@ -660,8 +649,6 @@ ATOMIC_LOADSTORE(long); #undef ATOMIC_STORE #undef ATOMIC_LOADSTORE -#ifndef WANT_FUNCTIONS - static __inline int atomic_cmpset_long(volatile u_long *dst, u_long expect, u_long src) { @@ -921,8 +908,6 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); #define atomic_readandclear_ptr(p) \ atomic_readandclear_int((volatile u_int *)(p)) -#endif /* !WANT_FUNCTIONS */ - #if defined(_KERNEL) #define mb() __mbk() #define wmb() __mbk() From nobody Fri Jan 17 12:27:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJsC1x9xz5kvZq; Fri, 17 Jan 2025 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJsB2jS1z3V4w; Fri, 17 Jan 2025 12:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bM+XfycRY2R7tYnEN0ieKTMwtu/bIKtO9jg13qT9dY0=; b=gqZkMKs/6d6+tcP4qKCFq57hztJ1JHg2OFZrND/P0/GnhyFVITZHwaSASpiEksUzQy8Qn8 yhCq3afRel7JEwARUyRybUprU93kjr8sXQte4X9b159iNq69WOk1lGXjwW/JilRR7XOocC 2FUQOzZSrg0Ocz6GckZGtV2XYbIOk5gVJAvEctYKTsdkVu9DNhuXHc376teIqB53zOSSFd z7fted/EZg0xBCedixcyV6mLgVCNfSntiKQEzI9QFaRSakHL7YlT5rNuBT6TwYHJ0heGE0 qOmIJwnaojZtLbfKqsBm+jmFOarI/Yc3lnHkXrnTIgoUDSvRHjQQi8X2IzrquQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bM+XfycRY2R7tYnEN0ieKTMwtu/bIKtO9jg13qT9dY0=; b=tKpGZpD5Y86caQo96va8tjXgye4JO+ogkRK7KcDvciY4x/riX0iBfTUQVbfRPmrPB1q2aW t9bKojDV4q4Ppp8CKm7QMA89fXKkcLFdEScMgB0fB/HLAt9Loqi83d7js7p37cC574RfWC 7185o0f4eF6HJicMD+fUJDEegKtWsJ5SHVH0OkbPyy+p11IcB46Sjcqj1zGiBDr7W3o2YX ibpE2rn1yOxs60/LCHekjGQVSKDSsYjuKDzFXOJZIxqGjz7rKjpMbQ++5gQ0iHsbuaufvX QaU4UiOMXY3T8COJcPnQHIdnzEGJ4DOASq2In0jo+89eboGOr3M/4BTx8AV5fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116846; a=rsa-sha256; cv=none; b=EswvNoiNwPWihMhJPloGFnevh8/WG23nWrj9uJ4tx0ddFN7DrcJergBRwNaUJq49wGfZsB VDJNPnlXWgM0exF6IuuhElzdLkDkrIy/eDzxH4eWIDTR4HJ0sWHESPoKkmcM7LgHph4mhI qYLC12jUJ2XkBFj1iu4uPJZagdD95sM8H2JHxQc+y9/NxwtMAJpnH+YJk6cdcL9gt4AwVP acwIGHQK6+WtBco6An7loRV8qVvfHgD1SDGPMRbbpZhTkRPXIGBRBF3uCY4lSHhiMIwPBk A3CG7BJxcAyzluvxoHG3/GEiss3ckS8QeICMud448as5OwdXe6SpbpEOybpwOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJsB2H1Wz2rf; Fri, 17 Jan 2025 12:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRQvV053021; Fri, 17 Jan 2025 12:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRQEE053018; Fri, 17 Jan 2025 12:27:26 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:26 GMT Message-Id: <202501171227.50HCRQEE053018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 1cf5ab87c87e - stable/13 - atomics: Constify loads: Fix powerpc build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1cf5ab87c87ed72ee572971f33b68e5ddd595433 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1cf5ab87c87ed72ee572971f33b68e5ddd595433 commit 1cf5ab87c87ed72ee572971f33b68e5ddd595433 Author: Olivier Certner AuthorDate: 2024-12-16 19:12:14 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:54 +0000 atomics: Constify loads: Fix powerpc build Fixes: 5e9a82e898d5 ("atomics: Constify loads") Sponsored by: The FreeBSD Foundation (cherry picked from commit a9722e5ae8519a9a28e950dbd8d489178e9bc27e) --- sys/kern/subr_atomic64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_atomic64.c b/sys/kern/subr_atomic64.c index 483be123ea28..b629b74c7653 100644 --- a/sys/kern/subr_atomic64.c +++ b/sys/kern/subr_atomic64.c @@ -78,7 +78,7 @@ static struct mtx a64_mtx_pool[A64_POOL_SIZE]; #define ATOMIC64_EMU_UN(op, rt, block, ret) \ rt \ - atomic_##op##_64(volatile u_int64_t *p) { \ + atomic_##op##_64(const volatile u_int64_t *p) { \ u_int64_t tmp __unused; \ LOCK_A64(); \ block; \ From nobody Fri Jan 17 12:27:25 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJs93h26z5kvtV; Fri, 17 Jan 2025 12:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJs91yr3z3V9J; Fri, 17 Jan 2025 12:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q6+V4tVfsynrQCi58ymBrWcXsv7I/oVLAEpW6oKROa0=; b=AaprLt6eH9azk7weQbkfLWlq7ckC8QqT2EvSmm8NiRtDYD/N1tzbfx2oXI6SeyGqiKQTSu 1a1VvSfntMFsNRa+m4e2js+ZzpFXdjAtN8SHSvI1bNuJ9L9qUeKEeIrHr5xQx3lFng/NJ1 AG2u39/az0p04izVB0UVZjpuuZQeiD2GB3oAry0ycr2wcGmYtajDVDPw8qkPnm3N6h+vBd 9xW1JJm1+ZcdanJS5mKXK1vo+J4m2fbSYVdGsitr7x9On/S/fWM+T4j5Ze/uUH+c8kCJym zLqf3+TSQHkV4WRx9dqbaYFpc5bPMbKp4gKGTChQ8172c+VMVI1fyjfdlxfi6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q6+V4tVfsynrQCi58ymBrWcXsv7I/oVLAEpW6oKROa0=; b=eU6tNQjw7dlVZylu36fFWyqUvqt4FNH6QljyQZj1OGDuFs6mMrAHPRxHLkWfiY/iOxUqz7 RXawNF7dB/EU5uiU9jDEI+rmcPLoXKxoXII0VkPukKtuzr1sssdrF1u/gtj9YV/m7LJNmh dnpa824MDkHN/U0JO88Dj6W6/8O0B1evvVbXSZZQ8Z6soZlnO66GXdzSA+TI3Od3alj00W Vkk/05e2uVRb5rxL42+tCE1OjhurJzfAsvi/r7fAXYIUL2Qckr9KrrPXU7TREtKKfx8/y3 HVJCBTiHV5Mr+oTNJOS0QdCcLk1+xOkSOE0xzAWNDSgAKwMST7pFRfC7BRrr7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116845; a=rsa-sha256; cv=none; b=U1uRX1ZB8YY+1jYZ/naX+jKhCQkLXzB57a86QW9/4ZgVnaqbpPFFmZQbEOa8Tz5ckUoZfE RDc23Xs13AHZzq66OAtq7pQaaOs7Bl5qXkxHRrIyN/Cd3DTQvJK3z+wjWnkf22U7dxdIUy UnmqhwkQK8MQUik484PfAU1/q1R19iDOkPpi7fzDX8cDim6bMDyJwwrT/SBGpwDSGn4S7h ejZbkNAszTxJNuZUYJQ5L2Pz8lwYOGOyEG67m3tvl3DXzFjUsXICPAE0LlaDh2q6RJHoay FJH8XCFCf7QmdNKj8CF16Ah3cpF8m4t3WOiRPpAwAUu3rkDckh/lty3Y8/a0Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJs91VTkz2rd; Fri, 17 Jan 2025 12:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRPqB052973; Fri, 17 Jan 2025 12:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRPgF052970; Fri, 17 Jan 2025 12:27:25 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:25 GMT Message-Id: <202501171227.50HCRPgF052970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: b2d46346d89b - stable/13 - proc_set_cred(): Fix compilation of GENERIC-NODEBUG List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b2d46346d89bd712dc28946c3ba6c27ea3b20bc9 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b2d46346d89bd712dc28946c3ba6c27ea3b20bc9 commit b2d46346d89bd712dc28946c3ba6c27ea3b20bc9 Author: Olivier Certner AuthorDate: 2024-12-16 15:38:26 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:54 +0000 proc_set_cred(): Fix compilation of GENERIC-NODEBUG Approved by: mark (mentor) Fixes: d2be7ed63aff ("cred: proc_set_cred(), proc_unset_cred(): Update user's process count") (cherry picked from commit 675708aa402a06d9ced98c8a12d9ef29625d3c66) --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 655ee776b6a7..4ab68aa826c9 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2336,7 +2336,7 @@ _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) void proc_set_cred(struct proc *p, struct ucred *newcred) { - bool success = _proc_set_cred(p, newcred, false); + bool success __diagused = _proc_set_cred(p, newcred, false); MPASS(success); } From nobody Fri Jan 17 12:27:27 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJsC6SPLz5kvZy; Fri, 17 Jan 2025 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJsC4B31z3VCl; Fri, 17 Jan 2025 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhxAtA4hDA0IBniqny4Q23SmlAvo3urMmmCiRVKjOk4=; b=a1OtIKk75jxVxD+M9Zfx/qGWECY1wtJsO6lT0JZQodX+Na92GgiJ5eUVN7H0d+DVzKO9gB BPRyMR8089e4z5QxFDs9Km7EQB2PWu86nWsknlhhU8gc9R7pPovcqXHNy/DTXcbvdnFvvg T6jrJTtfdABeAiA+TRSEFa09ZXWO52T6Qqo8KvohVe/e4iSFJD1DhLwYBsNEg6S31E4aGs zc9M7chxoz6draP/Pf8bAWoSM2WRdBf8e6+yGLzVdTb7P+JiAn516Y+eVd1Vh/EOTzMU0y dmau+X2q2SwYW81aORwjLi7Ys7GHORfB1LnmGPJEWretKlVPb7S11cAsnuYI+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhxAtA4hDA0IBniqny4Q23SmlAvo3urMmmCiRVKjOk4=; b=oWb1eD0CGgRIprHOz+PYMh7aN4OmOkEdlrClfrCkiM62msOnC5HjSHv2vhumQg+n2H3EIC qfTsOCKAR11OIuYoecwG6SQiRc9dmlXUOisPZi5OwSk2fygnI043F49EmewYmjX6UzhVvj A6bL2dNEXSjicnDFdvVWKY7vJhpQuZbHRZLatd5YWOUVWJjHAPQV6bWxqEBNlovsPZaI1Y DIDdLDHB6CqAtUnFn67aZ8MDSdWZ21bqeTjJxA0ZjKywLLzRKWgKSo7dOJAfxrovJUnqck JVLvSeIa+OUtoE+Z3o9fbtKKP4Fndp1vaEY2luUtieoglmQpS4PW5pfnfN4Ejg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116847; a=rsa-sha256; cv=none; b=v/8yqqzojxVLCd6xGXFNpcnULVn9HgatmPIDsPSahjZ4Gm+kypv4wpUGv67DvFB9vQgQwb 62RVp39O9KlhiJTXkIcZPfAHI0aEdxfdyo3c6iZ5rrqlEGKIC+Dvr3mESvsQqbJwpiUI9L WTpocttpSgNb1q17C4FpFjYvBv0sw4hGtydhQktRU1v5FjQ+qtuBLahwynd3EWprapFG6d vEY0BKHKIEi6/FCncMorUncoVwqhIa6ZYlCz1rtHTfZVVt5/dFIrWvqMimvcsOLtTomZ+f 9tAmt22FJXjf+aHNdGIKi+wx8QOOmgTwq78uj/avP5y0sFrRAJB1VX13jURQxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJsC3cfGz35k; Fri, 17 Jan 2025 12:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HCRR6V053057; Fri, 17 Jan 2025 12:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRRK6053054; Fri, 17 Jan 2025 12:27:27 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:27 GMT Message-Id: <202501171227.50HCRRK6053054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 5cf27105df1e - stable/13 - queue: Fix STAILQ_SWAP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5cf27105df1ec5e7e5c7627de978fbcb8e0671dd Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5cf27105df1ec5e7e5c7627de978fbcb8e0671dd commit 5cf27105df1ec5e7e5c7627de978fbcb8e0671dd Author: Mark Johnston AuthorDate: 2024-12-17 00:12:11 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:54 +0000 queue: Fix STAILQ_SWAP The debug assertions added in commit 34740937f7a4 do not hold for a window in STAILQ_SWAP, so check whether the queues are empty directly. Reported by: ler Fixes: 34740937f7a4 ("queue: New debug macros for STAILQ") (cherry picked from commit da2c88dfcf4f425e6e0a58d6df3a7c8e88d8df92) --- sys/sys/queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 4e0ba068c520..0b1e1f9fba55 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -474,9 +474,9 @@ struct { \ (head1)->stqh_last = (head2)->stqh_last; \ STAILQ_FIRST(head2) = swap_first; \ (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ + if (STAILQ_FIRST(head1) == NULL) \ (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ + if (STAILQ_FIRST(head2) == NULL) \ (head2)->stqh_last = &STAILQ_FIRST(head2); \ } while (0) From nobody Fri Jan 17 12:27:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZJsG2JvBz5kvs7; Fri, 17 Jan 2025 12:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZJsF6R9Yz3V7W; Fri, 17 Jan 2025 12:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=crEZghsHmMzsMpJ07IgzLaAPmHcb82b24S8+/To7Uqs=; b=xKnAvaOkGPvAjFbJAczO+Zb+GfMTYDrdgDlcbrqCng/XH8giFH/0x1QfpyXOckAoTdK6ag DlwzbcwuCywoOE/LbzIR7Gv9S8EG7Rb+9v8ELQ/tei9OKJU1qMNL/3mjfAQQyXhHUvkfTE Q4B9pAOmcKB8m9hOTYegghiS5j8/uXyhlH0u8zQeyZDzQu06rxipwLvJW/HYIIbr/u9iX4 4M0CHXifBE0j8qR+Md56sNWDV9c3HDuAnZJSmp1OuNaBix0MFCKeQMx1K+qhKtnl7eDIvx KkcQKrcP37YKJ7xzw64XbZAw28jyd3AUGlo/K88Y8PhuEr6PEeUewliBIpBkAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737116849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=crEZghsHmMzsMpJ07IgzLaAPmHcb82b24S8+/To7Uqs=; b=n8DPYaVoy8vnyw1h8ou6GAMjFxjyX0A89zbLML/XFoSOMT4MHckXYzRbnQ/9BJlcsMAvEt LQx9bVqGfSU1dOznI378nFrPCHxxZzpLXMtfPPPYej+9hbAnJJuZ0zfYA7HuVwSV1Dyti0 n+Hz/y8YzK4z5sd3mlxuNfacPV86lquisLG6UhVZ9YQRRQPD1zaxLaFrTwbUthidzrt56s wM30aKGN8/AaswQ1aw3rCBDBr5UF6ZZmRZ3fKDF9gH/lrVIYysqMYLT46IQTB51ttCiNbT YoxOYhpQ75HhQ1vxuOSGz6Iex1HPQ6GkACVpSLhzHI5G5UrQIXcPLeStJMbe8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737116849; a=rsa-sha256; cv=none; b=whgSYqeqUAh/Zg+NDM2MKkdPssm2pQsfRWcrm6/jAXh5p2o/KHviQBUlloainROn9lNLPX W/Cs5knEFG+IzhAsLWAXc6ewa4JWW08NHNmTI5K/R+4pJ74+CAhuxUQX/pF5Fh8GzDJiEn rkrERMj/mH47Qoluu5DsT6CX5ztH6aVfpUgWgekeUafB56QbhOBbbW0g7/1VcWMrhtttE1 FD7//7LZWfhFZ7k6pziCpK47Zhx+kIEOzWYM1TfPqOhgr+gTsHWqkdh/Km6AEvSAzzF+fo y4ABZzNzUep67hTzQepPLog6sfLRQURti7XKl0SR5H0/UXea3h25/2Q/ogwoew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZJsF5gwPz2p6; Fri, 17 Jan 2025 12:27: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 50HCRTCV053170; Fri, 17 Jan 2025 12:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HCRTFq053167; Fri, 17 Jan 2025 12:27:29 GMT (envelope-from git) Date: Fri, 17 Jan 2025 12:27:29 GMT Message-Id: <202501171227.50HCRTFq053167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6f43ca650d64 - stable/13 - libprocstat: ZFS support: Makefile: Tidy up a bit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6f43ca650d64d3d217fff9a4881f0cbea9f7efd0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6f43ca650d64d3d217fff9a4881f0cbea9f7efd0 commit 6f43ca650d64d3d217fff9a4881f0cbea9f7efd0 Author: Olivier Certner AuthorDate: 2024-12-12 21:37:14 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 12:24:55 +0000 libprocstat: ZFS support: Makefile: Tidy up a bit Regroup assignments tweaking preprocessor defines/undefs, and separately those about include directories. Re-order include directories a bit more logically, and remove redundant ones. Separate logical groups by blank lines. Build artifacts have been verified to stay the same when produced with an external LLVM 18 toolchain. MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48070 (cherry picked from commit 618c97b87b7124cdfb10d2f33a213c3302c8a98b) --- lib/libprocstat/zfs/Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/libprocstat/zfs/Makefile b/lib/libprocstat/zfs/Makefile index da689fdd3e81..10448b0bfab9 100644 --- a/lib/libprocstat/zfs/Makefile +++ b/lib/libprocstat/zfs/Makefile @@ -6,19 +6,23 @@ OBJS= zfs_defs.o WARNS?= 1 -CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -I. -I${.CURDIR} +# We fake a kernel compilation environment in order to get the definition for +# 'zpool_t'. +CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -UKLD_TIED -DKLD_MODULE +CFLAGS+= -DHAVE_ISSETUGID -D_SYS_VMEM_H_ + +CFLAGS+= -fno-builtin -nostdlib + +CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include - -CFLAGS+= -I${SRCTOP}/sys -I. -I.. CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include -CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID -D_SYS_VMEM_H_ -UKLD_TIED -DKLD_MODULE +CFLAGS+= -I${SRCTOP}/sys -I. -I.. -CFLAGS+= -fno-builtin -nostdlib +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h all: ${OBJS} CLEANFILES= ${OBJS} From nobody Fri Jan 17 13:36:14 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLNZ4DSZz5kxv7; Fri, 17 Jan 2025 13:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLNZ3h7kz3lNw; Fri, 17 Jan 2025 13:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737120974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfRgtDSEOeEYC4xDsfQxsIVr1hdCKw32iPFZAJXucUc=; b=PMJ1iQr7RTQmwFD0rjS8yRHViLEsZLgoEvd2cC1r7mGt1cfQjKQf1QaiHUGYhg9PQ4G5Nt rZKS57PwVU6AaFlICgT9C0267JUtz8LfBCOyutfcVNM+tR3x+w894qiFcFnuSVfw+F2Bll 5vI2lsYDkEKUmxNDagrE/dhwy2v4c+Wn7Pyvz64y83Bq/bLmNSAf3zsQH8StoWQ4zB28Ea m5dD84iTJVo6hB5orQVav+bCbwsnLk2WquwsSGdn+1Rj+429ygPLXa5rHBgFkYwxQLecXQ OLqACkEu8hEkeBfosGcP1OnLqxnA5wk0S4ZbYxHRDY12K3Akx8mVOnuq4kl+jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737120974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfRgtDSEOeEYC4xDsfQxsIVr1hdCKw32iPFZAJXucUc=; b=C3jJT/ya1R8qJ/qMSBEfipRmhT8JgNoRjwPi8FAxxK97e4janlYY53EuW04CqIRLeHW2lR R/gukid4EpJrnJ8WiocA82wUKhy0kCKjYO44ZVDVo/lFfmB6nKb8Lbli9jvQ49COxyJJMK VLzW0MP3Q1jaZO8+yt8lnEsexwCeNWoF+nElRIpwMuqua6mmSYOGViTEUt4BBQxTtjDSK7 0orTnrUac/77WkYiImdC4BAEFJ21dZ2EwTfLVHn+LUvnIQGSyMj2ei5cFQGe+ZuMJpZymz +7EFL0mPGvNDScvDlCX3g2UWxBINwkrlbVUk9ADxiQCOo9FYTSEGEQF/GA2Q5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737120974; a=rsa-sha256; cv=none; b=CPvCMpv/Fu87HkShFvttDoDt9Eqdzbugon7Qd5XJMmInC9odQ8X5dWIskSstqSD+xCWn/1 JXjja2qqMNnTEWEAXb85DgqlLnCLRrYjUwkdYVUqC55CmhYfNKn0DrVSs48zDaHbB7vMsd E57qV/In2CSurCH3NFwEQWVE7ax1ZF+ht9RWcxhv2rAkZZF/7G4q5mK0iBUnuMcd9Tc5Oh cQu4UeAI3h1rgBF94YpqO8Ds2mQGFYMzkYAOh6PFKlxeO2R7aMUr34rYa4CIGYTDPcCrt3 nFbagL9dflBE6MzQJz6sgEZPXNKRH60cw3I7Xzsl6xlfZNsnP6pnZeL59ajw+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLNZ3H1tz4dr; Fri, 17 Jan 2025 13:36: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 50HDaES6086087; Fri, 17 Jan 2025 13:36:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDaEE9086084; Fri, 17 Jan 2025 13:36:14 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:36:14 GMT Message-Id: <202501171336.50HDaEE9086084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0e17cf062975 - stable/13 - cred: proc_set_cred(): Fix debug build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e17cf06297555a34485111360caf06c213179af Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0e17cf06297555a34485111360caf06c213179af commit 0e17cf06297555a34485111360caf06c213179af Author: Olivier Certner AuthorDate: 2025-01-17 13:33:42 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:35:38 +0000 cred: proc_set_cred(): Fix debug build On stable/13, the 'cr_ref' field of 'struct ucred' is of type 'u_int', contrary to stable/14 and main where it is of type 'long'. This is a direct commit to stable/13. Reported by: Jenkins Fixes: b3d437832ffa ("cred: proc_set_cred(), proc_unset_cred(): Update user's process count") --- sys/kern/kern_prot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 4ab68aa826c9..95e843eb99f8 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2298,7 +2298,7 @@ _proc_set_cred(struct proc *p, struct ucred *newcred, bool enforce_proc_lim) PROC_LOCK_ASSERT(p, MA_OWNED); KASSERT(newcred->cr_users == 0, ("%s: users %d not 0 on cred %p", __func__, newcred->cr_users, newcred)); - KASSERT(newcred->cr_ref == 1, ("%s: ref %ld not 1 on cred %p", + KASSERT(newcred->cr_ref == 1, ("%s: ref %d not 1 on cred %p", __func__, newcred->cr_ref, newcred)); if (newcred->cr_ruidinfo != oldcred->cr_ruidinfo) { From nobody Fri Jan 17 13:40:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLTb2nngz5l0nf; Fri, 17 Jan 2025 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLTb1qVXz3m4h; Fri, 17 Jan 2025 13:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtEolO1nTgRblUCtCtAUvpye8Hd2SAFpE5MiMcteBJU=; b=ZQ3dBKGDHobX/3S0Zp6yvyaZVCWVN2PBPQ4I0SAX2gd8v1rse0uNeiEroWG2buRX14v4EA /FxlpiQm0Te+sXkQA4KZzgl+Ju9Nv9bfZMPH9olTZBB4eFNtQ4yGKzVupNxuPGxV/QuJWG /WPe9RX5bC+h2LP0gZEy03d67FSKsW7byLzVDEe+eApuvoWi1ox/3wXE2wJ1kVbq3sZAwT p+bfMzySR6fK6g7MEpjLSRSNmzUpBliEwO4OfKce8JVTF82QcLIeQUJwBdFdZXd7sofm2W VwRfn08eedQs9cM9agxsLvagUuKMdvrDRLmkBH5pWecgTHmOd40C8SGJ0fmUIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtEolO1nTgRblUCtCtAUvpye8Hd2SAFpE5MiMcteBJU=; b=BD1SEd7Zl+TzAzbUaamYO6bnoqjg8bJAjPBIThEUcDqqgWJ6TXXqBCwZEQicNBrr04638T CGMFORd81KBEwxdenuNw+82U8HAY8w09AceA8J741qYhQOo6P7AblEiOEZ+K7DsA3xjrAR 0Ne3BjR00RdWnTLpXpx4jseGXIDt6/0qaOrQFrOhNy6K0/ZZx1rbulCcUgsJj7x6XNHbS1 P9nL8UNcGzLLwGRBVmDhv70N43BIscRRiiZPjnyOlAC+z2wlUHny9CGgjjp1C1U0Q9778U ufJBYouq3KYGLElCQV7C8M6YUwTuzQOlXq5794DLroukq7gCI0LLtkRRN8MvTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121235; a=rsa-sha256; cv=none; b=rbg2Z3jDHa6rfFD5ibIS7C657mEDe7gRQGkRvQck+hPglKGCxN30LdYaTQCJWEtPwSv41m UCm+ksxpZogvaGtc6ARF6dPKNcOfhxYkG229lKv7fdtNWJvT8xChDxs7DYZayOgiiOeJgL cU+W8j2ghokEOscXf7ROJ+KvUaoPT+509yzsW7azVTMfVOw6pex3pL7eN1qMTJQF2bQGGN bVu/P/QsqndmzvGei/zUc/JOnguva10SYjWPZxLuSm5ufszOc7O5ZWcD7Q6CcHMI10R/cH rY9xkogXTBn7LshXJNsup6H0UhnndeVzoyBLozAo8yVZmdYRKnne+st6ILLTGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLTb1J4gz4Ph; Fri, 17 Jan 2025 13:40: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 50HDeZHr095999; Fri, 17 Jan 2025 13:40:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDeZmJ095996; Fri, 17 Jan 2025 13:40:35 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:40:35 GMT Message-Id: <202501171340.50HDeZmJ095996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e16a2508e17d - stable/14 - vm_pageout: Make vmd_oom a bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e16a2508e17de8dffaf06d41df59918cc57b27e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e16a2508e17de8dffaf06d41df59918cc57b27e0 commit e16a2508e17de8dffaf06d41df59918cc57b27e0 Author: Mark Johnston AuthorDate: 2025-01-09 14:53:37 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 13:18:51 +0000 vm_pageout: Make vmd_oom a bool No functional change intended. Reviewed by: dougm, kib MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48376 (cherry picked from commit fe1165df4b776b14b21a04d2ef3fc4c46740c2f5) --- sys/vm/vm_page.c | 2 +- sys/vm/vm_pageout.c | 6 +++--- sys/vm/vm_pagequeue.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 3713fe17dd13..2facdca9bf27 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -459,7 +459,7 @@ vm_page_domain_init(int domain) vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; for (i = 0; i < PQ_COUNT; i++) { pq = &vmd->vmd_pagequeues[i]; TAILQ_INIT(&pq->pq_pl); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index aec850039389..3b07af2c76d4 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1798,7 +1798,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, vmd->vmd_oom_seq++; if (vmd->vmd_oom_seq < vm_pageout_oom_seq) { if (vmd->vmd_oom) { - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; atomic_subtract_int(&vm_pageout_oom_vote, 1); } return; @@ -1813,7 +1813,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, if (vmd->vmd_oom) return; - vmd->vmd_oom = TRUE; + vmd->vmd_oom = true; old_vote = atomic_fetchadd_int(&vm_pageout_oom_vote, 1); if (old_vote != vm_ndomains - 1) return; @@ -1831,7 +1831,7 @@ vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, * memory condition is still there, due to vmd_oom being * false. */ - vmd->vmd_oom = FALSE; + vmd->vmd_oom = false; atomic_subtract_int(&vm_pageout_oom_vote, 1); } diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h index 1f44580dfd23..1f1f818d3ec3 100644 --- a/sys/vm/vm_pagequeue.h +++ b/sys/vm/vm_pagequeue.h @@ -254,7 +254,7 @@ struct vm_domain { /* Paging control variables, used within single threaded page daemon. */ struct pidctrl vmd_pid; /* Pageout controller. */ - boolean_t vmd_oom; + bool vmd_oom; u_int vmd_inactive_threads; u_int vmd_inactive_shortage; /* Per-thread shortage. */ blockcount_t vmd_inactive_running; /* Number of inactive threads. */ From nobody Fri Jan 17 13:40:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLTc3vZmz5l0bK; Fri, 17 Jan 2025 13:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLTc3Hknz3mGT; Fri, 17 Jan 2025 13:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iG+iFhvqGenVhUfNQ3ICUN91S/nKHn1sUqujOpcvYRc=; b=ajaX285YGSuYt9KFR9tQJHslZR7aU4RBi1GyLe8lFeN8CYo2MiSZK1WqYYzZlDugQ1C2sJ E9xdnOXNQLCTfrVwGwXnFwpG4JhQsyHHu8a/6ocTg6PoFeS6N6v8B8+wRtDkl2A+hRa1mr +nfyn+02liQpV2yt33L9Yiz5ZINzHCp6PMWAuPOuOvNWFl6qjJCR0ux/RgktSUe8hQYDE+ RzYpV3tHhn5IxFV1R4tUf1Z/pLwBk2O0QwCYRClKXSmwvTcsy4hP5VSbISC5offLeFyUr1 XEthzYnEDCRDpXXOzscCUWJFOb6fWj5Ul6bUo5niMHZfDSoKXPmgFsHYkXosQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iG+iFhvqGenVhUfNQ3ICUN91S/nKHn1sUqujOpcvYRc=; b=ruBKWqR8VXMfUEBdtJ4pMOAdYYVj+YPs8e+Y3tLweExqvtQfVt5YfOma94kHW9p97tYj3r fLYmyZMHQVoAhEa7751u992E9c8K/L581wDrvU+k9W2Hr4hjMuLuoZbLyB1SdsLL8ZNoz8 bLJr5wNzOhLpbmcFcf3WAnddx78v0aDciZpjeZYBwctXgWfE6knlfU4WuMASFaxq0Zb1VI 5lMV3mgJW3xDg4sre4DZrmQpcpjjkTm+DQy7ZLv5tNayYu5Qbl21ALSwroCY+6cBlHHPFg UHR1VInlMsg5u/iuLIfTU2CUwBncmAfdN5H0jhE7UfWczEO+sw+zlu4oV2Pwcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121236; a=rsa-sha256; cv=none; b=wf32GztWpwWifSjGZNHaJhFMTyxroDKkKLMLjeDNoioU/ZFupmXq+8ClCC1FvFHluqMAG8 xGMqrIN1/Lvf0qeQcb1eZCZBtUB48XTLMZRd1TmJeIfPGCxpXoPyLnSEDk6cOZ3EJzdrqe cFmpQmhGQeYpCumhn3b4QFT+ZVKV0TLVsOO6zErJJDMvFzGK6q4HJAFY4sUw30O4X2c7pa 21bZYOlncZa4Vg/Sf3tu146A9C4C7ddP0W6RF2X6SVUxZDXNwppgT4Tjhzj3oo8Orf4qT7 p0+IsJ3ktil61wDVfeeoOMoc/1yi3fClbqiCJ+a/ub7qgor7+Lv2Jb/K1zoKPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLTc2YpDz4xb; Fri, 17 Jan 2025 13:40:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HDeaLl096041; Fri, 17 Jan 2025 13:40:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDeaYg096038; Fri, 17 Jan 2025 13:40:36 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:40:36 GMT Message-Id: <202501171340.50HDeaYg096038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4b9ba274d736 - stable/14 - audit: Fix short-circuiting in syscallenter() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b9ba274d736de74676051c8f13e7d3dd536334b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b9ba274d736de74676051c8f13e7d3dd536334b commit 4b9ba274d736de74676051c8f13e7d3dd536334b Author: Mark Johnston AuthorDate: 2025-01-14 14:19:24 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 13:18:51 +0000 audit: Fix short-circuiting in syscallenter() syscallenter() has a slow path to handle syscall auditing and dtrace syscall tracing. It uses AUDIT_SYSCALL_ENTER() to check whether to take the slow path, but this macro also has side effects: it writes the audit log entry. When systrace (dtrace syscall tracing) is enabled, this would get short-circuited, and we end up not writing audit log entries. Introduce a pure macro to check whether auditing is enabled, use it in syscallenter() instead of AUDIT_SYSCALL_ENTER(). Reviewed by: kib Reported by: Joe Duin Fixes: 2f7292437d0c ("Merge audit and systrace checks") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48448 (cherry picked from commit f78fe930854cac6eed55859b45e0a7b5d87189d6) --- sys/kern/subr_syscall.c | 8 +++++--- sys/security/audit/audit.h | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 725467e1215f..25843eec3754 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -143,9 +143,8 @@ syscallenter(struct thread *td) sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - if (__predict_false(SYSTRACE_ENABLED() || - AUDIT_SYSCALL_ENTER(sa->code, td) || - !sy_thr_static)) { + if (__predict_false(AUDIT_SYSCALL_ENABLED() || + SYSTRACE_ENABLED() || !sy_thr_static)) { if (!sy_thr_static) { error = syscall_thread_enter(td, &se); sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; @@ -160,6 +159,9 @@ syscallenter(struct thread *td) if (__predict_false(se->sy_entry != 0)) (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif + + AUDIT_SYSCALL_ENTER(sa->code, td); + error = (se->sy_call)(td, sa->args); /* Save the latest error return value. */ if (__predict_false((td->td_pflags & TDP_NERRNO) != 0)) diff --git a/sys/security/audit/audit.h b/sys/security/audit/audit.h index b87dd52e0773..28e84dce79f3 100644 --- a/sys/security/audit/audit.h +++ b/sys/security/audit/audit.h @@ -389,9 +389,11 @@ void audit_thread_free(struct thread *td); audit_arg_vnode2((vp)); \ } while (0) +#define AUDIT_SYSCALL_ENABLED() audit_syscalls_enabled + #define AUDIT_SYSCALL_ENTER(code, td) ({ \ bool _audit_entered = false; \ - if (__predict_false(audit_syscalls_enabled)) { \ + if (audit_syscalls_enabled) { \ audit_syscall_enter(code, td); \ _audit_entered = true; \ } \ @@ -468,6 +470,7 @@ void audit_thread_free(struct thread *td); #define AUDITING_TD(td) 0 +#define AUDIT_SYSCALL_ENABLED() 0 #define AUDIT_SYSCALL_ENTER(code, td) 0 #define AUDIT_SYSCALL_EXIT(error, td) From nobody Fri Jan 17 13:40:56 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLV02FwNz5l0dm; Fri, 17 Jan 2025 13:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLV01n3kz3mcF; Fri, 17 Jan 2025 13:40:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmwoLqLvyVn4GTIcibPkH22sz+nCaE5vhir23AuoobM=; b=hgZDo27wVct9fy/2G2N+O1y06HWLKbq+IdWpBX1WFYk54p327iZ+AGZguu1WiH/ZrJnaDU IC6cucowN3zc7P/QOz9OAwn8q5XaFgJDv56khH1KQs9pvbkQA0+dkyxZMDjGdyc4tZldEk WufKUmR3v90PFk8PmG3VuVt64r85r5N2McauFUQ6hOdnS+8ErXywjuQfvVykT8orb7O0JT vSfWdRo3twhfCxCor5MpQWg0V89w2UrmYI6xluNDAyY94BBWkCdHWmzk7QnOqV32zVGOVj gXAbW93TVV6XMUmSJolGW5EEBpSJlsBevWHjqKYG53AZsRllPh8E7lElvzepWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmwoLqLvyVn4GTIcibPkH22sz+nCaE5vhir23AuoobM=; b=HHmbkWhKtJorXBL++gvvicsfDK8Q1xg9gO26r5bRBSPyMtD/+UpA3FD8hDbrojBhqxGmqo /1SmebRwSKQogldcVSUKKCbxwg9OSfLYBGW3H5+KFaVf+HBDWOwh9bsZYMIhq8UeFf9oc0 YirLkIk7k+ggYPfDDOtmkCq7M5oor80E2UvXcC9zWKuXi8AQxiAdut5VCZWTfWMmGE4ij6 FroWVPqFRUSzclh6EGDloniBvzP0sa2uifEaufrycbPQi+Q39Fqt/7MgAl2U27UeFtusiS OpOlgEpCgxoG9Atg4IBl8rWT9mLXnyw6PnJ3hUMpc9bJP7fQ2uuJudQfz/hgBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121256; a=rsa-sha256; cv=none; b=bjt+CBuIroowRncUMjZNli4FDwKyHGZxcme2dDpls5ARugyko5/R/1anmKDX2NGdKsqyf6 akF1CSYksrdi8Px1ED6hujl3fTk/j9A5zqcGpKeqosj3wpMSmM9oFaSSGaDHhsLIhIQQ7t yya6i/GhC+9gVwc2FKEiOc0+v+TYm8TDcbSfaMg1vSftAdo3XjNaS1SH8wbc+vfDELpfxk QZhMQ6P8qXxeogo2somV0ElVDGKX3DmaDoZWxOKbfWXBDlNFxK93fhF6UeLv2W9evwDuGI AuYEmZrQx5lIt2Efg3OmzRjGVUTx/8UoE21+EV2JwHcYc/gLVjqY5+v650YO5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLV00rB3z59W; Fri, 17 Jan 2025 13:40: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 50HDeuds097179; Fri, 17 Jan 2025 13:40:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDeuor097176; Fri, 17 Jan 2025 13:40:56 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:40:56 GMT Message-Id: <202501171340.50HDeuor097176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1bf531bcd791 - stable/13 - audit: Fix short-circuiting in syscallenter() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bf531bcd791794a39511359fbab612944a9e7b2 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1bf531bcd791794a39511359fbab612944a9e7b2 commit 1bf531bcd791794a39511359fbab612944a9e7b2 Author: Mark Johnston AuthorDate: 2025-01-14 14:19:24 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 13:40:49 +0000 audit: Fix short-circuiting in syscallenter() syscallenter() has a slow path to handle syscall auditing and dtrace syscall tracing. It uses AUDIT_SYSCALL_ENTER() to check whether to take the slow path, but this macro also has side effects: it writes the audit log entry. When systrace (dtrace syscall tracing) is enabled, this would get short-circuited, and we end up not writing audit log entries. Introduce a pure macro to check whether auditing is enabled, use it in syscallenter() instead of AUDIT_SYSCALL_ENTER(). Reviewed by: kib Reported by: Joe Duin Fixes: 2f7292437d0c ("Merge audit and systrace checks") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48448 (cherry picked from commit f78fe930854cac6eed55859b45e0a7b5d87189d6) --- sys/kern/subr_syscall.c | 8 +++++--- sys/security/audit/audit.h | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 67ec87d2d563..9ad11b81b6fa 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -140,9 +140,8 @@ syscallenter(struct thread *td) sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; - if (__predict_false(SYSTRACE_ENABLED() || - AUDIT_SYSCALL_ENTER(sa->code, td) || - !sy_thr_static)) { + if (__predict_false(AUDIT_SYSCALL_ENABLED() || + SYSTRACE_ENABLED() || !sy_thr_static)) { if (!sy_thr_static) { error = syscall_thread_enter(td, &se); sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0; @@ -157,6 +156,9 @@ syscallenter(struct thread *td) if (__predict_false(se->sy_entry != 0)) (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif + + AUDIT_SYSCALL_ENTER(sa->code, td); + error = (se->sy_call)(td, sa->args); /* Save the latest error return value. */ if (__predict_false((td->td_pflags & TDP_NERRNO) != 0)) diff --git a/sys/security/audit/audit.h b/sys/security/audit/audit.h index b87dd52e0773..28e84dce79f3 100644 --- a/sys/security/audit/audit.h +++ b/sys/security/audit/audit.h @@ -389,9 +389,11 @@ void audit_thread_free(struct thread *td); audit_arg_vnode2((vp)); \ } while (0) +#define AUDIT_SYSCALL_ENABLED() audit_syscalls_enabled + #define AUDIT_SYSCALL_ENTER(code, td) ({ \ bool _audit_entered = false; \ - if (__predict_false(audit_syscalls_enabled)) { \ + if (audit_syscalls_enabled) { \ audit_syscall_enter(code, td); \ _audit_entered = true; \ } \ @@ -468,6 +470,7 @@ void audit_thread_free(struct thread *td); #define AUDITING_TD(td) 0 +#define AUDIT_SYSCALL_ENABLED() 0 #define AUDIT_SYSCALL_ENTER(code, td) 0 #define AUDIT_SYSCALL_EXIT(error, td) From nobody Fri Jan 17 13:53:07 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLm35hY2z5l18f; Fri, 17 Jan 2025 13:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLm353ftz3nTb; Fri, 17 Jan 2025 13:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=omy2+4dQfYLKH/0qaHoHuBj22WoroME+uV0ueKuHRiM=; b=od4/d5AiVmxd9P2784KYHvt5N5xQ7U96oxxITAX0XrB/QBqKo1muTk9ByKK0C/jhbpqlLZ eG1aoXAliYgmGfxlub97fQlwdqNSEdT1vZfr2lGvDwffPMOSsJKYXyTk8C1vxuLqD5esL3 k+6qOG6h3zlNIomxSHbgpDIqQ0A7xReSBAwBQLuj0XeU35ziDYUzpgZc8LV1+Ctx60th93 BOJ/gkUR21P/B4J6IkVwN32Vw3qXkT7XgiMnM2FM+1SF5D0B4oE4tOH9aJL7n4y7ZwjZRI pi/vBThV4aDwMoO0voQ+078qbxjgGgLug3PIqaeX0sFaDHK8vOsUDOJGRTZz6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=omy2+4dQfYLKH/0qaHoHuBj22WoroME+uV0ueKuHRiM=; b=plqLeEFBUlyrj8vPnWMVUuvjWmAsfH3fsBDUT0KQU607v2Qy5MRPDe63crZ6+pd2rpt716 uG+nTHdZZGGkwukQu6vzfoHt0kiEuxo0U7PsPw3GYv0k0+ovn9vc3dDNEFS4pmCYebXSwD sUZWTkXkz89YxHLAA4RVVjgCyHRJsYJYbI7JRsBb0lw0c6r5qE4QRFqt5OjTkCQr2uHzvL AUuMopDZNTHOuL63vFTVQkY/xgHRSQMqXN+O9I7tnfWFijpwgHnlZ+IJEiH5dIIb2j4NH1 8b73ioSrV4XxOpOTqNzmmFRNxWqbI1xh4hDAe9OODH0TG+ZW+uMbaJMx4V9+KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121987; a=rsa-sha256; cv=none; b=rIfb34pTqsl0r3z8ZuylHPwJxYcuWSatQKQ+X4J0s5sifKrYzIWXRl88GEQGO1eNzKB8JM gYFUS860pzjtuleJOYYPTc1V5acc9tYP9c3494MHQa7GwHLjCOjGtvKtMWZzDfroT+xa8V O5aHqHunj//Jn2TnbtDIhxsW554IiqenHCAqMKJkXguMZ5PLMAXNVwvu0RPmbG9whnm0jo UXJMLBD2rA8o4SCOEOtvFnXM8hYvHFG5BeVOQnmRwBotiEvSgLr2KTyMP+wiCA0Psd1LkP khCqpS+cf2G1rumkFtgQ1YzPFIROr6vNREVkOP7CpwluTC5wMicGHCTj+N7cfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLm34cYfz57b; Fri, 17 Jan 2025 13:53: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 50HDr762022358; Fri, 17 Jan 2025 13:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDr7HL022355; Fri, 17 Jan 2025 13:53:07 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:07 GMT Message-Id: <202501171353.50HDr7HL022355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: f97d802a3d89 - stable/14 - tarfs(5): Grammar fix for a source code comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f97d802a3d89d5ffbc4575b41991434c741bd061 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f97d802a3d89d5ffbc4575b41991434c741bd061 commit f97d802a3d89d5ffbc4575b41991434c741bd061 Author: Gordon Bergling AuthorDate: 2024-04-20 09:21:54 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:50:41 +0000 tarfs(5): Grammar fix for a source code comment - s/the the/of the/ MFC after:i 3 days (cherry picked from commit 742f4b77583c12ad31edfb3d6f7173f37bd0e88c) --- sys/fs/tarfs/tarfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/tarfs/tarfs_vnops.c b/sys/fs/tarfs/tarfs_vnops.c index f2828c60f8a7..8c97fab185fc 100644 --- a/sys/fs/tarfs/tarfs_vnops.c +++ b/sys/fs/tarfs/tarfs_vnops.c @@ -296,7 +296,7 @@ tarfs_lookup(struct vop_cachedlookup_args *ap) *vpp, tnp); #endif /* TARFS_DEBUG */ - /* Store the result the the cache if MAKEENTRY is specified in flags */ + /* Store the result of the cache if MAKEENTRY is specified in flags */ if ((cnp->cn_flags & MAKEENTRY) != 0 && cnp->cn_nameiop != CREATE) cache_enter(dvp, *vpp, cnp); From nobody Fri Jan 17 13:53:08 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLm50PBPz5l1D6; Fri, 17 Jan 2025 13:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLm468Bhz3nsG; Fri, 17 Jan 2025 13: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=1737121988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jELqylI9CwVxayUCppTWbvOC9vo5QAHCeAaMHslmoNM=; b=jMv9il00owNhZZ3nozNNNOKFmLqxxbqoO6sQR8Cl1zPdx5HJRQ66i0SVMAo1Vgc9hzTez7 VtnR74WGoBrsH4sVL9PZO+VgPGF4Emra0e6ayABhMMtfSMlxIjTD75RyydrH7uK2hFpU1s m7JWJofZZKZP8Eypfy9Gi9C67m6mFmTBnM7aGyzoicTrI8G9YRZTmLljOq/ozLi9i/8+ie 8haCHxWH45+cPRiO/ynn6smGGzBYU3AHZjqqCIoRa6Zs8Q3ts/0dzU/nS1/3K+rlIUAjli Ur5df0cYkaTWpeo80a85/B4OFlvClCKUyA1BZ9XGV7au0z3+hVIpR3uiTnwBMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jELqylI9CwVxayUCppTWbvOC9vo5QAHCeAaMHslmoNM=; b=LTu08wC1mEZQqcQim0fLXSWWntmSMvQOtfDybi8SuFsHJlRphpzWK6jP3aG14OrdnXSBb+ C/qOuXHe4YRbDLbClb8OKVlOPxFgNxdFJyN7/hb3J3F9Gxuaow2mkEMTkExxc1jCVBWdZX IRGHp3NRp5DDfj7RaRAxZWjkCwI5AfEGNJbgHi9Hz7jVI/4zOSFyYCATs7K7WqxPhK7rTk iJK2rb16y7vl2ioaB+XFpWDTa/rUbxhWGmD0sR8k7jJ5SIXS7fX7uhXqS+tbZeHQ+a+kJA suUMG6Acpvmnb2u3scfw0HdvOqlPnaU0PkM8B3+BXIaHC7GTYuoNVypRV5UHsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121988; a=rsa-sha256; cv=none; b=bFN2Kj4vO+chjjxg/X+4P0Ge6Ldu50obugm+rCyAfVh/fXy9jqc1hztgeXbcWJBcNSOQDl rvA5HQm85V44ZZ7M1CfOwUF6qOxeau/BhSZByNJAyGtZVmkGvM0O74Cd0Jj1c5rfTxgw0m 0PmhEPM+OVsNY8KJZeuDvrj/r1afcTg3zBjCZecOUj0O8RfIJ65DSaAISx8zANEQLL+t+B dL4nHOvn0uitLt2Yk5WvYnA5Gt3aDwsm1/evhOFUMu1Ywm0FXBD7OXt1PpRFe7Rs7Qw5pl 0JX7B4f1b4rRx4yRAFLtH5UsMUpMkkbKqCmaDgcAwNajzOjS/4j3Ub43ZHfFFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLm45gh8z5YR; Fri, 17 Jan 2025 13: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 50HDr8Hk022443; Fri, 17 Jan 2025 13: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 50HDr8ae022440; Fri, 17 Jan 2025 13:53:08 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:08 GMT Message-Id: <202501171353.50HDr8ae022440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 155987e20190 - stable/14 - tarfs: Fix the size of struct tarfs_fid and add a static assert List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 155987e2019089a5bd2eef77ed7bcc5cc26c362e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=155987e2019089a5bd2eef77ed7bcc5cc26c362e commit 155987e2019089a5bd2eef77ed7bcc5cc26c362e Author: Rick Macklem AuthorDate: 2024-12-06 02:09:27 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:50:46 +0000 tarfs: Fix the size of struct tarfs_fid and add a static assert File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid. This patch packs the structure and checks via a __Static_assert(). Reviewed by: markj MFC after: 2 weeks (cherry picked from commit 4db1b113b15158c7d134df83e7a7201cf46d459b) --- sys/fs/tarfs/tarfs.h | 2 +- sys/fs/tarfs/tarfs_vnops.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/tarfs/tarfs.h b/sys/fs/tarfs/tarfs.h index ff1985e488cd..ffb95d2c0ac5 100644 --- a/sys/fs/tarfs/tarfs.h +++ b/sys/fs/tarfs/tarfs.h @@ -165,7 +165,7 @@ struct tarfs_fid { u_short data0; /* force alignment */ ino_t ino; unsigned long gen; -}; +} __packed; #define TARFS_NODE_LOCK(tnp) \ mtx_lock(&(tnp)->lock) diff --git a/sys/fs/tarfs/tarfs_vnops.c b/sys/fs/tarfs/tarfs_vnops.c index 8c97fab185fc..afb8e05f5929 100644 --- a/sys/fs/tarfs/tarfs_vnops.c +++ b/sys/fs/tarfs/tarfs_vnops.c @@ -668,6 +668,8 @@ tarfs_vptofh(struct vop_vptofh_args *ap) { struct tarfs_fid *tfp; struct tarfs_node *tnp; + _Static_assert(sizeof(struct tarfs_fid) <= sizeof(struct fid), + "struct tarfs_fid cannot be larger than struct fid"); tfp = (struct tarfs_fid *)ap->a_fhp; tnp = VP_TO_TARFS_NODE(ap->a_vp); From nobody Fri Jan 17 13:53:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLm61DmJz5l1LB; Fri, 17 Jan 2025 13:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLm608Ljz3nmT; Fri, 17 Jan 2025 13:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J+LROAQLUmGzRwsrZOz3Nl8zoG9Bs4WFbUnnA37REN0=; b=wKRNQZ9qZknb8F7vQYFklnrnpDcX7zMMkC8kywyCFKrIBeJpCmBjXqp8EfuhAMWdCjVDaW d4gNPVlXSnZsWEydWgu28HWYUjfy8EbckgdF6UCJOQI7rmfGGcAF6KlM8Ok1O3XnXL12cq GAgDQZmiBgwi9WRPviAa4YiqiaBcQUfblqjVlK8AsnX9HQE/cW2YAKMsQFV0vIIoFGEkw0 foPXEFt0ZtUPieuf7/HTPWz8R9Rd7kSnMHFbxJgsuXkyC2TME4a2ebwFFhDvdkX6+btOvV OiOShRCrNJXvzUHGFeLuq6nnMqx3ods0yQ2W8U03uJla7CVAef25uS5iRxBOiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J+LROAQLUmGzRwsrZOz3Nl8zoG9Bs4WFbUnnA37REN0=; b=CZDlukMZ4PFGrMCREkmMEPiUavbiOHbKZV+Zq3NIqePIlimskoo5dAG+BAkw87VTEojCfC SHqxbsAa3x23eBT47mLA96TES7LCnG00nSdaqmT0zRx/zAB875LZv/1NSEPKa7vEQM5PP/ hcRQJ+12SsxWqsKkraql3CCgiWZJn+FvnSrmHOImHhBaXtrqYu5qead8kjXreTWsg7rGIM ZlMbSeD/zzsxdgpSgn85Gde3M8VhIhw3EQ86NeZOqU+TRQbT9xlnw7cY4rEtdcHNE346/Y 8+1mNC8B+tvMt4o7rgh8gXFSzEWrH9+J1V2rXay0/Z+GXhT0HrYyrst9rwS16Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121990; a=rsa-sha256; cv=none; b=Sw09gNAI7Vap1Xc2ApP9Tb0hWkYgwIBdz0rBnW/Am9hEaaxRCO4xdmsr23Mb9VaCKGLf6a ++hdnGFSc//w3tYeT1pcigob5Y3+uJwxgFckSqJ46tBiJkWJjjscpSpaMUb4Pj93iILNH4 Qa5f555jhYa8np/Z971uh2zD9w/Vums0aIPVGvpCh4pgXK6t2xO+eF55FD5t6EZKbTkmss VfUlykepEPWGxWgPXZUjtPKhetp73jon9tHoMYFjr8iykyoMlBSC3OlAj2Mr2w0tUV7b9U 5I+RplkxA/px/u/DbqIMhNeC+JAZYGtDgPdD3sLBe73wsx0d51Ljh4HZChDdVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLm56l2dz5YS; Fri, 17 Jan 2025 13:53: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 50HDr9pi022503; Fri, 17 Jan 2025 13:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDr9rG022500; Fri, 17 Jan 2025 13:53:09 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:09 GMT Message-Id: <202501171353.50HDr9rG022500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4634282f8908 - stable/14 - tarfs: 'struct tarfs_fid': Switch 'gen' to 'u_int', avoid packing List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4634282f8908406fa395a2b49a8e4c06c07830e4 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4634282f8908406fa395a2b49a8e4c06c07830e4 commit 4634282f8908406fa395a2b49a8e4c06c07830e4 Author: Olivier Certner AuthorDate: 2024-12-06 16:35:08 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:51:32 +0000 tarfs: 'struct tarfs_fid': Switch 'gen' to 'u_int', avoid packing As the 'gen' field in 'struct tarfs_node' (and then 'struct tarfs_fid') is filled with arc4random() which returns an unsigned int, change its type in both structures. This allows reordering fields in 'struct tarfs_fid' to reduce its size, finally avoiding the use of '__packed' to ensure it fits into 'struct fid'. While here, remove the 'data0' field which wasn't necessary from the start. Reviewed by: markj, rmacklem, des Approved by: markj (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D47954 (cherry picked from commit cf0ede720391de986e350f23229da21c13bc7e9d) Sponsored by: The FreeBSD Foundation --- sys/fs/tarfs/tarfs.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/fs/tarfs/tarfs.h b/sys/fs/tarfs/tarfs.h index ffb95d2c0ac5..46fa8b55b3ad 100644 --- a/sys/fs/tarfs/tarfs.h +++ b/sys/fs/tarfs/tarfs.h @@ -74,7 +74,7 @@ struct tarfs_node { struct timespec mtime; struct timespec ctime; struct timespec birthtime; - unsigned long gen; + uint32_t gen; /* Block map */ size_t nblk; @@ -161,11 +161,10 @@ struct tarfs_zio { }; struct tarfs_fid { - u_short len; /* length of data in bytes */ - u_short data0; /* force alignment */ - ino_t ino; - unsigned long gen; -} __packed; + u_short len; /* length of data in bytes */ + uint32_t gen; + ino_t ino; +}; #define TARFS_NODE_LOCK(tnp) \ mtx_lock(&(tnp)->lock) From nobody Fri Jan 17 13:53:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLm85kSGz5l1Nb; Fri, 17 Jan 2025 13:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLm81zbMz3nVL; Fri, 17 Jan 2025 13:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ENucwjJtxm7ru5zcnIv1f4qJ83OhaD0qCCQKSdEkNww=; b=EalTxmxXRaPhMzST+nTlMrmNRnsEI4i22GT5jAlzSdSmandka7tKKgY3E28izhkakyUgWl +T9v+KiernwMLvFHEJSwISIi8gyD5eAl+M5Gc0MNbGcz+rPau/pG0IPzKH0oW+eL6lzrx2 zH40xvyDTvmzTiM42GSrb7JevoCszEvO3gSJVyLoc1Hid2ThHYey3lqvgnDGh5TWxWAQJm lQpNa49P0ir8GSNWrmMAsdZMwASLEmf4B3Ke0drZz/dw78q0Ie3PM8e7UJ2S2JEHlWG21/ L9Pwy+h9lxZq6qmj+T0WvujWBv//ltFt+tHwCKgh3CAka7AKFMCfPYsSwWel7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ENucwjJtxm7ru5zcnIv1f4qJ83OhaD0qCCQKSdEkNww=; b=nT+FCAJEWIuyrs7XFYzT87szNhGftS5Rxs5q/A98AgTb52pS3qGtXbFDGmjNZ9aAYZFXHB kU0qB5DBXG5jxwjEuM4YYJK3/EyPcWrxDUFdQCwRmp/4mkqXoNGjjZcy4lV2P9guTWNN5U RoToyBYTXSGJEIkbkAaj3TxLQtMzSgkajOZ7NWrXro1LmiTcv8STr460x8+6JpA+HJw/+i 0/q+UlGmo9eczThSKMcGaUfKY7pDecixL68A1m6OEEtOYZjJqw6Nm0Q1zgE5JtoVRLo3g9 3gNL6m/9MEVbe2+1P59JKvFSRve4MLmVwW+tu5Z2cD4ZBwhA9ZYU8nyuxpWcfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121992; a=rsa-sha256; cv=none; b=dmrbPlTD/7wEbCV2aEVhCu1lUx9s+XYujzBypLzk8cTOAcxvJ628zREQaoT07a1D/PJe4q /jXILh5Xj+0jCpq85kP+uTj9UxjPb7pLu5sdJWZKrQd7f5thT69hDZFHFQXsTwPXNthQ+c dHb1v6hVDMp51J4O59LT3RoyUBxBKChMkKDR8RC0cQykhfrWZFn6fUjeFR+KW1kaH+9PFj i0nYz7QwPvtOH84EolESyEdl8JRyPlOsAyCFtoF55OyAy2WE34wYVDOL4Fy/XILTNiCcaU pQTMTAdeYOesHDwt3XmWGq7Q0KX5Hdzp3b6vqawrZPECq4CUdxkpzxzq3qkVGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLm81ZHpz5b7; Fri, 17 Jan 2025 13:53: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 50HDrCDt022615; Fri, 17 Jan 2025 13:53:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDrCij022612; Fri, 17 Jan 2025 13:53:12 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:12 GMT Message-Id: <202501171353.50HDrCij022612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 6b1a5d3535d9 - stable/14 - ext2fs: 'struct ufid': Re-order fields and unpack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b1a5d3535d9211279667cec62c507caa001a410 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1a5d3535d9211279667cec62c507caa001a410 commit 6b1a5d3535d9211279667cec62c507caa001a410 Author: Olivier Certner AuthorDate: 2024-12-06 16:37:56 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:51:54 +0000 ext2fs: 'struct ufid': Re-order fields and unpack Re-ordering the fields suppresses the trailing padding which was causing the structure to overflow 'struct fid'. While here, re-indent in a more visually pleasing way. Reviewed by: rmacklem, emaste, markj Approved by: markj (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D47955 (cherry picked from commit 8ae6247aa966989412bd75fc7c26728690b9e944) Sponsored by: The FreeBSD Foundation --- sys/fs/ext2fs/inode.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 14d2d6454737..4c7ee0789529 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -189,11 +189,11 @@ struct indir { /* This overlays the fid structure (see mount.h). */ struct ufid { - uint16_t ufid_len; /* Length of structure. */ - uint16_t ufid_pad; /* Force 32-bit alignment. */ - ino_t ufid_ino; /* File number (ino). */ - uint32_t ufid_gen; /* Generation number. */ -} __packed; + uint16_t ufid_len; /* Length of structure. */ + uint16_t ufid_pad; /* Force 32-bit alignment. */ + uint32_t ufid_gen; /* Generation number. */ + ino_t ufid_ino; /* File number (ino). */ +}; #endif /* _KERNEL */ #endif /* !_FS_EXT2FS_INODE_H_ */ From nobody Fri Jan 17 13:53:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLm81qk4z5l16M; Fri, 17 Jan 2025 13:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLm73dSGz3nGS; Fri, 17 Jan 2025 13:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IhU2u2V86uJHLnfRxOe5+q9ppBekx+fd8SK+ve6wyU=; b=U89w92b4cv6JV3VpwSTUYLjwyss7MSm17EX+Wc59/7SBroFFNhXTGsNfnjOOsZb6WcXGpr 9QivNzDndJMbmcmfjpU5ytJzn4Ku1N/bJ0JOsaFeb63VE8KmKlKNrjVdo6WZKXymhKeMTi V5gyqineAXLYgc/esw58rL5u9sBIN0YX03rkJNjvtI7fd23h0sX8v4WrIGFrLZTETVYAQI O/oIfDbPoiYhcxmDrZQFknBDHgDKgafMyXE1JDdlxe8vfEz9PIr1/UdGKbPrGrT8bf7o/n yQrJtaqz2i83LTgbwPbxtn9mKCVWDDghtuO1VIVhgFhEevdINKQyPwyUEbO0BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737121991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3IhU2u2V86uJHLnfRxOe5+q9ppBekx+fd8SK+ve6wyU=; b=IUvsBIek59rxZ3aPKHB82khWCFHMFGTfGxLUlHXKITZexNOdduty+fmfQUdDYnuCR5onxa +QYy4ZWFOfYbRr0OjSnaL4a6X/cZUFZoXM4R3kAPIuDKi7rGRQcWXEiXFfdvzhsFSLZKAw wpTy3KpoX5XXR4fMo6v5gU6ywyw+VfJJzm0eJKcISlmCErA5r4ZphwnNmxaWcSAB5MQCOY hT/4wkFPV7F5RtKAu02OBolW/spUsG0N5Ojv4g35r19D/VXq7GTp1iOp0MX7uClgwSw9ZN IXmlXJbG+Ju6R662fRuQJ46q15ZFb1zB291lRncJGmW/RB8LnbD04j1SZ+lkuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737121991; a=rsa-sha256; cv=none; b=EpMyEwY6fMtxLmotKE9fmOcJkvBT8lvtNgVUsV3TSETl4gsg7x29uRl0D/q9eTI9/6GD7F GUDqBypFSssOFrRNAO8F31DnA8drQeLfEZ/PA56QFdXBy2U0PmD9nZQ1J1OtaXU8T87202 ovo/LG2uwE7sqSNsBdTHPdKRBM6vYO+33OBGJi5vBbZZ4R303DFZCpjwA8PCxur1sX3Pji kA37bqTpT0CKmxrGtoZro+InY6vleUeJxXGXjEZF+kiJHd6wR74ntXCtQEqaGmZUg5I/UF AFgt/FrdGiylvY6vh7Ia0HiOyv7vE3JlMoretTDWdeSCcpPQ9Ozdvn2+1Acvqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLm70HvLz5TT; Fri, 17 Jan 2025 13:53: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 50HDrA2m022567; Fri, 17 Jan 2025 13:53:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HDrABM022564; Fri, 17 Jan 2025 13:53:10 GMT (envelope-from git) Date: Fri, 17 Jan 2025 13:53:10 GMT Message-Id: <202501171353.50HDrABM022564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 7a3a0402aeb6 - stable/14 - ext2fs: Fix the size of struct ufid and add a static assert List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a3a0402aeb626a7379addd344cbfd8900e83baa Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7a3a0402aeb626a7379addd344cbfd8900e83baa commit 7a3a0402aeb626a7379addd344cbfd8900e83baa Author: Rick Macklem AuthorDate: 2024-12-06 02:05:06 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:51:53 +0000 ext2fs: Fix the size of struct ufid and add a static assert File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid. This patch packed the structure and checks via a __Static_assert(). Reviewed by: markj MFC after: 2 weeks (cherry picked from commit bfc8e3308bee23d0f7836d57f32ed8d47da02627) --- sys/fs/ext2fs/ext2_vnops.c | 2 ++ sys/fs/ext2fs/inode.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index 1c4b62bb4086..79d50a6a64cb 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -1892,6 +1892,8 @@ ext2_vptofh(struct vop_vptofh_args *ap) { struct inode *ip; struct ufid *ufhp; + _Static_assert(sizeof(struct ufid) <= sizeof(struct fid), + "struct ufid cannot be larger than struct fid"); ip = VTOI(ap->a_vp); ufhp = (struct ufid *)ap->a_fhp; diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 46e6215aff6f..14d2d6454737 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -193,7 +193,7 @@ struct ufid { uint16_t ufid_pad; /* Force 32-bit alignment. */ ino_t ufid_ino; /* File number (ino). */ uint32_t ufid_gen; /* Generation number. */ -}; +} __packed; #endif /* _KERNEL */ #endif /* !_FS_EXT2FS_INODE_H_ */ From nobody Fri Jan 17 14:00:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLwm3S4cz5l1vs; Fri, 17 Jan 2025 14:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLwm2ZlYz3q92; Fri, 17 Jan 2025 14:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737122440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5a5nU/WIK5+f/zu/yIPQJ061DYrwNjuam8remalmpv0=; b=YTaVwetCzne/micwKo2S/qg7ny7ApaBgApz4ef+UbT2i4JeYJbnAPNZbs4KDeDFNHxd9Y8 Djyw4Xo5zfv34BzCNR7CMqNY0w6eR6w8Yy4rQzccqzEf+0IAyD4XcrQGVkDH+sFZACqWtN l7irEQDM4KdDsYnX51BlPSGLl7WZP23t7QEADEY6yQGA8QNGVdt/0E2roWSVuD0uOTPKAm 7m805Uk5RQUpYgQzPvr7Q//my2gDhTXl0zzNckPVRvs3g9oI/3AFfisYsSQSYcTxynb+8h k3prlXZIAUBdyEvLo61uPv4D2DrztJRKcdASC/Ai0yfIv9puCLC/jTM4gFkJKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737122440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5a5nU/WIK5+f/zu/yIPQJ061DYrwNjuam8remalmpv0=; b=mtlRQ8QBCbApXxFvjJ5iTrCXcET/F41mwvUvCePCmISE0P/3v6F99WtH/th4+b/rgY3WTH KnOmMIz+obgdqIWiY3turfXvvXpj6cwOf4JZK6B/BWDYVAiTas1vnag2pp6egRyXnHyny0 inTeKODZifJWqYZAgYzG2tmi5vVsnv6YKg7COVWQrUojfu8uDR06d8VuH9Cf8MxWftbBjz yp/bX2yTGOeKvAre2GuFDWWtDL1M6LrpaSa2/N9M0URatdJC/cA2cXx7ip4tSXQQAWgbDQ zsbbTKxsvy6mM6KfXAmAuwtVfPyTIq/RIQo4lE/nSnfYiCCETiw94z9Qea8AAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737122440; a=rsa-sha256; cv=none; b=lgGnnj2oOo7hCM2QkwiUZKpiv2WttWRMpayHfifdNuGdCGY/jndRawXnU2CaXuik8r2lYe i/7Qim7rUlEspChPYxoQCJo2sXpk8PyhbR1teaaDAg/ac9zdizZZx/WjZuyKL87IaXRPjr ShO5AsEZWBlu8DocE0+OwQCzULA05wSUcYBG7OkzB6elbPXCR//6IzhRPTKPX8mWiAEAqF qC5UEJvkSIHqN+u1LUTihOji0cI2PzrvvaKWpPZIVpcXXSrS8mdZu6SEbXrfsqSUgLCbMU fnLpRZyUx9LlGZBkUDkAFPoUsfQ4GA4/PQ8pjQ8vwjLG8LtJFSMWfovcQG0qLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLwm1yYRz4wn; Fri, 17 Jan 2025 14:00:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HE0eBj034710; Fri, 17 Jan 2025 14:00:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HE0elF034707; Fri, 17 Jan 2025 14:00:40 GMT (envelope-from git) Date: Fri, 17 Jan 2025 14:00:40 GMT Message-Id: <202501171400.50HE0elF034707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ee931cf4a49c - stable/13 - ext2fs: Fix the size of struct ufid and add a static assert List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee931cf4a49c90487c938fa14b856401582a045c Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ee931cf4a49c90487c938fa14b856401582a045c commit ee931cf4a49c90487c938fa14b856401582a045c Author: Rick Macklem AuthorDate: 2024-12-06 02:05:06 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:59:44 +0000 ext2fs: Fix the size of struct ufid and add a static assert File system specific *fid structures are copied into the generic struct fid defined in sys/mount.h. As such, they cannot be larger than struct fid. This patch packed the structure and checks via a __Static_assert(). Reviewed by: markj MFC after: 2 weeks (cherry picked from commit bfc8e3308bee23d0f7836d57f32ed8d47da02627) --- sys/fs/ext2fs/ext2_vnops.c | 2 ++ sys/fs/ext2fs/inode.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c index 01b94abf6cd5..63c4830b95be 100644 --- a/sys/fs/ext2fs/ext2_vnops.c +++ b/sys/fs/ext2fs/ext2_vnops.c @@ -1884,6 +1884,8 @@ ext2_vptofh(struct vop_vptofh_args *ap) { struct inode *ip; struct ufid *ufhp; + _Static_assert(sizeof(struct ufid) <= sizeof(struct fid), + "struct ufid cannot be larger than struct fid"); ip = VTOI(ap->a_vp); ufhp = (struct ufid *)ap->a_fhp; diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index 6b8b23ccab14..c29a64be12e0 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -189,7 +189,7 @@ struct ufid { uint16_t ufid_pad; /* Force 32-bit alignment. */ ino_t ufid_ino; /* File number (ino). */ uint32_t ufid_gen; /* Generation number. */ -}; +} __packed; #endif /* _KERNEL */ #endif /* !_FS_EXT2FS_INODE_H_ */ From nobody Fri Jan 17 14:00:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZLwn4J9Mz5l1fJ; Fri, 17 Jan 2025 14:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZLwn3Fszz3q94; Fri, 17 Jan 2025 14:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737122441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=27fsh5d65+iI0+0xLU8zEvB8GNMJ/CS5aKm+IoF2bB4=; b=abXnMeSKTEryxw5D5N6tYSn035Kh0kDn8WV76dsvn9YCXMzXWwEpmfGna+oDBdnXsyHA43 9De4AreYlYhPsCuB/lyqIPzrPt1sUzJn9AtECu07Cq3MTKpljxDByhsGPj5YGn/rQMX4cW rNNo8TGsM/DKrtaFTqu/mqXHdbOUCIIN80YLgYVTDku56M8hSa6PH3fpermYVg/UvQ37jN XUPTlJdlYM1alu7sLdXapBExFFuN54zjs3Y1yxmPcJqrwHX9Il/FpUgXIgarwlsuG/qUiw aoFvZ8lOPp8FwPJs5tDsKwrwIbtUH+EChQ1fM+sw4eVywRg0OnoM5tWfw+zMrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737122441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=27fsh5d65+iI0+0xLU8zEvB8GNMJ/CS5aKm+IoF2bB4=; b=LiPYKU7OkMdPYE5o+z1U4+U+++9w8uCR4hicwcbvZU8/utIHDCpSSur8l9K+4PJTduJGwd WJ5zx/IEekGpzymYtdBlHPruwI1u1LaS4Sg3PmK5VsmO3p+uNpAtW5zZgQvy/VYLliXX7v PnHNvTlsDXa4OpAqq4ylJhIv859Ks/9MWxQzuXenrbuQz8cO2G36ZN5R+Q3LHuGBIIo/+w I0cxT9ajHIv9vnrJEEgKBaRX4mI1KuIWU6x4ZlTo306o7G41+ihkxlEFnjMUgmmDcrTkj+ AU9kLmu5SCaPcQ6aLpxGErNaRhDZTydyI00HukNX8M+yl2Z7jYcPPuUHnn72mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737122441; a=rsa-sha256; cv=none; b=AEHDGGH5ateSYFlhS24xkIn4LNqkQ6pJ3g5I5rXxgjzRrjF829cphc9gaw89bPntZRtw5p iRHzH10w3ynwYHJ3Fto/VpqkHpbBQDMem27SKlaqJb/13D7dRW22a4zCc5DL34zJsJ6p9T CA5VhUNiqe7EAk18ms0qv4foTE7nICJpgQaFxqH/rn3uCkpjVpv5oelx9otEMh+uRArjMK gCJblbw+sOWXVnFfhVf3UZh5gE1aK3raNc046SzbRdTAQUTJ1nbJrwkMkLQ/MpcM9NMg0L DG5eoaON+Fh08jGTRWC3HIHa8VVlPOD9bEJ7BRbBnUYxXrQt+cQbkwNgoflhfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZLwn2gDlz5Kl; Fri, 17 Jan 2025 14:00: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 50HE0fkr034758; Fri, 17 Jan 2025 14:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HE0fc2034755; Fri, 17 Jan 2025 14:00:41 GMT (envelope-from git) Date: Fri, 17 Jan 2025 14:00:41 GMT Message-Id: <202501171400.50HE0fc2034755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: acdc59f0924a - stable/13 - ext2fs: 'struct ufid': Re-order fields and unpack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: acdc59f0924aaddfa321741af05e08d2a6715d1a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=acdc59f0924aaddfa321741af05e08d2a6715d1a commit acdc59f0924aaddfa321741af05e08d2a6715d1a Author: Olivier Certner AuthorDate: 2024-12-06 16:37:56 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 13:59:53 +0000 ext2fs: 'struct ufid': Re-order fields and unpack Re-ordering the fields suppresses the trailing padding which was causing the structure to overflow 'struct fid'. While here, re-indent in a more visually pleasing way. Reviewed by: rmacklem, emaste, markj Approved by: markj (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D47955 (cherry picked from commit 8ae6247aa966989412bd75fc7c26728690b9e944) Sponsored by: The FreeBSD Foundation --- sys/fs/ext2fs/inode.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/fs/ext2fs/inode.h b/sys/fs/ext2fs/inode.h index c29a64be12e0..225a8b0d0901 100644 --- a/sys/fs/ext2fs/inode.h +++ b/sys/fs/ext2fs/inode.h @@ -185,11 +185,11 @@ struct indir { /* This overlays the fid structure (see mount.h). */ struct ufid { - uint16_t ufid_len; /* Length of structure. */ - uint16_t ufid_pad; /* Force 32-bit alignment. */ - ino_t ufid_ino; /* File number (ino). */ - uint32_t ufid_gen; /* Generation number. */ -} __packed; + uint16_t ufid_len; /* Length of structure. */ + uint16_t ufid_pad; /* Force 32-bit alignment. */ + uint32_t ufid_gen; /* Generation number. */ + ino_t ufid_ino; /* File number (ino). */ +}; #endif /* _KERNEL */ #endif /* !_FS_EXT2FS_INODE_H_ */ From nobody Fri Jan 17 15:18:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZNfs51dpz5l5w9; Fri, 17 Jan 2025 15:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZNfs45Wtz42d8; Fri, 17 Jan 2025 15:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737127125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOdl09di78/g664CEYdu9Q6rhhxfWOSDTcrKw9gBYLU=; b=exJKeBENl9QfETCgY+ugcXi27bSeCAU5lqq6KVbiMw+G8hwXbbfHvUB4pkF5+p7fuk3Quz DGsCkRlwetVBsm1s/Y2KFVexY/8UGf9eezKw3ptAOan40374cpBgMpXa4PHLQz5I7wy6xU buBf6US4Q8kV/QViQkcP25Ke+s5uqyNRCt8SpUqefVggzSchs0HMZBHBFd1h2YM878XmU6 a4ISxp8xu9D7IoBRuvCc4PJpFJVsM2SbG9R8y+d6OWCeOaA+2Cc2P6BqGsBno0JLSBNRrQ 6ITmdI+qtDTO60MKwUZJS7phNixkUM6nczFbL11K3Lozdbf/OqOUDaZNBiPDDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737127125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOdl09di78/g664CEYdu9Q6rhhxfWOSDTcrKw9gBYLU=; b=h2lzQ0xCzMrVidCEdcx53vUqjPuJNF4drb7eSKL+dM5oH7gTjtm36q9rAQrsw6xsF3C8ja t1JQpDmXoRFZuF7pnku9aX5dBQYWDivgZaHYwh9dTc9rFNiSZixtpmjPddkekk+JrQLjyO 4HjNRyDIBRjNfT+wZYsSekzakyMhgY7D19CmVyy/tUy50FZaZKlNZf6d5FiR/hCOeCo3yR cWk+NZ1q+7+Qhh/6VX5nv0/h+6paaJjICId6AKntih/QrZyyMyMBG9GvTcX2paWH9HR1b1 Ys1R/NLuvaYbmyYtyQWjAq5omuOOwFXmMlVpSty7dEEf10yDAwzpQGeNyaADeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737127125; a=rsa-sha256; cv=none; b=P68JmkfabGraLp2MsUTOhKw/RdO5Tfj1MoFwBzuYRnMJX5oLUWZ674YOWjWRK+9tPIOWG2 mkiKEh43o674/fd8UiX9qge5K186o/ApuMIUot/3Ib1KYoeDPmGIylX+Kx8S0Qwcn5cFoD KxcZTQqa8yg8B2vbWC/xz99lpIp1w+08rFL49WiUTFGx8vmz1xKZCxNvPxPYG3GnDG/76W NibpyGyCEEeCp66LfewQo+KbL+TSSqpkKqqfxM8/eTn0xjC5YaXt/+ujQPG4PaqwQXvxd6 oJA4SS+bchQ1Ih8iCn6Z3Tqf4kaI8ob8NIGYN2n3Dd4o4LBLitLqbhyOTwhpzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZNfs3JMKz7pj; Fri, 17 Jan 2025 15:18: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 50HFIjBg074744; Fri, 17 Jan 2025 15:18:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HFIjGl074741; Fri, 17 Jan 2025 15:18:45 GMT (envelope-from git) Date: Fri, 17 Jan 2025 15:18:45 GMT Message-Id: <202501171518.50HFIjGl074741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d355c28a0954 - main - depend-cleanup: bea89d038ac5 also moved memchr List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d355c28a0954de487e45c4349631c2b9449ba28d Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d355c28a0954de487e45c4349631c2b9449ba28d commit d355c28a0954de487e45c4349631c2b9449ba28d Author: Ed Maste AuthorDate: 2025-01-17 15:05:26 +0000 Commit: Ed Maste CommitDate: 2025-01-17 15:17:45 +0000 depend-cleanup: bea89d038ac5 also moved memchr Commit bea89d038ac5 added strlcat but also introduced a memchr wrapper in the source tree rather than using the autogenerated one used for AARCH64_STRING_FUNCS. Move memchr.S to MDSRS and add a cleanup rule for the old wrapper. Reviewed by: fuz Sponsored by: The FreeBSD Foundation Fixes: bea89d038ac5 ("lib/libc/aarch64/string: add strlcat SIMD implementation") Differential Revision: https://reviews.freebsd.org/D48502 --- lib/libc/aarch64/string/Makefile.inc | 2 +- tools/build/depend-cleanup.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 9574aad95933..f0f0f6495782 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -4,7 +4,6 @@ # AARCH64_STRING_FUNCS= \ - memchr \ memcmp \ memcpy \ memmove \ @@ -19,6 +18,7 @@ AARCH64_STRING_FUNCS= \ # SIMD-enhanced routines not derived from Arm's code MDSRCS+= \ + memchr.S \ strcmp.S \ strspn.S \ strcspn.S \ diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 30c303d4f90f..b7695370f1dd 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -270,8 +270,9 @@ if [ $MACHINE_ARCH = aarch64 ]; then # 20250110 3dc5429158cf add strncat SIMD implementation clean_dep lib/libc strncat c - # 20250110 bea89d038ac5 add strlcat SIMD implementation + # 20250110 bea89d038ac5 add strlcat SIMD implementation, and move memchr clean_dep lib/libc strlcat c + run rm -f "$OBJTOP"/lib/libc/memchr.S # 20250110 3863fec1ce2d add strlen SIMD implementation clean_dep lib/libc strlen S arm-optimized-routines From nobody Fri Jan 17 16:02:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPd10GMhz5l8TQ; Fri, 17 Jan 2025 16:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPd06mFHz46xD; Fri, 17 Jan 2025 16:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q5O5BSI4Ff2R3FT5sLgjIqQSjUraGXa5K1PGBkziQTw=; b=GYSUtniQBshUoWqDA564Guo+tA4tCzoqv3bPj88CnUpuQWKQbCtC7KXsbEzbkA26UEo8to mzPObrxhLooHdc2/0HcE2aFhYQW9m17PFEbDQzU4tBilgZq1LjAXK9/Cz1+0yRsF7wpfOU 9Cz5ih4u4Edq1nKEC6fcZa0jc2WiSnKPXHfx35x3vOMKjkB72Uz/79jSP7r4xJbh3lHXzY wMM35cIOI/50OXWyEd75CmASru2+qt2tZbNuTa5sUvJWeHTcqZ+h+epQyLrZ6k9cfYaouq ZvEX2LYafd9E0J+T3Sec47U0v+x2HEalLGbC30dg9o7R204rcy1/KjNhtfmsNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q5O5BSI4Ff2R3FT5sLgjIqQSjUraGXa5K1PGBkziQTw=; b=poUw+ko/GpdyCUwtVIFttQtCiSqUX0TN8M9tm8rFewuAKnlW61a2oC0VzndMONZ3cZhVdI SkfhIVbSdppk3XRyhoa1/EEVHBfwYlpsdbgEE18TLwwO1hhMZfLFtdUX8IGd6gKS622WpS m7yAFwUcBew8CQ+enjfA4sRtG7eSK4xCBaiR0iG8Wgs9WJfyqub9mJQpT5pEvRuXcuSLy3 q4ZGRtQcAhlwEy0XnrOh2cTAapuaFWGVXtcOARpDkc1GM6FzOyB4UurISOlzmb9JDal37T xj/JC0y+VYLE3WvlF60uM5qM1Oy/0kbLWKALBm56xz+r0N8AbKb+6fvT5BYFcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737129733; a=rsa-sha256; cv=none; b=jR+/xcglr4aFopzzDiV8+25vYNEIFkd/TktV/dB8TIRe6YymxKIDdDd+gFuGnmvSHTh0LD AaVCQSVD0EcvGnFBeFgdzfhTXK1YVehNCvGu7UWmZdi7WgbDp+Pr849i20c5iMWEiw3S5T b4p/n/xFG1KWDvaTKNLRGUtjsk7L66EyRp68e/0n24Kipz2+5TMW8u0NXzVmsoEvk5lS9W uWbrCOaVQaYKwxz4yhJAVOg96U3+1YyqpF13evsLQqE8n2WUZaLrt+SkRicERdWNDKgo2m muCYpWQfifs7IlGnlKtLT93+Kr66kj+miyfcLhkpdpeyI1IsMRnjQKBRYMx15w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPd067tYz8Lb; Fri, 17 Jan 2025 16:02: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 50HG2CqC065698; Fri, 17 Jan 2025 16:02:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HG2CYU065695; Fri, 17 Jan 2025 16:02:12 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:02:12 GMT Message-Id: <202501171602.50HG2CYU065695@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: 5d28f4cab8d5 - main - pf: clean up mbuf passing for reassembly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d28f4cab8d5919aba1365e885a91a96c0655b59 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5d28f4cab8d5919aba1365e885a91a96c0655b59 commit 5d28f4cab8d5919aba1365e885a91a96c0655b59 Author: Kristof Provost AuthorDate: 2025-01-06 06:56:24 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 16:00:08 +0000 pf: clean up mbuf passing for reassembly When we call pf_normalize_ip() or pf_normalize_ip6() we passed the mbuf twice. Once as m0, and once inside the struct pf_pdesc. Remove the former to avoid confusion when we free *m0, but don't update pd->m. This could lead to use-after-free errors e.g. if reassembly failed. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 4 ++-- sys/netpfil/pf/pf.c | 10 ++++++---- sys/netpfil/pf/pf_norm.c | 17 +++++------------ 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 6c9d75bb1365..6e9418f59aef 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2390,11 +2390,11 @@ int pf_test(sa_family_t, int, int, struct ifnet *, struct mbuf **, struct inpcb struct pf_rule_actions *); #endif #ifdef INET -int pf_normalize_ip(struct mbuf **, u_short *, struct pf_pdesc *); +int pf_normalize_ip(u_short *, struct pf_pdesc *); #endif /* INET */ #ifdef INET6 -int pf_normalize_ip6(struct mbuf **, int, u_short *, struct pf_pdesc *); +int pf_normalize_ip6(int, u_short *, struct pf_pdesc *); void pf_poolmask(struct pf_addr *, struct pf_addr*, struct pf_addr *, struct pf_addr *, sa_family_t); void pf_addr_inc(struct pf_addr *, sa_family_t); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 07b7aa543dbd..3b9c71296a2b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9918,12 +9918,13 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, return (-1); } - if (pf_normalize_ip(m0, reason, pd) != PF_PASS) { + if (pf_normalize_ip(reason, pd) != PF_PASS) { /* We do IP header normalization and packet reassembly here */ + *m0 = pd->m; *action = PF_DROP; return (-1); } - pd->m = *m0; + *m0 = pd->m; h = mtod(pd->m, struct ip *); pd->off = h->ip_hl << 2; @@ -9994,12 +9995,13 @@ pf_setup_pdesc(sa_family_t af, int dir, struct pf_pdesc *pd, struct mbuf **m0, } /* We do IP header normalization and packet reassembly here */ - if (pf_normalize_ip6(m0, pd->fragoff, reason, pd) != + if (pf_normalize_ip6(pd->fragoff, reason, pd) != PF_PASS) { + *m0 = pd->m; *action = PF_DROP; return (-1); } - pd->m = *m0; + *m0 = pd->m; if (pd->m == NULL) { /* packet sits in reassembly queue, no error */ *action = PF_PASS; diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index c9a7f7d2df04..39afde04a6d1 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1093,11 +1093,10 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, #ifdef INET int -pf_normalize_ip(struct mbuf **m0, u_short *reason, - struct pf_pdesc *pd) +pf_normalize_ip(u_short *reason, struct pf_pdesc *pd) { struct pf_krule *r; - struct ip *h = mtod(*m0, struct ip *); + struct ip *h = mtod(pd->m, struct ip *); int mff = (ntohs(h->ip_off) & IP_MF); int hlen = h->ip_hl << 2; u_int16_t fragoff = (ntohs(h->ip_off) & IP_OFFMASK) << 3; @@ -1109,8 +1108,6 @@ pf_normalize_ip(struct mbuf **m0, u_short *reason, PF_RULES_RASSERT(); - MPASS(pd->m == *m0); - r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); /* * Check if there are any scrub rules, matching or not. @@ -1219,13 +1216,12 @@ pf_normalize_ip(struct mbuf **m0, u_short *reason, * Might return a completely reassembled mbuf, or NULL */ PF_FRAG_LOCK(); DPFPRINTF(("reass frag %d @ %d-%d\n", h->ip_id, fragoff, max)); - verdict = pf_reassemble(m0, pd->dir, reason); + verdict = pf_reassemble(&pd->m, pd->dir, reason); PF_FRAG_UNLOCK(); if (verdict != PF_PASS) return (PF_DROP); - pd->m = *m0; if (pd->m == NULL) return (PF_DROP); @@ -1257,7 +1253,7 @@ pf_normalize_ip(struct mbuf **m0, u_short *reason, #ifdef INET6 int -pf_normalize_ip6(struct mbuf **m0, int off, u_short *reason, +pf_normalize_ip6(int off, u_short *reason, struct pf_pdesc *pd) { struct pf_krule *r; @@ -1267,8 +1263,6 @@ pf_normalize_ip6(struct mbuf **m0, int off, u_short *reason, PF_RULES_RASSERT(); - pd->m = *m0; - r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); /* * Check if there are any scrub rules, matching or not. @@ -1323,9 +1317,8 @@ pf_normalize_ip6(struct mbuf **m0, int off, u_short *reason, if (pd->virtual_proto == PF_VPROTO_FRAGMENT) { /* Returns PF_DROP or *m0 is NULL or completely reassembled * mbuf. */ - if (pf_reassemble6(m0, &frag, off, pd->extoff, reason) != PF_PASS) + if (pf_reassemble6(&pd->m, &frag, off, pd->extoff, reason) != PF_PASS) return (PF_DROP); - pd->m = *m0; if (pd->m == NULL) return (PF_DROP); h = mtod(pd->m, struct ip6_hdr *); From nobody Fri Jan 17 16:02:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPd229vRz5l8H4; Fri, 17 Jan 2025 16:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPd20bsjz4731; Fri, 17 Jan 2025 16:02:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F1gU1585Y22fv9Y9BS7Ma/jrappjAKunLRJSYJ1mzZA=; b=D0z21TvnJXFkpDwbcd9bVWdojeUZe4nYmAdwbfmMp0OI0CpMT21HTxNjZuQJO3yAilnzyT pclEqIoyVuvbW8ymT+Z0Pgg2gXykw/nK4NCnH3HBUZiHoCH8b+A8kiSk77TzQXe87/pEeV C74i/YKY371LFKP2V6WcG9m+cvjUo8TkjTBNAUnsAY/gOMkcc6gnhyhWMGFlqNVHFNoLHX tjnQRCNAxbWRLs3PLpy0chm+xHyEBGgSn17U665BSBFuNxnet3Es0ra1y6+vPKDJSQveX7 YPqW734RbWqZB1+Ixwiir5jDiNcf5QMzlz9JHysdFSJoNTUb67vMWIc5CILNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F1gU1585Y22fv9Y9BS7Ma/jrappjAKunLRJSYJ1mzZA=; b=qR0tj1Du2MEjrfMZbRHDGspnI7xCeVQPKIoaR/sZUSC40sXoNiyaXv9n4NMr/x/Uk7OA0L 23BdRjNoosnNomfbMxaMv4JbApiIRh0Q6fxZqLblpiLp4vDrok81X12zwwJ49UMiJGPGQQ 73Y3vGQR7/AetOXv7JC/GEepfG1AMULZMo3YvftmPK3OiP6u5ftyRl5hw8g+KvJD9LcX83 y5CPaHWXOlWMrmKdYcLTXmzPIQYwZGLP7l3WMb/nfPGAlx5mna4yotc4WrFU/YCnLXQD1b uVdUfDSWwPQOsvJrQC0ZBo+XMzhNb5pagEkAp8mN2uiQ2RDn109EI0dCxOZxyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737129734; a=rsa-sha256; cv=none; b=ByzgcgPbzSKkWQjgMCRDGT3IrygXOr7g7xF9QN2ekz3jMmNY063cvA2Z3NdD8fh0LFRuaE V8scY+vJgIpGxWTr7c97I5Oyk1GWiiAexkVmf5OX+dZdvcobsZikstFUel+4x4PG7RLfg9 aWRhaYzoCCfVpbBuP4p0z7MhWaGJiOm1ZshLny8xHvHsiHCmD3gnzZ+jBN1EYLWsWzM0b4 lFkEhfinGHFu7XKouTmAxcwwtsKgP615KhcmG/cDOW+53rN9HT3O0RKwlln/VzoU4Tcxni 1LSdiwZJC46UbcVC8d9Mx7NeUctMPXfTctC3sKlpkzClrz4EgvHkbA3aBiWWPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPd203Ljz8v1; Fri, 17 Jan 2025 16:02: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 50HG2DBB065736; Fri, 17 Jan 2025 16:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HG2DmR065733; Fri, 17 Jan 2025 16:02:13 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:02:13 GMT Message-Id: <202501171602.50HG2DmR065733@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: 76e00c722bee - main - dummymbuf: add 'enlarge' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76e00c722bee123f902febce7b637ea7afa5e364 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=76e00c722bee123f902febce7b637ea7afa5e364 commit 76e00c722bee123f902febce7b637ea7afa5e364 Author: Kristof Provost AuthorDate: 2025-01-06 10:39:32 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 16:00:08 +0000 dummymbuf: add 'enlarge' Teach dummymbuf to replace mbufs with larger ones. This can be useful for testing for bugs that depend on mbuf layout. Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man4/dummymbuf.4 | 4 +++- sys/net/dummymbuf.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/share/man/man4/dummymbuf.4 b/share/man/man4/dummymbuf.4 index 844a7c0565bd..08926d2824c6 100644 --- a/share/man/man4/dummymbuf.4 +++ b/share/man/man4/dummymbuf.4 @@ -26,7 +26,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd August 2, 2024 +.Dd January 6, 2025 .Dt DUMMYMBUF 4 .Os .Sh NAME @@ -121,6 +121,8 @@ tail mbuf(s) left empty. .Pp As a result, only the layout of a mbuf chain is altered, its content logically is left intact. +.It enlarge +Unconditionally replace the mbuf with an mbuf of the specified size. .El .Sh SYSCTL VARIABLES The following variables are available: diff --git a/sys/net/dummymbuf.c b/sys/net/dummymbuf.c index ff566cfb87c3..e88087e1572f 100644 --- a/sys/net/dummymbuf.c +++ b/sys/net/dummymbuf.c @@ -209,6 +209,37 @@ bad: return (NULL); } +static struct mbuf * +dmb_m_enlarge(struct mbuf *m, struct rule *rule) +{ + struct mbuf *n; + int size; + + size = (int)strtol(rule->opargs, NULL, 10); + if (size < 0 || size > MJUM16BYTES) + goto bad; + + if (!(m->m_flags & M_PKTHDR)) + goto bad; + if (m->m_pkthdr.len <= 0) + return (m); + + if ((n = m_get3(size, M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) + goto bad; + + m_move_pkthdr(n, m); + m_copydata(m, 0, m->m_pkthdr.len, n->m_ext.ext_buf); + n->m_len = m->m_pkthdr.len; + + n->m_next = m; + + return (n); + +bad: + m_freem(m); + return (NULL); +} + static bool read_rule(const char **cur, struct rule *rule, bool *eof) { @@ -278,6 +309,9 @@ read_rule(const char **cur, struct rule *rule, bool *eof) if (strstr(*cur, "pull-head") == *cur) { rule->op = dmb_m_pull_head; *cur += strlen("pull-head"); + } else if (strstr(*cur, "enlarge") == *cur) { + rule->op = dmb_m_enlarge; + *cur += strlen("enlarge"); } else { return (false); } From nobody Fri Jan 17 16:02:15 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPd34mqKz5l7xH; Fri, 17 Jan 2025 16:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPd31T24z47GR; Fri, 17 Jan 2025 16:02:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4PgFEaSb4y1oYwc/YjAlYUTihe9PQ9kX9S0skApkXQ=; b=c7begsevFqh4R2xtU9VgK7BehBAAXpmDkN2QHUI/vbHn3uhf6+u4YgFiAirYTT3pLYBnw1 xc+9+hJ706yZxai0C9FumBkshNCdkP5gCQkuAtPAH4/axFS6YD38GLsY1uzE9vxrM2Dmwn YUsi+BSSu1V+q2AZnNp1mLa5hRPE3Jo3DOGskRq9F1nawuwYig1yyJpDsXkIUWjlolPsTA 1hZ9l0XC2+Wt5UGnUlKd0CumscnFQAfmdXA2yOtpJwif2y3Tkd5qjVYZj5mv5g7P1b0D0r tGMcJuD5c8idrECLI7duAmqQIMbVGhenfRhWH4eCfXmNsQIzGBH+ZBTmHy8uqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4PgFEaSb4y1oYwc/YjAlYUTihe9PQ9kX9S0skApkXQ=; b=eBnnwBin7UIVcQzfPh0Ay/qpuA20ZFhXQr+0jxLI3f92YTUVeXXqDvgXQj9GcOOFxXvzfc IXt/QMwWotxxNdHhCvxzwGgDXsDbwAZ4d7H2nk+EwqCFsViUeeUray63xIf9EqwqPU/vuZ PIotMlywlgKDzq+rqK3U9varbBAJYY7eRQplAT+ArYLMrz03VscDTptbKlXhFGNeSYJbnl nCEtSiE4YdlC0b6sBARHEBOT5mt0CIn0ZnS1sticT21p3eDko74bvprJ67VsXN/I9unWGd it7hit0HArUdcjhjf1YZPstSl8G7YsgDgiM/0sPGV6xvA2fnxdRsj93kADpp1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737129735; a=rsa-sha256; cv=none; b=AYp8buWKj306t5btmm/RMbbQRA/Vh5n1aGcSCywpK5JJE4nMvE46s2q2PQ49Apsmy6J3bC Bpr0kvd3gmMzMiBIS8LW1j+3s5+zfprBL8qfS+iGKKecASHWrfrgUnVHsUs0pe8EBYw/rS ZUuLtzg4nCClvVlZU2v47bp50Up4DmSkYHsduwBg+OS8tzGneO8mglPCet/ccvonth3WxU 5hW16z//TeC6lLUHT3E1V780VloxmWLcligFCkkMMPuhRP/VlnohLFI/YcNm0eO2W4i2/s nfIHGSwncu7UgyU3kpqCQe53FsJoahm1BuxBs/+Z+26jxxfMGN5tNi7HaOTP0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPd310qzz95h; Fri, 17 Jan 2025 16:02: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 50HG2F7s065794; Fri, 17 Jan 2025 16:02:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HG2FlB065791; Fri, 17 Jan 2025 16:02:15 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:02:15 GMT Message-Id: <202501171602.50HG2FlB065791@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: 7f846fc0e7ce - main - pf tests: reproduce use-after-free in fragment reassembly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f846fc0e7ce30c80e3265c957a138d7192af397 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7f846fc0e7ce30c80e3265c957a138d7192af397 commit 7f846fc0e7ce30c80e3265c957a138d7192af397 Author: Kristof Provost AuthorDate: 2025-01-06 10:48:40 +0000 Commit: Kristof Provost CommitDate: 2025-01-17 16:00:41 +0000 pf tests: reproduce use-after-free in fragment reassembly Produce an IPv6 packet that's longer than 65535 bytes so it'll get dropped in pf_reassemble6(). This can then causes pf_normalize_ip6() to return an error, which led pf_setup_pdesc() to fail to update *m0, eventually ending up with pf_scrub() attempting to modify *m0 (now different from pd->m), a freed mbuf. This does depend on pf_join_fragment()'s call to m_cat() freeing the relevant mbuf rather than adding it to the chain. Accomplish this by ensuring there's sufficient free space, by having dummymbuf re-allocate larger mbufs for our fragments. PR: 283705 Reported by: Yichen Chai , Zhuo Ying Jiang Li Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/frag6.py | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py index f54381fba8cb..f274fc28a3bf 100644 --- a/tests/sys/netpfil/pf/frag6.py +++ b/tests/sys/netpfil/pf/frag6.py @@ -2,6 +2,7 @@ import pytest import logging import threading import time +import random logging.getLogger("scapy").setLevel(logging.CRITICAL) from atf_python.sys.net.tools import ToolsHelper from atf_python.sys.net.vnet import VnetTestTemplate @@ -19,7 +20,7 @@ class DelayedSend(threading.Thread): sp.send(self._packet) class TestFrag6(VnetTestTemplate): - REQUIRED_MODULES = ["pf"] + REQUIRED_MODULES = ["pf", "dummymbuf"] TOPOLOGY = { "vnet1": {"ifaces": ["if1"]}, "vnet2": {"ifaces": ["if1"]}, @@ -27,12 +28,15 @@ class TestFrag6(VnetTestTemplate): } def vnet2_handler(self, vnet): + ifname = vnet.iface_alias_map["if1"].name ToolsHelper.print_output("/sbin/pfctl -e") ToolsHelper.pf_rules([ - "scrub fragment reassemble", + "scrub fragment reassemble min-ttl 10", "pass", "block in inet6 proto icmp6 icmp6-type echoreq", ]) + ToolsHelper.print_output("/sbin/pfilctl link -i dummymbuf:inet6 inet6") + ToolsHelper.print_output("/sbin/sysctl net.dummymbuf.rules=\"inet6 in %s enlarge 3000;\"" % ifname) def check_ping_reply(self, packet): print(packet) @@ -59,6 +63,38 @@ class TestFrag6(VnetTestTemplate): for p in packets: assert not p.getlayer(sp.ICMPv6EchoReply) + @pytest.mark.require_user("root") + def test_overlong(self): + "Test overly long fragmented packet" + + # Import in the correct vnet, so at to not confuse Scapy + import scapy.all as sp + + curr = 0 + pkts = [] + + frag_id = random.randint(0,0xffffffff) + gran = 1200 + + i = 0 + while curr <= 65535: + ipv61 = sp.IPv6(src="2001:db8::1", dst="2001:db8::2") + more = True + g = gran + if curr + gran > 65535: + more = False + g = 65530 - curr + if i == 0: + pkt = ipv61 / sp.IPv6ExtHdrHopByHop(options=[sp.PadN(optlen=2), sp.Pad1()]) / \ + sp.IPv6ExtHdrFragment(id = frag_id, offset = curr // 8, m = more) / bytes([i] * g) + else: + pkt = ipv61 / sp.IPv6ExtHdrFragment(id = frag_id, offset = curr // 8, m = more) / bytes([i] * g) + pkts.append(pkt) + curr += gran + i += 1 + + sp.send(pkts, inter = 0.1) + class TestFrag6_Overlap(VnetTestTemplate): REQUIRED_MODULES = ["pf"] TOPOLOGY = { From nobody Fri Jan 17 16:05:29 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPhn35SDz5l842; Fri, 17 Jan 2025 16:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPhn2XLhz48tp; Fri, 17 Jan 2025 16:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NBEH58XEo/p9I/XbjkfzWPLkPzPQr2RFI6ZnH8ogqAw=; b=sv3uGmCO/LL0bDM6NakwJjJkV2flM6nAoskrMQU5VNxaRa0GnbhCuCenQtx7UjN7NbsxeE WK2aMFR8xZJNKFx4ziGgo9Ivjw2N7kL4i2M4EaPvx0Ad3sWtD0fTYchoTQ1ujhC75qp3NW kM9RKIrfqgTcXb0cnYudyr19aS0pH0ZsJnT/EGsWl1OyjuH1eOfVNtbi6K+poJc8ppaG6x n6gzmNXawhEZutLic/flXaxMfLgpJzQzdt+lnJbKmXbw9WgFEKaaC5zRG8mCDyvW0wBkGW k1Bc+81/rjJeGv6UhuVXkalowFfHs8spk+BsF6/pt298KNBS6UTcOUTCLIF6nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NBEH58XEo/p9I/XbjkfzWPLkPzPQr2RFI6ZnH8ogqAw=; b=YNx8X3IN/MhSSao9zuqRNCTtO1li4wUX4JUoh/7NwZVOZ8npjHcNAdlqvZ293Yr6rXrRqD AVgNGXGNSMgSB6GCoyukWjHdsd2ZVrvXxL7Gcz4pdwa4b00GxACLeeKITHmWlWOoot/A4W 0PyviAYMmUxLXT+VESG1sK7sW0pueBh3Qsd7ZdYnq7315MZKKc/4k7DhgtgXhkNgvj+evQ cTYx2xO4MOWfCCdj9X8f/QyF5uKA1LnM1Rp4pq+RANa4pUbO3blgLZkSgS+QycQVOBP2Vg uCOqGy7gFkBX70/IheF7wMbyTvtcBD9DVEZrdB5xGaHwbLs4hpqazT2IGA3zmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737129929; a=rsa-sha256; cv=none; b=lCGCsnjMtyDkk0wDF/JzkuFE2CzN04qaxSaAUFu4yrf/59kC8lgGV/J8nNPVXYxDuvcnvv Vl7JIwbPLOP0pI9dJt3FEOSjShi/AVWmxHaTA1mdKP9bxq1+jliue5YmijhkW7Xdgsrprn jR3rnHEfidXKFAulIrpsL9yKv9lSyiUb+4RN98WjcZPJti9ll3oDLpWLXYdsS1swPxHSny XyVLBC+5M8Sfm0bAtUQwIzIbt5ECRdc2flSfbfIgN5JYdb2ZOL43ryePrenc57UFmU/UfP kUd68YxViXs5fi8uZ+ctTATsRrE8cXZ4NwUVzBeAFUkVabOXGpWgmWxF6Fycww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPhn279jz95n; Fri, 17 Jan 2025 16:05: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 50HG5Txc066995; Fri, 17 Jan 2025 16:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HG5T8a066992; Fri, 17 Jan 2025 16:05:29 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:05:29 GMT Message-Id: <202501171605.50HG5T8a066992@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: 31a8b9782dc3 - main - iwm: update rate tables from OpenBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 31a8b9782dc354ebd735db7036d7945f160b2527 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=31a8b9782dc354ebd735db7036d7945f160b2527 commit 31a8b9782dc354ebd735db7036d7945f160b2527 Author: Adrian Chadd AuthorDate: 2024-12-27 03:30:22 +0000 Commit: Adrian Chadd CommitDate: 2025-01-17 16:04:58 +0000 iwm: update rate tables from OpenBSD These are from an earlier version of the driver (22-Oct-2021) which I started to sync against back in 2021. These pull in the rest of the VHT and HT rates. Since that driver has functioning 802.11n support, it makes a good intermediary checkpoint. Locally tested: * 7260, STA mode, 11g and 11a modes Differential Revision: https://reviews.freebsd.org/D48209 Obtained from: OpenBSD (at a6e25c727a2214219715b51ba6af2221d7e0d674, 22-Oct-2021) --- sys/dev/iwm/if_iwm.c | 62 +++++++++++++++++++++++++++++++++++-------------- sys/dev/iwm/if_iwmreg.h | 24 +++++++++++-------- 2 files changed, 59 insertions(+), 27 deletions(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index c8eb46ed9795..15ef139fd5a5 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -197,32 +197,60 @@ _Static_assert(nitems(iwm_nvm_channels_8000) <= IWM_NUM_CHANNELS_8000, #define IWM_NUM_2GHZ_CHANNELS 14 #define IWM_N_HW_ADDR_MASK 0xF -/* - * XXX For now, there's simply a fixed set of rate table entries - * that are populated. - */ const struct iwm_rate { - uint8_t rate; + uint16_t rate; uint8_t plcp; + uint8_t ht_plcp; } iwm_rates[] = { - { 2, IWM_RATE_1M_PLCP }, - { 4, IWM_RATE_2M_PLCP }, - { 11, IWM_RATE_5M_PLCP }, - { 22, IWM_RATE_11M_PLCP }, - { 12, IWM_RATE_6M_PLCP }, - { 18, IWM_RATE_9M_PLCP }, - { 24, IWM_RATE_12M_PLCP }, - { 36, IWM_RATE_18M_PLCP }, - { 48, IWM_RATE_24M_PLCP }, - { 72, IWM_RATE_36M_PLCP }, - { 96, IWM_RATE_48M_PLCP }, - { 108, IWM_RATE_54M_PLCP }, + /* Legacy */ /* HT */ + { 2, IWM_RATE_1M_PLCP, IWM_RATE_HT_SISO_MCS_INV_PLCP }, + { 4, IWM_RATE_2M_PLCP, IWM_RATE_HT_SISO_MCS_INV_PLCP }, + { 11, IWM_RATE_5M_PLCP, IWM_RATE_HT_SISO_MCS_INV_PLCP }, + { 22, IWM_RATE_11M_PLCP, IWM_RATE_HT_SISO_MCS_INV_PLCP }, + { 12, IWM_RATE_6M_PLCP, IWM_RATE_HT_SISO_MCS_0_PLCP }, + { 18, IWM_RATE_9M_PLCP, IWM_RATE_HT_SISO_MCS_INV_PLCP }, + { 24, IWM_RATE_12M_PLCP, IWM_RATE_HT_SISO_MCS_1_PLCP }, + { 26, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_8_PLCP }, + { 36, IWM_RATE_18M_PLCP, IWM_RATE_HT_SISO_MCS_2_PLCP }, + { 48, IWM_RATE_24M_PLCP, IWM_RATE_HT_SISO_MCS_3_PLCP }, + { 52, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_9_PLCP }, + { 72, IWM_RATE_36M_PLCP, IWM_RATE_HT_SISO_MCS_4_PLCP }, + { 78, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_10_PLCP }, + { 96, IWM_RATE_48M_PLCP, IWM_RATE_HT_SISO_MCS_5_PLCP }, + { 104, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_11_PLCP }, + { 108, IWM_RATE_54M_PLCP, IWM_RATE_HT_SISO_MCS_6_PLCP }, + { 128, IWM_RATE_INVM_PLCP, IWM_RATE_HT_SISO_MCS_7_PLCP }, + { 156, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_12_PLCP }, + { 208, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_13_PLCP }, + { 234, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_14_PLCP }, + { 260, IWM_RATE_INVM_PLCP, IWM_RATE_HT_MIMO2_MCS_15_PLCP }, }; #define IWM_RIDX_CCK 0 #define IWM_RIDX_OFDM 4 #define IWM_RIDX_MAX (nitems(iwm_rates)-1) #define IWM_RIDX_IS_CCK(_i_) ((_i_) < IWM_RIDX_OFDM) #define IWM_RIDX_IS_OFDM(_i_) ((_i_) >= IWM_RIDX_OFDM) +#define IWM_RVAL_IS_OFDM(_i_) ((_i_) >= 12 && (_i_) != 22) + +/* Convert an MCS index into an iwm_rates[] index. */ +const int iwm_mcs2ridx[] = { + IWM_RATE_MCS_0_INDEX, + IWM_RATE_MCS_1_INDEX, + IWM_RATE_MCS_2_INDEX, + IWM_RATE_MCS_3_INDEX, + IWM_RATE_MCS_4_INDEX, + IWM_RATE_MCS_5_INDEX, + IWM_RATE_MCS_6_INDEX, + IWM_RATE_MCS_7_INDEX, + IWM_RATE_MCS_8_INDEX, + IWM_RATE_MCS_9_INDEX, + IWM_RATE_MCS_10_INDEX, + IWM_RATE_MCS_11_INDEX, + IWM_RATE_MCS_12_INDEX, + IWM_RATE_MCS_13_INDEX, + IWM_RATE_MCS_14_INDEX, + IWM_RATE_MCS_15_INDEX, +}; struct iwm_nvm_section { uint16_t length; diff --git a/sys/dev/iwm/if_iwmreg.h b/sys/dev/iwm/if_iwmreg.h index d9c7bb7a89f9..296d07bc4b31 100644 --- a/sys/dev/iwm/if_iwmreg.h +++ b/sys/dev/iwm/if_iwmreg.h @@ -4481,9 +4481,7 @@ struct iwm_beacon_filter_cmd { #define IWM_RATE_HT_SISO_MCS_9_PLCP IWM_RATE_HT_SISO_MCS_INV_PLCP /* - * These serve as indexes into - * struct iwm_rate_info fw_rate_idx_to_plcp[IWM_RATE_COUNT]; - * TODO: avoid overlap between legacy and HT rates + * These serve as indexes into struct iwm_rate iwm_rates[IWM_RIDX_MAX]. */ enum { IWM_RATE_1M_INDEX = 0, @@ -4500,28 +4498,34 @@ enum { IWM_RATE_9M_INDEX, IWM_RATE_12M_INDEX, IWM_RATE_MCS_1_INDEX = IWM_RATE_12M_INDEX, + IWM_RATE_MCS_8_INDEX, + IWM_FIRST_HT_MIMO2_RATE = IWM_RATE_MCS_8_INDEX, IWM_RATE_18M_INDEX, IWM_RATE_MCS_2_INDEX = IWM_RATE_18M_INDEX, IWM_RATE_24M_INDEX, IWM_RATE_MCS_3_INDEX = IWM_RATE_24M_INDEX, + IWM_RATE_MCS_9_INDEX, IWM_RATE_36M_INDEX, IWM_RATE_MCS_4_INDEX = IWM_RATE_36M_INDEX, + IWM_RATE_MCS_10_INDEX, IWM_RATE_48M_INDEX, IWM_RATE_MCS_5_INDEX = IWM_RATE_48M_INDEX, + IWM_RATE_MCS_11_INDEX, IWM_RATE_54M_INDEX, IWM_RATE_MCS_6_INDEX = IWM_RATE_54M_INDEX, IWM_LAST_NON_HT_RATE = IWM_RATE_54M_INDEX, - IWM_RATE_60M_INDEX, - IWM_RATE_MCS_7_INDEX = IWM_RATE_60M_INDEX, - IWM_LAST_HT_RATE = IWM_RATE_MCS_7_INDEX, - IWM_RATE_MCS_8_INDEX, - IWM_RATE_MCS_9_INDEX, + IWM_RATE_MCS_7_INDEX, + IWM_LAST_HT_SISO_RATE = IWM_RATE_MCS_7_INDEX, + IWM_RATE_MCS_12_INDEX, + IWM_RATE_MCS_13_INDEX, + IWM_RATE_MCS_14_INDEX, + IWM_RATE_MCS_15_INDEX, + IWM_LAST_HT_RATE = IWM_RATE_MCS_15_INDEX, IWM_LAST_VHT_RATE = IWM_RATE_MCS_9_INDEX, IWM_RATE_COUNT_LEGACY = IWM_LAST_NON_HT_RATE + 1, - IWM_RATE_COUNT = IWM_LAST_VHT_RATE + 1, + IWM_RATE_COUNT = IWM_LAST_HT_RATE + 1, }; - #define IWM_RATE_BIT_MSK(r) (1 << (IWM_RATE_##r##M_INDEX)) /* fw API values for legacy bit rates, both OFDM and CCK */ From nobody Fri Jan 17 16:05:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPhp5dVsz5l88m; Fri, 17 Jan 2025 16:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPhp4M8nz4949; Fri, 17 Jan 2025 16:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5zXWvcdcM20hTI6MV/tt4xzldwcdQHSMt2laJiPbuA=; b=CSZwkIDGHpcAIpTYeaYeVXJO5eQ0EPTZtd2C701iOnZoEYRvFym6Wh8C6wvURqtB7tJNJM sdQR8Cd91iLVXeabtzC158VlvQ8WiLQW35ADXpc9f0qByDjezPX4AirDjW2Yn572tC6oc7 uok5HfDIc4ndLNQXohVna/K7ZkRyTM757fW6nQ+HZMwLDZPFt+JqeB5bQmQK4S3TDs67NS tQ46oC3oK4xHOKCXt073wg75jSPeYGQpFm5aGcSYAaMdBdk0vqnWRiamRZeDN3QYLIB0Ng /ALQH6RuF+EXfsSBx0AjHCuI6vWPQtxLWMUQ4P0RHvLL/Se+LaX0juf+/rIXiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737129930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5zXWvcdcM20hTI6MV/tt4xzldwcdQHSMt2laJiPbuA=; b=j1I7PVET5Q+nCLeeR3gL/tvFFGHM4h3Yw0LuzrR8VLQ8niop/hHIabqQNG4mdhk7YF5139 gaGkAoMbWRBk0by4R5qzZ5BEaKchZjhK2hS8EM4NLeA8X2LCxjjUVXrakUR1KOipPg/7qI ZdJ4feksB6tCibBsw8EOHjsRtLdH1cT0S7NuGFAgsZJkplJ6/pGUdMP2VwLcNfIiak6a0u 6j/w9ojg/LphOCKLrTwuFWg4ZuKzKfYaDHiAcQB9Aucy5W2VdLO/YJhFyjrKOL37XJKihe vYhFLKns17cDQh9eV1fq+qHe6MvKaeKEYs4g1OOUdA9ptat9pMWxosBJ7YF/XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737129930; a=rsa-sha256; cv=none; b=mEYoaDWpm0NtT/r+PGQscrCzBAJjV6DUKvjbEjMeoa+TcHsIgZc0drAQiuz5MTDhEH/GHp CKI2L/Jjd1ff63KPZW7fcMxM7gQ0stJfM0/VnsQqe1VorU7W+jHdk52u7KY/MJhFoVOjXn Xe/niZZzbq424Fe24ysxqfeurDXNP4frCxq97PZvTjLM7jgxQUBg2RqwG+PjZzCSUxKkdH e5vInbCkDHSeRjMWp9p8h7izN5Xi7XTyG2hvH1wwi8SlIJO4bD10VZz7weRzxfwK5fLvhv 591i+Lf9WKmeqMvvGsj+ZAUwJRHTqKq1IlklXNKuLjAlHSFdjnDZdlBclUu/Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPhp3jqNz981; Fri, 17 Jan 2025 16:05: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 50HG5UWk067037; Fri, 17 Jan 2025 16:05:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HG5U1j067034; Fri, 17 Jan 2025 16:05:30 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:05:30 GMT Message-Id: <202501171605.50HG5U1j067034@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: d7df65349960 - main - iwm: add sku_cap_mimo_disable; populate sku_cap_11n_enable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: d7df65349960c96f3982c21ee1d4eaaab2a4ca74 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=d7df65349960c96f3982c21ee1d4eaaab2a4ca74 commit d7df65349960c96f3982c21ee1d4eaaab2a4ca74 Author: Adrian Chadd AuthorDate: 2024-12-27 03:48:55 +0000 Commit: Adrian Chadd CommitDate: 2025-01-17 16:05:13 +0000 iwm: add sku_cap_mimo_disable; populate sku_cap_11n_enable This is a flag to be used to disable >1 antenna support, even if the radio supports it. Also populate sku_cap_11n_enable, which indicates HT is available. It's a no-op right now; it's one of the requirements for properly configuring HT support and transmit/receive antenna configurations. Obtained from: OpenBSD (at a6e25c727a2214219715b51ba6af2221d7e0d674, 22-Oct-2021) Differential Revision: https://reviews.freebsd.org/D48210 Reviewed by: bz --- sys/dev/iwm/if_iwm.c | 3 ++- sys/dev/iwm/if_iwmvar.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 15ef139fd5a5..248bfd056580 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -2220,7 +2220,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc, sku = iwm_get_sku(sc, nvm_sw, phy_sku); data->sku_cap_band_24GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_24GHZ; data->sku_cap_band_52GHz_enable = sku & IWM_NVM_SKU_CAP_BAND_52GHZ; - data->sku_cap_11n_enable = 0; + data->sku_cap_11n_enable = sku & IWM_NVM_SKU_CAP_11N_ENABLE; + data->sku_cap_mimo_disable = sku & IWM_NVM_SKU_CAP_MIMO_DISABLE; data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); diff --git a/sys/dev/iwm/if_iwmvar.h b/sys/dev/iwm/if_iwmvar.h index 63201e5b3120..f31057c07b9b 100644 --- a/sys/dev/iwm/if_iwmvar.h +++ b/sys/dev/iwm/if_iwmvar.h @@ -200,6 +200,7 @@ struct iwm_nvm_data { int sku_cap_11n_enable; int sku_cap_amt_enable; int sku_cap_ipan_enable; + int sku_cap_mimo_disable; uint8_t radio_cfg_type; uint8_t radio_cfg_step; From nobody Fri Jan 17 16:13:24 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZPsx0X8Jz5l91w; Fri, 17 Jan 2025 16:13:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZPsw6vTMz3Bwq; Fri, 17 Jan 2025 16:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737130405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNyX8D/3OjG4WlPiIhDKm9WK18bfTGs8NbNpinDQ858=; b=w3ktP0qb95ZfKeZniPMDc9xSCSWpF3tW24U4S1DtmaOWzBn2faDNaIz2Et3OYmdCVpVcLS bJgqUPoEfcNObOK/hmWJG7YxCO7fv7RHzQJbxK3cJWltl+Lt0Cx+58mUT+710qEHCFphTe bCtaYwIBYjboUmUqqxekhOEILZPvy5lyHmE16TNpLhKGqkXgFs3y2kgHeG72KdZfsRYh7T uwoxFVmY/A2i/PUPng7blPT3JD58dzclWj5uO/6bQ9ciHL6wJxV0bLRaSY0ziILz+L+Epg 4ugvriQ6Ko3zQoncCHLfgFJBN+7HWQadlPyYFT2cs8CT2lasRsaG9qbknHgF5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737130405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNyX8D/3OjG4WlPiIhDKm9WK18bfTGs8NbNpinDQ858=; b=ZGVexUFoPQ8dml5HBUkHJYoUyKZNuVdPwqxniXutfzEoWK9GN4Y0J926kdlKjmoXgd7Ebx pZsBGyWWoFom/DANzyCn5o4H0qbOO0A8ue0utAwdJ329iywNuuFObt8VlTXytMUuiQseWW 8caLE1Vncc1mFcX4+rE5PP85vSV6VNzToIvCVM74ak4ikZGHBvMfCUomiOjhOk6Y4EM5h8 2Ht2gU0Q+tLxuYXwLo4u5DhiUihOW1yorgE951z462QY91SeJi/+u1akFE6MhPAUqmiIvK duuVYjS4jUiCCUYrcYDMcpXaO1Y1dGzD0STTXRj7qzQ8ae515Vs0osDTQx1VQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737130405; a=rsa-sha256; cv=none; b=ZwOskscaS79p6Fln0gKD4clEn7ZiIUmzqRGd65gO6eBKcg9H2wuN6r3lARCjuRimPlZvfh 4LdGgeoISUtq+6cItl+XUE5ZU17gpMzQ1S/YeBLHOgjPRf68iZ3elm17S22tpbEEdAKwCn kOI0+ldNEqd49tRdb1CWku0IBvNPloaNbNmGRAF4DWOwC6azb1ILTNWNxXK03+0GnqsZuu wdHJV4/9qBW98FE6CBb/3Xe5NWDeRuC5PciZCczZvQjxcIW5tSn/6Ain3V8nkg2oIrUK57 3Up1vQTp0LDD8GhGadGQq7A2up/qahH+W9Bbg8ggn0mOnj5Av6ceFmFLpPrCYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZPsw6SH4z8n6; Fri, 17 Jan 2025 16:13: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 50HGDO2v085746; Fri, 17 Jan 2025 16:13:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HGDOmo085743; Fri, 17 Jan 2025 16:13:24 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:13:24 GMT Message-Id: <202501171613.50HGDOmo085743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b8cdbe1852ef - main - iwmbtfw: Check firmware exists before trying to upload it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8cdbe1852ef5df4ba3c7a021d9632bde2e61327 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b8cdbe1852ef5df4ba3c7a021d9632bde2e61327 commit b8cdbe1852ef5df4ba3c7a021d9632bde2e61327 Author: Gavin Atkinson AuthorDate: 2025-01-07 00:02:20 +0000 Commit: Ed Maste CommitDate: 2025-01-17 16:11:34 +0000 iwmbtfw: Check firmware exists before trying to upload it In the case of an Intel 7260 device, the device needs to be put into something called "manufacturer mode" before the firmware is uploaded. The firmware is then upladed, and the card is taken out of this mode, at which point it disconnects and reconnects to the USB bus, and is at that point usable. However, iwmbtfw(8) puts the device into manufacturer mode before verifying that there exists a copy of the firmware to upload. As a result, in the case where there is no firmware available on disk, the device is put into manufacturer mode, the firmware can't be found so isn't uploaded, and the card is brought out of manufacturer mode, so it disconnects and reconnects to the USB bus. Enter devd(8). There are rules in /etc/devd/iwmbtfw.conf to call iwmbtfw(8) when the device appears. When there's no firmware on disk, devd will call iwmbtfw, iwmbtfw will try to do its thing and fail, the device will dis/reconnect, and devd will notice the device reappear and start the whole loop again. Fix is to verify that the firmware exists before putting the device into its special mode. The fix only changes things for the 7260 and not the other chips supported, I don't believe the issue exists with other chips as those do not need to be switched into manufacturer mode before uploading. PR: 283896 Reviewed by: emaste --- usr.sbin/bluetooth/iwmbtfw/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/bluetooth/iwmbtfw/main.c b/usr.sbin/bluetooth/iwmbtfw/main.c index c2b67ce01906..9c899d374e92 100644 --- a/usr.sbin/bluetooth/iwmbtfw/main.c +++ b/usr.sbin/bluetooth/iwmbtfw/main.c @@ -518,6 +518,13 @@ main(int argc, char *argv[]) iwmbt_debug("firmware_path = %s", firmware_path); + /* Check firmware file exists before changing HW mode */ + r = access(firmware_path, R_OK); + if (r) { + perror("Failed to open firmware"); + goto shutdown; + } + /* Enter manufacturer mode */ r = iwmbt_enter_manufacturer(hdl); if (r < 0) { From nobody Fri Jan 17 16:24:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZQ6N5HN0z5l94h; Fri, 17 Jan 2025 16:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZQ6N4JB4z3F6Q; Fri, 17 Jan 2025 16:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737131052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRavFO/8fIT3jraFPzIxNnzOMyLaa6iSp6j4Jl9WJhM=; b=jK98IGL1dBF0EvF3+WNde0MjOxfpnQsYMN4pXosakm2zZZV8f6QiB5o1XCLqIPZHoQaI3m Y4BOW2X2RwABMuFtC3J+tnCUXt1IJV5F8p7TRi1iqECftTBzLFtxJETsaeX01M7be3E5dj KyU2ADvlUoWed8gz0OLpSKAnI5zeL3WhUpnGBjry2ktKiy1PDIbznCfCiuKmBHQCJj42oT nGepH7RPGil8EE2sncj33v2ljGZfSNT15NbKdKZNl+2wSQvAUiwI49/IZpBujn2cVT4uZF /Ic4kh0tDTDEWwiugX7EbBYIILOqXOvirx53YStZ2DVMaiShx/U71mPWN9KeYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737131052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRavFO/8fIT3jraFPzIxNnzOMyLaa6iSp6j4Jl9WJhM=; b=fCpjSd2hKpUBm+6fqO/ilj6CNd6FKuFn2VX6VV2doHDL8crIoTyiG2VFc8vTxYjgYKUP37 BZSWZfO81oMDM1F4Urz1WJE+IjPM28G08F7y9VGDLFLhM/2w/JWcGEGDutAavbtaiDZwOU W4t3YAdF18V0nxV9l0F/c+iv30kQuV8sLy0oXT5kqPKQQ0ujSJn//Ot8T3MmzWQY1fYZ25 RcEBFoQOEwS9E36SxDOO10tKPo6qPjE5ne0u+evoQcysAsCw0CK0CGXDf7oYmC8vRRp+A1 m8Mid4zjsPB8w8HAsfjm2RVN/uZSk88fmQ3vnvTaYm3flgsxF9dEh34KM1le9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737131052; a=rsa-sha256; cv=none; b=tUzNYrUq0NI+ShPJn2P/cXi25ZhNXtm4twME02iqT6c/aWvKQZVR7wiLlO5OfuHIRBvEJC 6SqgNOUfqA3xV6s8SrSv5UxcPP0a2Gqw/3X26JZnmRbBYo4jfsqhMFSn5Qdu8/1R63pUd2 J1zHLKrI7dAevuvBOF8jExwYLVAHSx58dPooY86z6/LODUIzevZsGVIayPPCwSEmH+8ISm cT5gaO37d4dL3rV2mMN7PuUXFQQCrlV25RDY/FM/FbKLq/32nxSy0fZiw8coOddT7/38fo hhFvxfv/Ymp72qevAS4VKHyk3inNuEZBdKLbsCgZnWiOja+aKyf4pEAly7pW3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZQ6N3W1Gz94y; Fri, 17 Jan 2025 16:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HGOCvV004988; Fri, 17 Jan 2025 16:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HGOCjT004985; Fri, 17 Jan 2025 16:24:12 GMT (envelope-from git) Date: Fri, 17 Jan 2025 16:24:12 GMT Message-Id: <202501171624.50HGOCjT004985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 72f092ee0194 - main - libc: Add include path for aarch64 memchr.S List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72f092ee019447c76ecb483c3f475313cf9dd5dd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=72f092ee019447c76ecb483c3f475313cf9dd5dd commit 72f092ee019447c76ecb483c3f475313cf9dd5dd Author: Ed Maste AuthorDate: 2025-01-17 16:22:39 +0000 Commit: Ed Maste CommitDate: 2025-01-17 16:23:56 +0000 libc: Add include path for aarch64 memchr.S Reported by: bapt Sponsored by: The FreeBSD Foundation Fixes: d355c28a0954 ("depend-cleanup: bea89d038ac5 also moved memchr") --- lib/libc/aarch64/string/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index f0f0f6495782..35523fb954be 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -54,3 +54,7 @@ CLEANFILES+= ${FUNC}.S MDSRCS+= ${FUNC}.S CFLAGS.${FUNC}.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string .endfor + +# memchr.S is a wrapper in the src tree for the implementation from +# arm-optimized-routines +CFLAGS.memchr.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string From nobody Fri Jan 17 17:06:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZR2f0PFSz5lCPb; Fri, 17 Jan 2025 17:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZR2d6PjMz3QnM; Fri, 17 Jan 2025 17:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737133561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGdsdjXXFMXKmHHTrbl5c5J4n/lupoYFCNfNISZqdP4=; b=gdPwlADF+SWB2Z+kaap72fxXCXQm1VDgLZX1msDuaS9d2R/OCsnAElMbYeCNii102d/c57 oF5V/Qob3sAjfaPT8EW//UFvYm+gv6J9jMAwOaEt4ztBVE5+U2w3Dhgj0zpeubqM2FnAmf s0v4H9qfvDZ24/GR18szUV5HKBhCvVciLuNUj6icYYtKRHrWOu22pM1xChUdKwCU3RwwH9 /MxuK6cMYHcAbYfYr1/NwGKWMNtQ+vW6krkaFx4bzqyZPbjviCndjuhAxY67vo1C96YC+D K0lQGL4D7zu3RrfobYSz6qrQM0hvDGac4Wp6tclAFNwvwH409QJWxesVb1vfWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737133561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGdsdjXXFMXKmHHTrbl5c5J4n/lupoYFCNfNISZqdP4=; b=bsDhzxSW5plFfMH8tDvz92kWVRvg5VHvBLAFT4pcnEx0IK/NDfRML5Piyf8NGY7P8UUNrD Y5cJSXKpd1qksTdFCDg5hgicQ68sY+H8jYaAcsFtHixjANmwPNlYtyA2388tc3Yw3v1KWy 4AX63fSHa2rFw+Oj7WOiX3cqG+4Fap2B2/Gzk/NgfEhRWb0ddJNkjM1zQauyf5jZuynYKF dvZrnzsnL8decx3pEUoXFgzGgSXU7EHcD8lnmZhyDt/75dnsSsvmGAjgn5ZTdNPuJN5HHO PNPLkHlbJRoqo0t+V0uzFpY/vBye4tqWhCryXk4+00V/ZutUWHq6wMzVzFqHEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737133561; a=rsa-sha256; cv=none; b=SHwigjCmlOc2DK4hz0cmPhExkjHqPENqvfPGGWBIDcsYMBvconoKJU6jnSD4dUHU08DFpQ m5Mt69SczPZYZ1dIlRPbQTgbCtUIisjonWQNh8Kon+YfV9yyNA+0V+0lUO9BKrRUMJcpLm sS/HL2fwK/ola/jdpmOJkuQyZ6KvjW2Rj4BWMrZzgsGw8lKM4lOWlRB5ZDi1WHdH3KP3/E 9g//F0fHDi0HdKBIrQYKKQimsmihaxwyr74wgMuoBRp/WynO7I8DzaDYeIYAekH3cgv4bJ fBeCXZl0enfP8rvc8Ht2do4CkS8JTQfkxYbc019f/5EA+yrh5tv1m2tvaEvAgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZR2d5rRXzBQq; Fri, 17 Jan 2025 17:06: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 50HH61aO081254; Fri, 17 Jan 2025 17:06:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HH61oR081251; Fri, 17 Jan 2025 17:06:01 GMT (envelope-from git) Date: Fri, 17 Jan 2025 17:06:01 GMT Message-Id: <202501171706.50HH61oR081251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ca22082c01a7 - stable/14 - RELNOTES: Document recent file handle layout changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ca22082c01a77bc51766e637eaf55c5a45dec3eb Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ca22082c01a77bc51766e637eaf55c5a45dec3eb commit ca22082c01a77bc51766e637eaf55c5a45dec3eb Author: Mark Johnston AuthorDate: 2025-01-15 18:20:50 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 16:58:28 +0000 RELNOTES: Document recent file handle layout changes Reviewed by: olce, rmacklem, imp, emaste Differential Revision: https://reviews.freebsd.org/D48093 (cherry picked from commit e0b7a9b6bee16f4855b392c0941e76b7fef777a0) This commit has been adapted for stable/14 (references of the relevant commits and the date have been changed) and the commits that actually have been MFCed so far (mention of tmpfs has been removed). --- RELNOTES | 5 +++++ UPDATING | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index e1ed1d18fc63..515ba162b440 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +54974e731f27, 155987e20190, 4634282f8908, 7a3a0402aeb6, 6b1a5d3535d9: + The layout of NFS file handles for the tarfs, cd9660, and ext2fs + file systems has changed. An NFS server that exports any of these file + systems will need its clients to unmount and remount the exports. + 83f1b98d8227: grep(1) no longer follows symbolic links by default for recursive searches. This matches the documented behavior in diff --git a/UPDATING b/UPDATING index e8ce65692e6b..9509e5405daa 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250117: + The layout of NFS file handles for the tarfs, cd9660, and ext2fs + file systems has changed. An NFS server that exports any of these file + systems will need its clients to unmount and remount the exports. + 20240419: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 18.1.6. It is important that you run `make delete-old` From nobody Fri Jan 17 17:15:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZRFf0nYnz5lDD8; Fri, 17 Jan 2025 17:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZRFd6qK0z3SKl; Fri, 17 Jan 2025 17:15:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737134134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q8tOty5vY/iwBM3Nmggq2iaL8y4srjywIDsHrbeB3VY=; b=EPqYpMOqaakHNbMp2uvL01iclg8Ir4987XtSASRVfl7xIa5Qo3bSQWgfBfVN65mQ5SV3ft CSVBTrzjxE72aZGOKG5cLSbSacWZ4mf7QbJEkDViPiO1QasqkZWSHF0RsVucUZGKFPHfgu I45n0hkPXi0ZsUbyqLaFcx7CS9/CU4akhDL2NBJf8yCHZluX3SvSRCwZckVAHtCylilLrh w+uWoHXH8ZKxcxn1MtZULoBjWkeNDZD2Dxj+wie9qfWu8HSQlkOxknStFA811RjCKp1wCh V7fOU501xSCOWxv02ZY4E5SlNU2At0FPeqvLkVtMajWSfGA3qlp2b3jrBxvRmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737134134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q8tOty5vY/iwBM3Nmggq2iaL8y4srjywIDsHrbeB3VY=; b=Ag4Xii/GvD/+o5uW1tZo5ZeWllHKLiuhcXaAiEIdw1V8CVnCHMwme8dF6TvA/ky1eZCgSI aJTfzu9X2BgB2Um8tuMTLvUlvaFvTxCo4Z/i+bgl+Uf2l2LjehAcCwnRQ4V/kSNBe0okbn HApVlpPsYYmOnp2/LcsyQ9cUrLojK/7DT1p2we6tNPm0R8Hn0f3FyLxOe3KzaSRsu1BehB BQDnMG9h9OlBOk8nZJIXrgwxi3io/TuzSNu0tfva3gqZg5ok1ekxrjpAtLvEfP4c7kcvhZ IWxBAym0SR9JN8save5CLqtay43osu8jqO2Nqu+pJDo6XYY9thaOeeBF9nTD5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737134134; a=rsa-sha256; cv=none; b=aQOI2x3caL8GajJ44zBNcAE50A6xhM7/3ce3UNnNhs5dtij/EJfQq0tXP8l0XFZLhf78/R ZhVJK4TBaZNQf85wUOkIYt2MtptqQwcu30XesXCSUrftCrCFYy3Dp8c2a7VCx05+9IHvaM IX+3A5LQYEOPzwPdC9eDIpaqnyHM+0FbUgU8GBrCW0B8t90jpmQTz/ZOpeMX3EMCq5QkNN Q0C3FPJK4+8okhuq69PUEAMKm/DlmvQeuB8QOYYzoAZCoDFDlJjGU5/bmZDnTC2PrrXe84 KTwkyyUGDhDWgrFAYirTe7SgwqCmrS4WOFPENkvuGNxj92Arc5xWYwKMmhQEJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZRFd6LsvzC0C; Fri, 17 Jan 2025 17:15: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 50HHFX6M099351; Fri, 17 Jan 2025 17:15:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HHFXTa099348; Fri, 17 Jan 2025 17:15:33 GMT (envelope-from git) Date: Fri, 17 Jan 2025 17:15:33 GMT Message-Id: <202501171715.50HHFXTa099348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 4d93d6559697 - stable/13 - RELNOTES: Document recent file handle layout changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4d93d6559697a5c3690dc5892f52a3f577337d05 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4d93d6559697a5c3690dc5892f52a3f577337d05 commit 4d93d6559697a5c3690dc5892f52a3f577337d05 Author: Mark Johnston AuthorDate: 2025-01-15 18:20:50 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 17:14:28 +0000 RELNOTES: Document recent file handle layout changes Reviewed by: olce, rmacklem, imp, emaste Differential Revision: https://reviews.freebsd.org/D48093 (cherry picked from commit e0b7a9b6bee16f4855b392c0941e76b7fef777a0) This commit has been adapted for stable/13 (references of the relevant commits and the date have been changed) and the commits that actually have been MFCed so far (mentions of tarfs and tmpfs have been removed). --- RELNOTES | 5 +++++ UPDATING | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 57cabbff342e..83905859a3b0 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +cd597b4bb194, ee931cf4a49c, acdc59f0924a: + The layout of NFS file handles for the cd9660 and ext2fs file systems + has changed. An NFS server that exports any of these file systems will + need its clients to unmount and remount the exports. + 35b193572545: grep(1) no longer follows symbolic links by default for recursive searches. This matches the documented behavior in diff --git a/UPDATING b/UPDATING index 6331b1bb0da8..c3df5cfea2f1 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20250117: + The layout of NFS file handles for the tarfs, cd9660, and ext2fs + file systems has changed. An NFS server that exports any of these file + systems will need its clients to unmount and remount the exports. + 20240419: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 18.1.6. It is important that you run `make delete-old` From nobody Fri Jan 17 17:22:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZRPL2mD9z5lDf9; Fri, 17 Jan 2025 17:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZRPL0WCfz3Tw7; Fri, 17 Jan 2025 17:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737134534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJAk05nhajB3uBSFZpWP9CafMqMGaWLZFWAiCJbqzKg=; b=G6O1cf/9ZmNDl4uNlp2Dxrc/jdYAR6JCRVDFGmBYK8bu0nnOb/z1MDtuH+j6tpI2J4y+yW K4naGLhPbYKBlaLCIUhtxijYlU9FslFYzLpIXuPBdqS0rkonzaVGqNMrLiRTwtQxBHCD8P 6fD2zAKVTg4Fv/J29QKIUiokG2TX1il6P39nHarXsCCY0SFWY1tvhUEH6/ELTPfdel0FQk d+4vzd4Z/w1cMsQkFtzLnRiFYSiCK/XG07Li7hA/A4fow1H21GjkVdqSC2PWMq8hl3Pejh qDWPIbYBoLYd18erlWTqgcfy4vbKY4alA3lMqhwhaONRpoBYrfO3X3CWELaRhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737134534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FJAk05nhajB3uBSFZpWP9CafMqMGaWLZFWAiCJbqzKg=; b=FKlRrRS76ML9honG7e+Dn7LAJ67Yn+ic5my+g8IlrcDyErFYrunCpHe6Q/YusOx40B50YJ svjcGCpZDYaOwxzBDAUAFQebcuJQj9tdQIXHW5rVpwM8eOkbXITVUsP5f6DvfxKnE2LK5a t3ZDF8iDaBO4pIERXmnz6kj6oRfXEHrISzEUGvFHUnPr51ihZWBqRkuBFy4vDf6BXqbSu7 E+uy38/8b+iid1TBz5V0Zm/g6LxcsvxlsN/ZbkiC9kHjbEZfi/lDhDf6Y9FwFuQdFrNYD0 02ELttlULs0K5x3p/WUcexdzJnZy+PDVBHLQHPFr1h9g7TQrDFMZuHHn4q5hBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737134534; a=rsa-sha256; cv=none; b=lkiCGDmYnwEkCJzp8HD4IPGSb4hAzKLdHlCW4NnxYIEqfxkwiWctnkuVBZ77hfYcnq1TNF 42jlnoO+xmi2Yqra43yeidGiokeDN9NJzZxeZSJAVLApr7KgWo2i4kbDa2PZ9cHtiMpsE6 KzB3O1U/OTmZvAQwStxD7ei5A23Z2pBI9nvcdZ+Mjd+CNsGDU+S+hxELpDvRctWHTUwNgT Bdt6hnWdTWw8XI1sXOcUz8J1r48STKl4Ff46MWWuilR/TzfrS9o7z6YF/5TV7P2KEDVsPY 5x8Q4ftpZonVm1SWhSuhuGxEN32ZjhJ9GyeVAzrmm3SRZdQzMyBLrUvuLRu4gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZRPL06lfzC3x; Fri, 17 Jan 2025 17:22: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 50HHMDd9016895; Fri, 17 Jan 2025 17:22:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HHMDOC016892; Fri, 17 Jan 2025 17:22:13 GMT (envelope-from git) Date: Fri, 17 Jan 2025 17:22:13 GMT Message-Id: <202501171722.50HHMDOC016892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: e2d4c5de27ac - stable/13 - UPDATING: Remove tarfs reference that slipped through List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e2d4c5de27ac6788e61818924e1ba092a47f17d9 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e2d4c5de27ac6788e61818924e1ba092a47f17d9 commit e2d4c5de27ac6788e61818924e1ba092a47f17d9 Author: Olivier Certner AuthorDate: 2025-01-17 17:21:08 +0000 Commit: Olivier Certner CommitDate: 2025-01-17 17:21:08 +0000 UPDATING: Remove tarfs reference that slipped through Forgot to add my modifications to UPDATING to the git index (should have made it in the previous commit). Differential Revision: https://reviews.freebsd.org/D48093 --- UPDATING | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UPDATING b/UPDATING index c3df5cfea2f1..a40ddb1d3670 100644 --- a/UPDATING +++ b/UPDATING @@ -13,9 +13,9 @@ Items affecting the ports and packages system can be found in and/or ports. 20250117: - The layout of NFS file handles for the tarfs, cd9660, and ext2fs - file systems has changed. An NFS server that exports any of these file - systems will need its clients to unmount and remount the exports. + The layout of NFS file handles for the cd9660 and ext2fs file systems + has changed. An NFS server that exports any of these file systems will + need its clients to unmount and remount the exports. 20240419: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have From nobody Fri Jan 17 17:56:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZS9F5NPdz5lGLy; Fri, 17 Jan 2025 17:56:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZS9F4p6hz3YT2; Fri, 17 Jan 2025 17: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=1737136609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yBmZV1LDgSaNAtBSZnoigWxPyOyhK4j7lltpTQnLLFw=; b=UGm+TUMp8ZKfv3/6thhZWSLdXdR35sjd9tDdXxUjKYXEZ+V8o60yB0PXajRU/jAUoXnCk9 k0yeNfMF50J8fEN7xPZa2WP+FaAY4DQg+HV/D0qL+Weg74Plqt1qrj4hhmMQO3vbqQqmla jEQiYFKsl2g5FBTgW19s6pxpLP9pswnWJIZYQOofgujt4FjkGwaIIyiBqJp9nMMWFU+x6C PtwVCmKA+aKkmxF3ShbFgIoh+T1r3a4660RmXmqX2WjWCPU/NlIHd0pYha5TkXq4U6GCpi OoQXuIBvBar75K1dTg3fZMzjCmCbTY8lYaOhVZJhByKGYsIV8/s7Nw2PzNbepA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737136609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yBmZV1LDgSaNAtBSZnoigWxPyOyhK4j7lltpTQnLLFw=; b=X3RGeVdoI8nTrFnUMddkFGVaK3U+g4KXyFQoFAjS7ADNuOImCpuz/NZ2+ooRpTuoDM4nq6 5mJlZKmuE2pemIXB8sVMJEoEdD6g361refChHHreQfxt+gZ2XeZxA7JQi/kBokPR8gZniA Ep/7mkARx5pJ2w4Z97eEXU1+ffNUKEzK/x0ykorVp+uRihw0DWge4D85fyZaoGFRRiFuQX hHJr7VGAKUdf/3NEE7D2+wE6be0KJNnhEMQCMP4k35zeQX1tRCMf8GXVXlw5fNFfsesHpZ XJMX7NXr5gpwT51HgPlsLYZhPwXj6jIFrocFggO9BDbwXPs5Jul5DRf6a6zECQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737136609; a=rsa-sha256; cv=none; b=qiH2xM3nzYnSTDK07G+fs6rpatXsmcdyoTaAZUG3hvTwu0LyJlbkWhvBOR5ZSy2AIfo0RA 5VmKDhzIV4H+GHYJtwf5EixpEbwfgg/dqF6WCa3DgCB8+72vHRKJNoGMDLq5kvfRL958DR HZlvzQr61JFq5NP3KX+mfGTG9MgDkzeGu/9mcXiLoHGE2lJggSgFqQAiumvERsEOHuZV+e khDFKkQHZUrD5WdUhg1LWtKKruwEq5lUdZTOWjO8/LeqqQhrUnR4IENfAkpYysdkqjywE/ diZ92ZDi2+2TdJykAZSRAgWzIrn7JrtW40cMiQbmBmj/4M1co8DIl2y43Ip5jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZS9F4MDMzD0R; Fri, 17 Jan 2025 17: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 50HHunCT073412; Fri, 17 Jan 2025 17: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 50HHun74073409; Fri, 17 Jan 2025 17:56:49 GMT (envelope-from git) Date: Fri, 17 Jan 2025 17:56:49 GMT Message-Id: <202501171756.50HHun74073409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 98bebc20cef7 - main - Revert "certctl: Set METALOG ownership to root:wheel" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98bebc20cef7527ccb15f8defc9d52e803a0d506 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=98bebc20cef7527ccb15f8defc9d52e803a0d506 commit 98bebc20cef7527ccb15f8defc9d52e803a0d506 Author: Ed Maste AuthorDate: 2025-01-17 17:49:01 +0000 Commit: Ed Maste CommitDate: 2025-01-17 17:56:30 +0000 Revert "certctl: Set METALOG ownership to root:wheel" This introduces a circular dependency because it requires an existing dbdir for install -N, which might not yet exist. I imagine we can use install -o 0 -g -0, avoiding the need for the dbdir, but install emits uname=0 gname=0 rather than uid=0 gid=0. So just revert for now pending a full fix. This reverts commit 10fa3f2518d4582c98d74527f79af9f30b1eceab. PR: 283340 Event: January 2025 Bug-busting session Sponsored by: The FreeBSD Foundation --- usr.sbin/certctl/certctl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh index d336a02fd4ea..864302ab1160 100755 --- a/usr.sbin/certctl/certctl.sh +++ b/usr.sbin/certctl/certctl.sh @@ -334,7 +334,7 @@ fi : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= if "$UNPRIV" ; then - INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR} -N ${DESTDIR}${DISTBASE}/etc -o root -g wheel" + INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" fi : ${LOCALBASE:=$(sysctl -n user.localbase)} : ${TRUSTPATH:=${DESTDIR}${DISTBASE}/usr/share/certs/trusted:${DESTDIR}${LOCALBASE}/share/certs:${DESTDIR}${LOCALBASE}/etc/ssl/certs} From nobody Fri Jan 17 18:23:44 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZSmJ6Kbvz5lHs1; Fri, 17 Jan 2025 18:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZSmJ5Zt0z3ffF; Fri, 17 Jan 2025 18:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737138224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pd5vxJ2qpJQnowbkWVC57VfyfKlPQePd21RjU2AY+XQ=; b=VbYjfN7dBSKc7bzk/VPIaHzupmIVSeWB2tJxTRvgLMkODK1OmlIbDoudPIrgRhF8EhnPri qpQFUh7InsxWi9VcuZDpAKmhbiMKnvY3HCtI2UGVayvTnG/0GKOIKFQPg1+QZpNIGDtR5p gEoJmhm5I3b4rVGbQ4XNAqZNpPmGZ0Bp80wvxwuu2Eo0DMhcERMoo/N35xtaV4wSQC9VjE FCROwYqJlCAmW3eyXf5FNgVb+3XzXGAJM9ev0NEA4/dJ2l8eshFLSjqA3izAA4LqOzV2ZP suwbOyDHOc/4jRqgsQuvMvGykOgqZdqHH96J4Xc4mQL6B+tMKIuqbj42Sx/WTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737138224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pd5vxJ2qpJQnowbkWVC57VfyfKlPQePd21RjU2AY+XQ=; b=nj+QZBJLh38QN0DLlDuloeSGPmZNa61LeiIsVQ2tM97hJ3eVZ9nFv/fH6gnXZa2PoouoaC 7GJwANigfsIO5/kNyWE0P02nmQtPkzKwF++HxAXOGT3/m1W2EQXFICs/uAvBdcB6fXjDsr JKKCO0QJ/T0B12FnGcZALgG18LtL46HSG8Nhmf1vmm0iplcl4EPPUOlg1XvtJa780z5mOj VAHBZACEFSugAjkiSegEa6iDlXnMabzkbOMv9ajRTGTxQ1fP+N1uvKMx1OQD5GkvNwXX5r LfJTAR9B7l9Iq6g4qOjr8udg6Kb2kwNxvchtxDdAQCSrPKTchpK3QRd2L4f/IA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737138224; a=rsa-sha256; cv=none; b=HtQ3vUUYLzPgpGNugsQZ5B+6jOsLKfBG1QTlwN2QSUl5lH6Wmr7hCtQY4D0i6vGfTjjuhu +i3fdFmophe7Zze4SaSmwrmQatPs6QOAqtiNyOgANxrxrmOTdKUtyrZVWBHLLdnY+lObpN 1FKw35g9B1bKgYBRcdGMvXgAHtsXNdqSD3ZreOXqRnoxogQiaMLPRiXf0tYbpBSONn4foP M1uNSdyR4sJWI21byqTmNvEYCPqSN1eOtXrj87H8NmT2I4QYT9K4CbVLCRz0yKGYxu0ZtT m5UaVmNaDs68P319+yfWjv675YUt2nX2S/riLgTTMhb70DHgqI7ZadEVdtFy9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZSmJ55vWzD4D; Fri, 17 Jan 2025 18:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HINiLm027329; Fri, 17 Jan 2025 18:23:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HINin7027326; Fri, 17 Jan 2025 18:23:44 GMT (envelope-from git) Date: Fri, 17 Jan 2025 18:23:44 GMT Message-Id: <202501171823.50HINin7027326@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 473681a1a506 - main - libc: Fix getentropy POSIX 2024 conformance issues List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 473681a1a506daafdae17900fcb42830e0dcb26e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=473681a1a506daafdae17900fcb42830e0dcb26e commit 473681a1a506daafdae17900fcb42830e0dcb26e Author: Ed Maste AuthorDate: 2024-11-16 15:14:21 +0000 Commit: Ed Maste CommitDate: 2025-01-17 18:23:23 +0000 libc: Fix getentropy POSIX 2024 conformance issues GETENTROPY_MAX should be defined in limits.h. EINVAL is the return value for buflen > GETENTROPY_MAX. PR: 282783 Reviewed by: markj, asomers, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47689 --- include/limits.h | 4 ++++ lib/libc/gen/getentropy.3 | 14 ++++---------- lib/libc/gen/getentropy.c | 5 +++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/limits.h b/include/limits.h index 99cfa67b3ed2..ed8844e65642 100644 --- a/include/limits.h +++ b/include/limits.h @@ -137,6 +137,10 @@ #define MB_LEN_MAX 6 /* 31-bit UTF-8 */ +#if __POSIX_VISIBLE >= 202405 +#define GETENTROPY_MAX 256 +#endif + #include #if __POSIX_VISIBLE diff --git a/lib/libc/gen/getentropy.3 b/lib/libc/gen/getentropy.3 index 5bbbc80e2414..5f7ee32ebbfc 100644 --- a/lib/libc/gen/getentropy.3 +++ b/lib/libc/gen/getentropy.3 @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd November 20, 2024 +.Dd January 17, 2025 .Dt GETENTROPY 3 .Os .Sh NAME @@ -60,8 +60,8 @@ The .Fa buf parameter points to an invalid address. -.It Bq Er EIO -Too many bytes requested, or some other fatal error occurred. +.It Bq Er EINVAL +Too many bytes requested. .El .Sh SEE ALSO .Xr getrandom 2 , @@ -69,7 +69,7 @@ Too many bytes requested, or some other fatal error occurred. .Xr random 4 .Sh STANDARDS .Fn getentropy -nearly conforms to +conforms to .St -p1003.1-2024 . .Sh HISTORY The @@ -80,9 +80,3 @@ The .Fx libc compatibility shim first appeared in .Fx 12.0 . -.Sh BUGS -.In limits.h -does not define -.Dv GETENTROPY_MAX . -Some error values do not match -.St -p1003.1-2024 . diff --git a/lib/libc/gen/getentropy.c b/lib/libc/gen/getentropy.c index ff5475f9fdb0..6b8ad697b7e0 100644 --- a/lib/libc/gen/getentropy.c +++ b/lib/libc/gen/getentropy.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -47,8 +48,8 @@ __ssp_real(getentropy)(void *buf, size_t buflen) { ssize_t rd; - if (buflen > 256) { - errno = EIO; + if (buflen > GETENTROPY_MAX) { + errno = EINVAL; return (-1); } From nobody Fri Jan 17 18:35:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZT1f2Rghz5lJMm; Fri, 17 Jan 2025 18:35:18 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZT1f1fZ3z3kDp; Fri, 17 Jan 2025 18:35:18 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737138918; 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=ljykCQvyffKJuxA0ENBzGxqQ3dx+MEJs9IeIvV7ft/w=; b=rxydgm1UJGrKUzQwSczUtU2ZQVe+kjxwHGuZTMn+8Dy9ia1qPiJCUbbh/vH3KVRQkswoxe f2ZohSciESR4LDeWN253bqJ7N0b5HfyavfZ7tv6RBgCh6zyOXfTHtRLSRbVOXppXxKvYuP KnNmIPBY1zo3g81SRWdGdAJF2kwJhx0zcbj6B/+L2tCC+wcwslPBGPemvHMYyPTZffWX3a 09+Mvx3o9EE8hAuCz0m1E4/rfeRGT5WoYT3zKN2HDXHmZ6/IDwn48DKLZYeqk8M7/bWS3l EJVb2/FeIpg1aqlwMmOXgy3U3jb2GORx7Mf2EC5fB4iWlHH2ms8wm3qT3z04aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737138918; 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=ljykCQvyffKJuxA0ENBzGxqQ3dx+MEJs9IeIvV7ft/w=; b=XpDKMOmkDdmrtDtRYCV7FlUjrxxF13c6nadd0Kbi9ZJ+LjKGlVX8ys4TWICaRv9b927l4Y rcpyPy7LuVD7Smk3/l61Wq5a1Tn4IGp/8azBFOONM3LA5/wllo5RXXQ/qvBPf/EsMxVoy3 pSxLQBV4AeY54BrDULPSVbU7hOSvlcmDo720WTMbnLRli0BRphtcch4xYVM+0r5oH9H0O/ JSr1oOXvMirXPDf19b89SYkgQWLodd9mEtKADu+CsJSiYn+pwV+lXZbW0/Q5QaF5g/Sayu i5VFcXB5opdeWVUHPgI7Q8pjunXoO/HqWEpCJ8uCowiZ7rfuabSipATo5tTNBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737138918; a=rsa-sha256; cv=none; b=JPEOM0zA7DvKjy0M9xw81HO78b8Hn/VPkomXp0QsRaMok9CgMkAHM87y3gaXjUffiNxnrH uA51J9KHetQfp35ZHEZyHFtgkcPNTjQYvX3dTYpjBo5vjKH0huPaVhCXUQmBtH1wUTPUnB TR8DidLifTTfCk5b8n6vFqRWUvCsNy72kX0Mv3vAKlmVP0cIIAIC/Jw4oEKONgEWd7F9ek 1i5eQhtnCgbHM0iGSddCOKmq2KdmBsyHWIhjiLndhEpebLbgkE/IP5djhz878SOGMXMxr1 66/PfZnK1iT1CEStiwYR4S0CA1diBTOrBTOHjBF59W4DwhlvcE++pDgfIhjwcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_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: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YZT1f0X4pzCSN; Fri, 17 Jan 2025 18:35:18 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7B5513C01A0; Fri, 17 Jan 2025 18:35:17 +0000 (UTC) Date: Fri, 17 Jan 2025 18:35:17 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Warner Losh Subject: Re: git: 9ded074e875c - main - Refactor makesyscalls.lua into a library Message-ID: References: <202410302108.49UL8tGl053622@gitrepo.freebsd.org> <25a28def-fbfd-49df-a2bf-dc4ef6609440@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jan 16, 2025 at 08:53:07PM -0600, Kyle Evans wrote: > On 1/16/25 16:43, Brooks Davis wrote: > > On Thu, Jan 16, 2025 at 03:52:22PM -0600, Kyle Evans wrote: > > > On 10/30/24 16:08, Brooks Davis wrote: > > > > The branch main has been updated by brooks: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=9ded074e875c29cb92d5f643801990d7bb23cca4 > > > > > > > > commit 9ded074e875c29cb92d5f643801990d7bb23cca4 > > > > Author: agge3 > > > > AuthorDate: 2024-10-21 21:42:13 +0000 > > > > Commit: Brooks Davis > > > > CommitDate: 2024-10-30 21:04:30 +0000 > > > > > > > > Refactor makesyscalls.lua into a library > > > > * main.lua replicates the functionality of makesyscalls.lua > > > > * Individual files are generated by their associated module > > > > * Modules can be called as standalone scripts to generate a specific > > > > file > > > > * Data and procedures are performed by objects instead of procedual code > > > > * Bitmasks are replaced by declarative types > > > > * Temporary files are no longer produced, writing is stored in memory > > > > * Comments provide explanation to functions and semantics > > > > Google Summer of Code 2024 Final Work Product > > > > Co-authored-by: Warner Losh > > > > Co-authored-by: Kyle Evans > > > > Co-authored-by: Brooks Davis > > > > Sponsored by: Google (GSoC 24) > > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1362 > > > > Signed-off-by: agge3 > > > > --- > > > > sys/tools/syscalls/README.md | 49 +++ > > > > sys/tools/syscalls/config.lua | 312 +++++++++++++++++ > > > > sys/tools/syscalls/core/freebsd-syscall.lua | 147 ++++++++ > > > > sys/tools/syscalls/core/scarg.lua | 163 +++++++++ > > > > sys/tools/syscalls/core/scret.lua | 45 +++ > > > > sys/tools/syscalls/core/syscall.lua | 497 +++++++++++++++++++++++++++ > > > > sys/tools/syscalls/main.lua | 64 ++++ > > > > sys/tools/syscalls/scripts/init_sysent.lua | 193 +++++++++++ > > > > sys/tools/syscalls/scripts/libsys_h.lua | 111 ++++++ > > > > sys/tools/syscalls/scripts/syscall_h.lua | 97 ++++++ > > > > sys/tools/syscalls/scripts/syscall_mk.lua | 90 +++++ > > > > sys/tools/syscalls/scripts/syscalls.lua | 109 ++++++ > > > > sys/tools/syscalls/scripts/syscalls_map.lua | 74 ++++ > > > > sys/tools/syscalls/scripts/sysproto_h.lua | 242 +++++++++++++ > > > > sys/tools/syscalls/scripts/systrace_args.lua | 268 +++++++++++++++ > > > > sys/tools/syscalls/tools/generator.lua | 113 ++++++ > > > > sys/tools/syscalls/tools/util.lua | 194 +++++++++++ > > > > 17 files changed, 2768 insertions(+) > > > > > > > > [...] > > > > diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua > > > > new file mode 100644 > > > > index 000000000000..193b1e43563c > > > > --- /dev/null > > > > +++ b/sys/tools/syscalls/core/freebsd-syscall.lua > > > > @@ -0,0 +1,147 @@ > > > > [...] > > > > +function FreeBSDSyscall:parseSysfile() > > > > + local file = self.sysfile > > > > + local config = self.config > > > > + local commentExpr = "^%s*;.*" > > > > + > > > > + if file == nil then > > > > + return nil, "No file given" > > > > + end > > > > + > > > > + self.syscalls = {} > > > > + > > > > + local fh, msg = io.open(file) > > > > + if fh == nil then > > > > + return nil, msg > > > > + end > > > > + > > > > + local incs = "" > > > > + local defs = "" > > > > + local s > > > > + for line in fh:lines() do > > > > + line = line:gsub(commentExpr, "") -- Strip any comments. > > > > + -- NOTE: Can't use pure pattern matching here because of > > > > + -- the 's' test and this is shorter than a generic pattern > > > > + -- matching pattern. > > > > + if line == nil or line == "" then > > > > + goto skip -- Blank line, skip this line. > > > > + elseif s ~= nil then > > > > + -- If we have a partial system call object s, > > > > + -- then feed it one more line. > > > > + if s:add(line) then > > > > + -- Append to system call list. > > > > + for t in s:iter() do > > > > + if t:validate(t.num - 1) then > > > > + table.insert(self.syscalls, t) > > > > + else > > > > + util.abort(1, > > > > + "Skipped system call " .. > > > > + "at number " .. t.num) > > > > + end > > > > + end > > > > + s = nil > > > > + end > > > > + elseif line:match("^#%s*include") then > > > > + incs = incs .. line .. "\n" > > > > + elseif line:match("%%ABI_HEADERS%%") then > > > > + local h = self.config.abi_headers > > > > + if h ~= nil and h ~= "" then > > > > + incs = incs .. h .. "\n" > > > > + end > > > > + elseif line:match("^#%s*define") then > > > > + defs = defs .. line.. "\n" > > > > + elseif line:match("^#") then > > > > + util.abort(1, "Unsupported cpp op " .. line) > > > > > > This specifically is kind of a huge regression, and I don't really know how to > > > cope with it. We've guaranteed for years that we'll copy preprocessor > > > directives through to all output files. We don't use that upstream in > > > FreeBSD, but we work with downstreams/vendors that make extensive use of it in > > > their syscall definitions. > > > > > > I don't really know what the answer is to this, but we probably shouldn't have > > > dropped it without some discussion first. This is going to be a bit of a > > > headache... > > > > This response seems rather hyperbolic. This change was up for review > > for months and the feature is unused in tree so there was no way to know > > it was important. > > > > Re-reading, yes, this was a bit dramatic; my apologies. There's plenty of > frustration here, mostly amplified by the fact that I was on the review just > as much as you folks and have worked in environments that use it- it certainly > should have stuck out to me, but I just didn't have the time into it that I'd > hoped I would. > > I would've also really liked to see an "XXX" comment at a minimum drawing > attention to it or a call-out in the commit message, given that the syscall > definition documentation isn't that lengthy and this is one of the few > guarantees we make it. I think there's some compromise to be had, but... > > > It would be helpful to work through some examples understand what people > > need here and if it really has to be a refactor to pass things through > > or if adding some new tags and config values could do the job. > > > > ... I'll respond to this this weekend, hopefully. I'd like to condense what > I'm aware of into some formal test cases in sys/tools that I can point to so > that we have something less abstract to debate the merits of, and also so that > we have something we can verify the functionality against. I've implemented simple support for ifdef's syscall variants in https://github.com/freebsd/freebsd-src/pull/1575. It's not robust at all and may be missing some bits in newly generated files, but it's probably not much worse than what's in 14. I agree some tests would be good. I think I'd deviate from the norm and run them as part of the top level `make sysent` for ease of develoment. > > The quickest workaround would probably to revert these commits locally > > (I took care to isolate them for exactly this reason): > > > > 5212b9500116 sysent: GC sys/tools/makesyscalls.lua > > 204d065dac81 sysent: switch to refactored makesyscalls.lua > > > > You might also need to revert this commit or implement it in > > makesyscalls.lua: > > > > bbc0f33b1317 sysent: add a NOLIB modifer to prevent stub generation > > > > If we need be, I'd even be ok with temporarily restoring makesyscalls.lua > > and back porting easy features, but maintaining two is certainly not > > viable indefinitely. > > > > This isn't urgent enough to warrant any of that- it's just something that I'd > like to work out how we can solve (preferably in the short-to-mid term), > because there good uses for at least a subset of what we supported before. I > don't think we need to go as far as supporting arbitrary preprocessor, but if > we could at least devise something for conditional syscall slots that'd > probably be sufficient and workable. I think the right midterm solution is probably a combination of generating the files at buildtime (one of the goals of the refactoring) and some sort of overlay framework so you can replace syscalls on a per-arch basis. -- Brooks From nobody Fri Jan 17 18:46:58 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTH63hWzz5lKQB; Fri, 17 Jan 2025 18:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTH62cwGz3lgy; Fri, 17 Jan 2025 18:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737139618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iLROnbokmy+ZHD0Yz4SgfDSXxiPhgtieK3EF0yNgucg=; b=vPJinWixm0vHWpf7FIlhqdluJVa66E7Sf8neXEC+IS+hPX9jQusBOOwzH4Mk/eXUUGu8Zw DCHH7Ef8DeuvFyD3auTphkFkRjRNOrada2LgX+g7LlWhSmgizBG90wtiTQwH9G0Ia9BKX4 LBSYgUvFVJKitnaymv2bAUmaiJjdLh+w4aVAJh2f4HaYfJDGnvH6BLC2CKW7RcN3EVtIqx BSIrdz14tqmygrWhUtWkHcq7Gid8kNDrSlIVlwQH2tnLHheNzYXQINeLnNr9guqcHEaakG P6/K1zV6GF2r8utLHOLS4fKwpmFerucdPm69Iic7aA8XPcfwQ5IIn7qUc6YYIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737139618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iLROnbokmy+ZHD0Yz4SgfDSXxiPhgtieK3EF0yNgucg=; b=qRKr+fiwh61H+SBuNH+w62wNP/YAZiptia+K6BAIqfGpgYOUncZyJScHGoOWo64JhmARf6 5xwK6iRQtMbxbLNtRWd2kuh63LBQ4joCgUnZmXBG7sC84NuZfOey7Yll4yh46kB/EGFO2o pHuiy1Ov6aQg+mO2B1W5rSeGeZQ/c85Nu57aTO7XCCZ09DGkPZYs2ibAX7+zvc/qh/SrHv kAw8WuiFPTq/Rp2tIT1NnfmJJMb8oLjsVbopsInAsazTrvxLCCrILxdrLuC1eKjn1yV7rK w1pS2BxguOHLhXT6Kj2nGlYUEK9FtZEOkPVbJOM7BjZDHD3zAKlraO8pYK3tqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737139618; a=rsa-sha256; cv=none; b=d17JyLXFEY3Vfm+S5EDe1A0uHDbZDMW7UEDqEIuyaWYMF+9KFSApICOExPh1zdjDdQ6keI 3bsfIgNiK0jHyKSl3vRRERZq5S41bsq0pc4M9j03BNMR9OwodVeu21zOKWGqO30YdqGv++ ByfkoWBjs1HhgY+wbf8HJJuWD8i7A35xSekGa74WVIVuBgfzJrLisFXb2ipljsStThSrTv 5BVEyVPLHV9HKRC/sJQInYnATvJiGNmDY1vHJj8z5KCZcKaR0BNRSImLuaL88iJY7OguXN XmVDQAi8tcYkpUZKTKTLv6Bh+/6IXVkgaLLiwd2ahDT9iUvPaIl65AQZM//tQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTH62BW6zVVh; Fri, 17 Jan 2025 18:46: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 50HIkwQO061211; Fri, 17 Jan 2025 18:46:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HIkweD061208; Fri, 17 Jan 2025 18:46:58 GMT (envelope-from git) Date: Fri, 17 Jan 2025 18:46:58 GMT Message-Id: <202501171846.50HIkweD061208@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e6025bc05cda - stable/14 - Fix "vrefact: wrong use count 0" with DRM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e6025bc05cda3a33ac9e9d9e1b0a5677956f0d47 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6025bc05cda3a33ac9e9d9e1b0a5677956f0d47 commit e6025bc05cda3a33ac9e9d9e1b0a5677956f0d47 Author: Edward Tomasz Napierala AuthorDate: 2024-11-13 10:00:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:43:42 +0000 Fix "vrefact: wrong use count 0" with DRM Bump the vnode use count, not its hold count. This fixes a panic triggered by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be what glxinfo(1) from Ubuntu Jammy is doing. PR: kern/274538 Reviewed By: kib (earlier version), olce Differential Revision: https://reviews.freebsd.org/D47391 (cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c) --- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 1fc71c55469a..b60f464377cc 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -773,7 +773,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, } /* hold on to the vnode - used for fstat() */ - vhold(filp->f_vnode); + vref(filp->f_vnode); /* release the file from devfs */ finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); @@ -1505,7 +1505,7 @@ linux_file_close(struct file *file, struct thread *td) error = -OPW(file, td, release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); if (filp->f_vnode != NULL) - vdrop(filp->f_vnode); + vrele(filp->f_vnode); linux_drop_fop(ldev); ldev = filp->f_cdev; if (ldev != NULL) From nobody Fri Jan 17 18:47:12 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTHP1H1dz5lK2v; Fri, 17 Jan 2025 18:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTHN6FLzz3m9X; Fri, 17 Jan 2025 18:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737139632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1DxIA9LOsHvuux7pJEpExhqhGta4dcAlzQ2gWCQwIGs=; b=DdXazGw4jgr3P+pzCf0QdYgOqFIO3Wh+DCFqjwg+pCYyng3xSi52IbTW6JjdhK10fzhDnY G/jZITkPPSgZjg3GanxTAvfQ1b72R59cEZo5xX45LCjaPD/6cq1Ew+aYn113pPkOAM4sU5 qyNzXFpqlGVu9jnCoFnQ9hghUI+nPb71KLYX5ZpGr+bdC8hHtJIdDnUd4D/9lpE14w8DeO L2Msd30IuKFU/aBlqVbW+q6lJ9DXF/l1MKwQUn2QRj/Fw4D9QHGwV/iFBqJfb++OLRIzCm pxitdlymlR5o7bzn9ncyxmpl5x6vCx76whBHXKmSWg/J4ibFpTr8lHY44xbolA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737139632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1DxIA9LOsHvuux7pJEpExhqhGta4dcAlzQ2gWCQwIGs=; b=a8a8dYYtM+VYBIJH1itIH3uRjodAupCgB9VhLtYEqrC+zoTGtVvocsaFFNSF5EL+ey9Or1 BONSskhJX97vcG2RCGBNAAdNHqdDEzxrOzJnnyLqtrUmmguy/JEa82+tu2evE9RPzs1AoH G/4NBR8mcUN8o31zqLHl8eUp1wV3z+2xra6RSD1bGVg24k42S1fKwyavEN7fNkFHnohK8M IjfPWTmi+ug0MT2vAw8ZQlRa/9t/w7Rp0JIHPF/e/SigisrJINVqapOoPHlA/Y3tFHMJlh bJ0LAaVwS1wZZAwnlotOGI7XxQdFN7HeAF0z7njGKzf00C055ZBRD+z7IuHlbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737139632; a=rsa-sha256; cv=none; b=tr0209whkYObOYs0moPvThfrBL1JZdk7jhhp5qI5ZNaCZkBKrLFh0JZ0MFuPo0R3rupySk ALDLvjI8mbVeuE7D/NfG0c/F7zOiTwJ28kvQnUsWJ0dOVaHuxMgp4+PoICk2f6dKHs1/DO wXT8HZxgadz3lZ+GwIF/vIaqcNb8ggsd5R+0mHZjaMlwrMPtONex1JuWB2v+VQcggsntCF cmIkGe/QoEZzPx0KYEnrOcQmg9q19uvd7VKV6Z0VynLl7tt5/mW069kOqr39Msj2kY1C+4 Izz/BXCQp7Sh+faqzHtZ1a/E644rCl5HOah3NVgx+3dpfcM4VIGheEBXaOChSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTHN5rq5zVVj; Fri, 17 Jan 2025 18:47: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 50HIlCq6061378; Fri, 17 Jan 2025 18:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HIlCwC061375; Fri, 17 Jan 2025 18:47:12 GMT (envelope-from git) Date: Fri, 17 Jan 2025 18:47:12 GMT Message-Id: <202501171847.50HIlCwC061375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 550dede8754a - stable/13 - Fix "vrefact: wrong use count 0" with DRM List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 550dede8754a1ddbf3e44894b20cb74c48111ccf Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=550dede8754a1ddbf3e44894b20cb74c48111ccf commit 550dede8754a1ddbf3e44894b20cb74c48111ccf Author: Edward Tomasz Napierala AuthorDate: 2024-11-13 10:00:38 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:47:03 +0000 Fix "vrefact: wrong use count 0" with DRM Bump the vnode use count, not its hold count. This fixes a panic triggered by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be what glxinfo(1) from Ubuntu Jammy is doing. PR: kern/274538 Reviewed By: kib (earlier version), olce Differential Revision: https://reviews.freebsd.org/D47391 (cherry picked from commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c) --- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 81127bf364f9..2697f02c0dd7 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -948,7 +948,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, } /* hold on to the vnode - used for fstat() */ - vhold(filp->f_vnode); + vref(filp->f_vnode); /* release the file from devfs */ finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); @@ -1680,7 +1680,7 @@ linux_file_close(struct file *file, struct thread *td) error = -OPW(file, td, release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); if (filp->f_vnode != NULL) - vdrop(filp->f_vnode); + vrele(filp->f_vnode); linux_drop_fop(ldev); ldev = filp->f_cdev; if (ldev != NULL) From nobody Fri Jan 17 19:17:32 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTyN4BPyz5lLqy; Fri, 17 Jan 2025 19:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTyN3h9kz3rFR; Fri, 17 Jan 2025 19:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ynJXIQJ0QzNKAIglvFCmu6DdX6ftsHqdMH0EjbBK7A=; b=GtN4WFpakAHLVdqJcI9pQqtQRdlMe+AWuh+53ZKYXczmsDSDmON4g4cDPqKoVuGn4ZDWPH AZRnrwE+XRwHitc6MKd2A/U2BnSY/Rv2Ssz4j2eewowu8Vmnt12FVMHEf7A2EWvUGMhjj6 hQWBxvFwwbhQ6/VJhEgbY/mklNVW2v1xS4+a2m3EwWR3HpSilKbr3k62oCLkjyf1xHYauW nr2SgNWigIKwoOo8NZv8rIQH/5K8pqGtaqz2/mMpmxnnJo50hU1OpYy2uMkTXZ9h6Dnrb2 OFuBOgtPiyuH6SOOgc6A/wVnh3IQwG8OuIf9FlKqqEDFAuNeHsXADiCWgiCfTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2ynJXIQJ0QzNKAIglvFCmu6DdX6ftsHqdMH0EjbBK7A=; b=RxkxBvNE0h7r9Ioacja5KjlFBeyxTlbI+Ls1g2KpFtK9aWrIeWE2LyaHEPbycOPG/pL+w/ yJNiZd8hJI+JdgSrVQKO5hcTZXHh64Jkyuuz43j1m4I9qhaZi3iqD0+AHa5gAsTFRaczit JhL6ruX1hOZnprNZYfNlQt3ldM6Ttr26IZezvGOQbLeh6sNLUgE5dHLL47KB+EuyH4XImt lFcAOkJZtobIdj/vmF6/SPY0durASkoy6uW14EWIlpfkVUpbAm7IDOtCs9iQhkBNVZ9XAd W738q73HUSg3RPkrUm/sZ4fYe9O3PnypNSr6OGdYaH+kFp7E62smyjVvwgDKcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737141452; a=rsa-sha256; cv=none; b=s7OYOjwNpSv/gdmmVXLsxdf8AF/VWnuBEUpgRU0iKdpDK7GaQJFK7WDai2+MvzB6q0MLjT ANHkp6eBTBAnndmdq4s9LqiAZWdIy048uPFUOhBjwoqzb2xJYmFcLEd6b+F5hVAnNYhg7l D+ELBeCY0ln94LGz9rSXERJYENz8R4ZKO9BO/fsfhb93kueU03MF8MbdXbuzEwWiZXvUN6 mxk/PThdPRzlrnrD+rHKczUQsln1YrmyAla3jZKyw5WOR7LN7LAi7A9lnnPSOP4LmpTyCs JjLamUrTzzkmV7kY53eEC8fxI3z5CXm0ZaNnUXeLfT9U8QyvBvOQsgYJCA/Elg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTyN2sZ9zWYc; Fri, 17 Jan 2025 19:17: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 50HJHW0U011361; Fri, 17 Jan 2025 19:17:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJHWa0011358; Fri, 17 Jan 2025 19:17:32 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:17:32 GMT Message-Id: <202501171917.50HJHWa0011358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3e2277276975 - stable/14 - sed: The change ("c") command should start a new cycle. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e22772769757b31d2b9383b5f510d4e43afaa8b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3e22772769757b31d2b9383b5f510d4e43afaa8b commit 3e22772769757b31d2b9383b5f510d4e43afaa8b Author: Valeriy Ushakov AuthorDate: 2024-12-17 22:27:01 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:48:07 +0000 sed: The change ("c") command should start a new cycle. The "c" command should start the next cycle as clarified in POSIX 2024. This is also consistent with historical and gnu sed behavior. This patch is from OpenBSD by way of NetBSD with a tweak to the man page date by me. Confirmed the test case in the bug now works. PR: 271817 Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert) Sponsored by: Netflix (cherry picked from commit a2d78713171cf138b5ae50d61f82df1af7574c95) --- usr.bin/sed/process.c | 2 +- usr.bin/sed/sed.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 945db462a601..e3f2bcab4881 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -137,7 +137,7 @@ redirect: psl = 0; if (cp->a2 == NULL || lastaddr || lastline()) (void)fprintf(outfile, "%s", cp->t); - break; + goto new; case 'd': pd = 1; goto new; diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index 29ede6d70230..90b23e2834de 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -30,7 +30,7 @@ .\" .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" -.Dd April 8, 2021 +.Dd December 17, 2024 .Dt SED 1 .Os .Sh NAME @@ -374,7 +374,7 @@ If the label is not specified, branch to the end of the script. .Pp .It [2addr]c\e .It text -Delete the pattern space. +Delete the pattern space and start the next cycle. With 0 or 1 address or at the end of a 2-address range, .Em text is written to the standard output. From nobody Fri Jan 17 19:17:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTyP4f8yz5lLV1; Fri, 17 Jan 2025 19:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTyP41NKz3rFW; Fri, 17 Jan 2025 19:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FW4P7YCpZiYUSEiDsqHJKjoUnbmCprgmdX97tqNXIk=; b=Jt02K3ONRBw22vsvE0tlz418Q/FfTQe8BwKHZ3nkq2Ed7x3HrtmpBxBwzNNKe1Iz2Fm9p+ yyxeUvXPkzu7Kx4V+VoXdsARQebXa427DCkNts+YNhDmQsh76UzSaDXLz8bf5cUO1wNbGv Fa7lntd0Pzyus2Cfi2PYDlGxhU7+HsWa+fDuZo/sV9vb+hV9lwbMTxXSgUQa/SxiWEXvMI VNq/lKL+IQRhdlXPK+HvKA/+G1D8aD1A6CZQnfUMYInVSk1oaGv7koHV4L8nuOHJWA9aXs Gd7O7XWB+7UNLAn5XtpsBrcGBolNDXGN+XcPx8hLnOASmuGIjUFuoLr0B+CHYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FW4P7YCpZiYUSEiDsqHJKjoUnbmCprgmdX97tqNXIk=; b=VvXtL1s/8LMNS/X4OKKGcvA9+um18D+KieYCLiOYDtWUw6sdS/B4kuXbu0FdNscV5Za/TR svjbZqoCHhmr31zcpVd1rzwgaCyPkNL0nrrhzSacr733JLBE6OtC7H5HcbQ5JXlOroEn20 0g6KPMCeoL3Ukn2VbT6eilBCEx+Ds7CrRXi2cSR2YVmFyfGyXxUazLYSYhx/+/iFAfG4HC zuuxJCqztOqgKxKToMicEAD7svXCz4tVf0ABAEX+RUrqGxCb+c0auREoZUFZRcC4as2WvA Zg+TNm/c+ocBpMSWr/24nhLWtZe4DSukQ9FOC9L5JvkdyCTxkecqO7l9DE1Asw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737141453; a=rsa-sha256; cv=none; b=wnUTV5c1CcJ4K8plDkTbKwsljpH3bq+4q7/mjwFb+hGXaFFQKBLFXJCaYeGkEZ/kx2vz82 vSBaPnD+IIpXUVOdbKPn7+bC++gyG4n4P48XAgzWcoSLSCZbTm+P4jVB/HOEZTmSrEij63 WwUoGAB8nyh5dN0kwDz425gSuPFPjNq9tJnAcwR+i3NdjHmmK3HH2u9Tq0+ycpz9AlOanW 3aYDYg2YsSr1J/ajSfcf4UoW4LGBpLUXZG+syT4/wYPuJM7xxJinChTquwudn3emQDtSRS y5jairjjlI58+pmV1hAarMbd9E7B0D3l+5H3C9TFcCJBIge2B8/kfCDy+OybQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTyP3ctbzXFk; Fri, 17 Jan 2025 19:17: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 50HJHX5g011418; Fri, 17 Jan 2025 19:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJHX4X011415; Fri, 17 Jan 2025 19:17:33 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:17:33 GMT Message-Id: <202501171917.50HJHX4X011415@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 6d34cce60684 - stable/14 - sed tests: Add a regression test for the c function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6d34cce6068401e5736c05b3c130c0583af1f2e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d34cce6068401e5736c05b3c130c0583af1f2e9 commit 6d34cce6068401e5736c05b3c130c0583af1f2e9 Author: Mark Johnston AuthorDate: 2024-12-23 19:06:11 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:48:15 +0000 sed tests: Add a regression test for the c function Based on the test case from PR 271817 by Mohamed Akram. PR: 271817 MFC after: 2 weeks (cherry picked from commit 003818aca4cdda47adef808a56d48003aa514029) --- usr.bin/sed/tests/sed2_test.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh index 0b849b1ea132..c88e998425a0 100755 --- a/usr.bin/sed/tests/sed2_test.sh +++ b/usr.bin/sed/tests/sed2_test.sh @@ -159,6 +159,28 @@ minus_e_body() atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a } +atf_test_case command_c +command_c_head() +{ + atf_set "descr" "Verify that the 'c' command starts a new cycle" +} +command_c_body() +{ + printf "%s\n" a b c d e f > a + printf "%s\n" x c d e f > expected + + atf_check -o file:expected sed ' +/a/,/b/c\ +x +' a + + atf_check -o file:expected sed ' +/a/,/b/c\ +x +$!N +' a +} + atf_test_case command_D command_D_head() { @@ -182,5 +204,6 @@ atf_init_test_cases() atf_add_test_case hex_subst atf_add_test_case bracket_y atf_add_test_case minus_e + atf_add_test_case command_c atf_add_test_case command_D } From nobody Fri Jan 17 19:17:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTyZ1p0rz5lLr5; Fri, 17 Jan 2025 19:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTyY5zWJz3rY1; Fri, 17 Jan 2025 19:17:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB6SQhWdJ+O8M3fn0M6qaljdbACZIOtXj5EFATuDTuU=; b=SpGhLSvlCdiwivHSpLbzatTAZXGOZOXUopWlA+siXAzeHxNXM97471DrMc2PboP8pKGdai 6SVXYN6QhBtgMppA8Dl/uWUNkBAGlpw3iiLMZsAxg0iLDdebxIpaG7dB0r/4dWl60AaENV 9Ot/qf9B27KtAf/AulYGqA2wZLZUKGxtf7MAgD1MTJgCKp5ncOdiV5KgDRt1wLaxGGmu6n CYgaGgbVGNT6IVbK6Rf025mSvMWdSOzQfvWJjSWGbQNltnryOtHYVB1TKQbIdDnREhhcRY 2ZdIBm+WHqKSrb9KzREUKncu9IHtFnpN2yfJ926DmswXKIqv9XgTGPXFoxzCXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB6SQhWdJ+O8M3fn0M6qaljdbACZIOtXj5EFATuDTuU=; b=Cze+82z/W0y24jCU54oNEL4CnRDLHdP1KbfllFC6ihlMzBIpB7ZMwMLiAOYpqMGNeAeA0n 5e1ga1mhHyMPy8MdX3Ybn61I2uGtlKr4yAf5Oyl8QtrVvz7iOaLfbU9tb8YYp9FJwzJguc tOQKzKeHxLTPgbNZj/jPcJGlCvIM2RCCi3c7KwZ+l0W0hKfu8a8d7UUvbj3LE8Arbd4eOA fOqHp5YL8xPuyEw/d8YYuqyYHiEMRB5lC3PIdQYQLmeWb7/7OGu2cmjxozGxzhRXxz55JJ 4Tf1b/wf7XJRxz4mnNJ56gGWXNoM3hHjj/ICUSumOYzmu4FQlm3QyB6TLzWRhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737141461; a=rsa-sha256; cv=none; b=dn/LQWTtjs31TgoHrAwLnEEz+NtmUx+eWiXAk6gaCUNmUMWgyS3pTdxkj3msLylFXsIZ8+ taQXKpUd0K3Q8vsRdTLzPr5B/2IkXtz32BT41F94T6+/+KRWwvVr/o+BooDxf+OalUHoKH Ym94CF0Hk1xveCEg58n0Ff60kr1h9uMC1PjEwcTqA28ZP2uLlxa1llWOTjaejsoBRUY2re O+cF7zq/Qcx4B0PzMNdjzG6uZKeYlvbKqAuY8r+WVqtNBH1zLvF1eB9WKTDm4njJ5fcEbn bCF+XX7/eLBnSDYmlTJ3j5q4H1xbqdRv7CBOxOpO59R9bYVwOc864eOkMj2DOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTyY5SMWzWWd; Fri, 17 Jan 2025 19:17: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 50HJHfs4011651; Fri, 17 Jan 2025 19:17:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJHff4011648; Fri, 17 Jan 2025 19:17:41 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:17:41 GMT Message-Id: <202501171917.50HJHff4011648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 9c348f73a856 - stable/13 - sed tests: Add a regression test for the c function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c348f73a8568769b1a746efd9ccbca2f4ef7252 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9c348f73a8568769b1a746efd9ccbca2f4ef7252 commit 9c348f73a8568769b1a746efd9ccbca2f4ef7252 Author: Mark Johnston AuthorDate: 2024-12-23 19:06:11 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:48:19 +0000 sed tests: Add a regression test for the c function Based on the test case from PR 271817 by Mohamed Akram. PR: 271817 MFC after: 2 weeks (cherry picked from commit 003818aca4cdda47adef808a56d48003aa514029) --- usr.bin/sed/tests/sed2_test.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/usr.bin/sed/tests/sed2_test.sh b/usr.bin/sed/tests/sed2_test.sh index 0b849b1ea132..c88e998425a0 100755 --- a/usr.bin/sed/tests/sed2_test.sh +++ b/usr.bin/sed/tests/sed2_test.sh @@ -159,6 +159,28 @@ minus_e_body() atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a } +atf_test_case command_c +command_c_head() +{ + atf_set "descr" "Verify that the 'c' command starts a new cycle" +} +command_c_body() +{ + printf "%s\n" a b c d e f > a + printf "%s\n" x c d e f > expected + + atf_check -o file:expected sed ' +/a/,/b/c\ +x +' a + + atf_check -o file:expected sed ' +/a/,/b/c\ +x +$!N +' a +} + atf_test_case command_D command_D_head() { @@ -182,5 +204,6 @@ atf_init_test_cases() atf_add_test_case hex_subst atf_add_test_case bracket_y atf_add_test_case minus_e + atf_add_test_case command_c atf_add_test_case command_D } From nobody Fri Jan 17 19:17:40 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZTyX5Lrbz5lLm6; Fri, 17 Jan 2025 19:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZTyX4t51z3rXl; Fri, 17 Jan 2025 19:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qogC5z7Tc7zij/xi50bNvBE1HXvuJbJlAf2o2p78T7U=; b=QU16/YrwrJnlcIJilRWAgQF4nt+p6yMn0RPglvRJmV4f5OR4Ux4id3k2fgGlTBXG5SrWrx e4TBApfSUVCkMTsaBSOM5KfAPze8FyP7wSiJUKv2USZXvM/BLxj/vHAueX+KbCnIyZpGoC MFEPW8JLjYz5lZkr9F5WRR8UfY4l2dXNJ8EozSkrW2H9IKLWuTvcmwhWM/E9I8mCFyS+8D CPNG7FoqVQl5/Z/9dCXvQh8NhvpxLBiTLzeq6hJqI+uJsUxEIfHYvgvVEvcWrHs50DjM3t el+DKN3013e7ee+SUDpCZESP8mHwiOsJG/744LKDHbT9pN84lYnZt508Mdwnow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qogC5z7Tc7zij/xi50bNvBE1HXvuJbJlAf2o2p78T7U=; b=Cf1FaFsOBJ4obIC3HNJ5FJBYxEyVX20Q/6w4plfpNXdHtoLNDVyopXiUkhanhbzEVtqACf hLUmxVaRi1XmFpl9Kysr3sJPDqIAMQm2+X8WX/cgV6v+mYLvTYG4KIFw3VRJ/s2zVvrtnT eNnLHx7tfhjZiUR+vc2eLx+KqrK7fzZS5CFBL0GjV9nFRmNWfubRtf2V41yz91E4Ubj+XE r5LeND8v9jX3eY6sTHa35mwAgUN2FLoU8hcTL+1MHJVJlzku514bOlQ4MaF4M3p9UMsJfx 06084ltu/apQEnha7RsghgffZ/TAduzlqPNKUa+n1gSurGPgX+hL9/IxUP8QZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737141460; a=rsa-sha256; cv=none; b=tBdRiD1vCMMVN6VHgQPWIN7DyI2eKfm5zGoF3QQoQSPBgUpiuofwpihW1GVBla830gZdRl ty7Wg3lceJycHz6on27AJASMc5wZ5yjGNllCxQIqmR+yFtWqUYw9BTbSAIOY7lvgXfWMSO CChoAzpWSvncJ01nqjoRfaNT8loL+9liUZ+HCEaP9SfUBWW0T6a7iXQ+CwX3yvFYjMcF+5 UGMFJVp21BwNMaj3gla5nfQO6YcSqehWhI0awpqrqqJjCYJujA1NSF4Buns2qv7aIuSRT3 EOAxPtLsTDPgLlhcvh8btr/YygNdlWx94EdLKY3GQxd3HVxfJaAizInHueNDuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZTyX4QMXzX1g; Fri, 17 Jan 2025 19:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HJHejD011594; Fri, 17 Jan 2025 19:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJHeLK011591; Fri, 17 Jan 2025 19:17:40 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:17:40 GMT Message-Id: <202501171917.50HJHeLK011591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5ea64bfc9a6f - stable/13 - sed: The change ("c") command should start a new cycle. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ea64bfc9a6f8582b952580c7cdf754e7ab4a078 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea64bfc9a6f8582b952580c7cdf754e7ab4a078 commit 5ea64bfc9a6f8582b952580c7cdf754e7ab4a078 Author: Valeriy Ushakov AuthorDate: 2024-12-17 22:27:01 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 18:48:01 +0000 sed: The change ("c") command should start a new cycle. The "c" command should start the next cycle as clarified in POSIX 2024. This is also consistent with historical and gnu sed behavior. This patch is from OpenBSD by way of NetBSD with a tweak to the man page date by me. Confirmed the test case in the bug now works. PR: 271817 Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert) Sponsored by: Netflix (cherry picked from commit a2d78713171cf138b5ae50d61f82df1af7574c95) --- usr.bin/sed/process.c | 2 +- usr.bin/sed/sed.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index 945db462a601..e3f2bcab4881 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -137,7 +137,7 @@ redirect: psl = 0; if (cp->a2 == NULL || lastaddr || lastline()) (void)fprintf(outfile, "%s", cp->t); - break; + goto new; case 'd': pd = 1; goto new; diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index 29ede6d70230..90b23e2834de 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -30,7 +30,7 @@ .\" .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" -.Dd April 8, 2021 +.Dd December 17, 2024 .Dt SED 1 .Os .Sh NAME @@ -374,7 +374,7 @@ If the label is not specified, branch to the end of the script. .Pp .It [2addr]c\e .It text -Delete the pattern space. +Delete the pattern space and start the next cycle. With 0 or 1 address or at the end of a 2-address range, .Em text is written to the standard output. From nobody Fri Jan 17 19:20:45 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZV25492Mz5lLxV; Fri, 17 Jan 2025 19:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZV253X0Lz3sZ6; Fri, 17 Jan 2025 19:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nDtBj1NHI5QQ9F7zQxDR490Y4Z/I05OaRIxpnlpb+qs=; b=dcUtUa1O/rDuIJvUUqbL5TF1PMyIv5gXOXwriRXxqyioSdxawdMw++9XHbF00vjBvRg+WU 97hgM9y7Cp2Zy2lNcs5Frfe3Mzrxo7u8oORP3JHQU4pGrkXXRlGvNm/Q8D89f4MVW5wHW7 /tqju4CNBNfS1uSPbj7BFAOO2O14o9oG7iYnSnzYN9mEy8BCjvxtaJC4FdY7Aa24zdWKrO vj38eiORrHBtBj3Ivi+S1+3Hud2BNDsbPeAGfdtkfCXjtOuec4o/TkAolRgIDXLrXmYGyI /p6GZX8438ZHgqxr0IAqjwPtYBYjOYK3MHot3OA0gAuVBIebuMj2/kQy0Xnz3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737141645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nDtBj1NHI5QQ9F7zQxDR490Y4Z/I05OaRIxpnlpb+qs=; b=bnEjuzBLWevUlksIN9YzPNkzHTwgiCtOt3XfkiLaWJIcBQkSaeePIic9FsJbsGkV6P8YEq G1OHb+m0zVaA7e2Q1r7bMmDprG0/fa1oOzENprcbvBbiUxs8gyiGPb5yhJog9My3VNKrM7 lrmd7YLys3xKH/3BmgwbYn/8gBaVLQ1tJNubJaInB6wKCk9oeHnVRI7QxwPW9XFPcOV0D2 dIElAkXAE/yoBX91SHpDM5/4g2OZEpazEpAJVIMLlU4v6Cq+jDE9iQ4AvZFJ6krNl39QgW ZqvNCxPqG8eEJ6nu8qYsf6OXmMWE6Y9HV68hdDnUQ0T7J+JvSZndpZKbJrmMNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737141645; a=rsa-sha256; cv=none; b=kSR+6RQTBkazkWM6wUsWiwiHhSHvLOk+JA4j7NYMO4jW3f/eOW8cMtNw1QARtLp82uBlXM 0pMqsUWmalLwePNGyuXemwLwPfphYwlJbVRt5qI0l1e1tEuKlgqvGqJf2g6DC+iiM+G+bc 3XhoJalqrIHYmlWtcVtmB8rNzIbY+Tl8vcQUNPyVqWckYz3rbZBItV0XTHcE0PQ2J+l/Ix RF0NdZn2Vslwu5Vz2h+UGLvaN59aA34tDHhhWv+0lZj+k9UuuxJJ7iuhKKVBeHWgahegcC x8Klyeoe3p6cXgE5HBRR1vf4OHwwenV3Zi1F9ucC5PQA9nvHgELc//J3ksf88A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZV2532f6zWYq; Fri, 17 Jan 2025 19:20: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 50HJKjpp020620; Fri, 17 Jan 2025 19:20:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJKjMd020617; Fri, 17 Jan 2025 19:20:45 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:20:45 GMT Message-Id: <202501171920.50HJKjMd020617@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: c4380d5b9383 - main - rtsold: Add -i to the usage message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4380d5b9383e2a062840573b36ab643b65b2610 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4380d5b9383e2a062840573b36ab643b65b2610 commit c4380d5b9383e2a062840573b36ab643b65b2610 Author: Mark Johnston AuthorDate: 2025-01-17 15:14:22 +0000 Commit: Mark Johnston CommitDate: 2025-01-17 19:20:14 +0000 rtsold: Add -i to the usage message PR: 266634 Fixes: 231bac4ccc43 ("rtsol/rtsold: Add option to skip random delay") MFC after: 1 week (cherry picked from commit 9e9e64b693ab1e08cca46e26e468160542c33f3a) --- usr.sbin/rtsold/rtsold.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index 91c80d178bc7..e0b168a379bf 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -792,17 +792,17 @@ usage(const char *progname) { if (strcmp(progname, "rtsold") == 0) { - fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + fprintf(stderr, "usage: rtsold [-dDfFim1] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] interface ...\n"); - fprintf(stderr, "usage: rtsold [-dDfFm1] [-O script-name] " + fprintf(stderr, "usage: rtsold [-dDfFim1] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] -a\n"); } else { - fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " + fprintf(stderr, "usage: rtsol [-dDFi] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] interface ...\n"); - fprintf(stderr, "usage: rtsol [-dDF] [-O script-name] " + fprintf(stderr, "usage: rtsol [-dDFi] [-O script-name] " "[-M script-name ] [-A script-name ] " "[-p pidfile] [-R script-name] -a\n"); } From nobody Fri Jan 17 19:41:41 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZVVG0bT3z5lMpK; Fri, 17 Jan 2025 19:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZVVG076cz3ww5; Fri, 17 Jan 2025 19:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737142902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RsSxk9tk7k17E6SyMzYkuAerTaQOtA8JrEw88YeE2T8=; b=pgME/nylpWGQBPS/4BUmMP3vRmBHNM1ZWBxdMFibHTZP9CVFFzXqsw7iQw1/gcQhdUj4XM Stcex2xz2nYGtae152adLcgYzXX4iGLjKRNMpDYK3oe8HPvFOR8g4JPxH3mQy9poQvrZAk eRnxZVFszvdMoxtZ2FR2ukGp+Fwd1UdSKXMjd6KdZcJHnImxou//TSNG6CehyoqUEnOggA 22sne0sAzTgx3aIg1Q0IO0KXoV7RPa5h2Vitj0ouqZPNKklNs/0FZRgMiMdfNYooeMfd/Z TZvQjA3KkGUlpkgPNDmz5mS/RnObURiGZplR9AWord0Wb19pEGnQSLthGOurNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737142902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RsSxk9tk7k17E6SyMzYkuAerTaQOtA8JrEw88YeE2T8=; b=iQ9chaKZXd/TSk6lzbEF/SIyKYcSZSjxAnpieu9zHLmNPtRmSCcTedX20EqrDPwRHBe7tz ICUMeWmYyT38P5K1gaWP/FIcodXapBcnIWo4Bs3wA6rVfGCS0kmVevDTHJzz6DkldlfOBr ebMVSSb6XwY12qQY4YDhEJu+ZIIgHjXLsk2/y7Q/+5F3U3ySQu2RC19tVxRL3dj74UFFPe ndl2xlOo+paQBFpDi7RKiADLsAfu9a87s1ne9wG+56T/BPSOzNpX0hSMkcambwn4DYHLSI nDFFUQPYR7rCLAKMVRpqxMI9jQauniABNIYhb+k1qSDfsNp2UqhkQ28hzxbuvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737142902; a=rsa-sha256; cv=none; b=JxSTv5spa8FewSpSIAcnJO7LzqZOFfvE/SWrUuNtS7li7U1EO1gCi/Gl9Z1ei3iVqlQUsM nNw45pLTGxKF5MZCgpsvUlI4Ut2RoQrine9pbf2AbcuU8RB65Vah3YaK/vfb/zd/6mbwvC 0C5IABRd82MQHGsPdfacrY/XQp68gvAFwf6vFIJgag0St+seryGP5w5KzOW/n07L0KhKJp yPfA/McZy1SYczkPLSeYpZMvyFgxjbJ9Czxn6O4mdLzTUJvsnbYTky2jvDu8ca9w6g06tS GfgEG+QyoNj6UXjwQYoYOzbPMadM6+ivwbC20B1StTRgWKd2M26+LxUBCtAYMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZVVF6kMbzXbX; Fri, 17 Jan 2025 19:41: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 50HJffmf054900; Fri, 17 Jan 2025 19:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJff6F054897; Fri, 17 Jan 2025 19:41:41 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:41:41 GMT Message-Id: <202501171941.50HJff6F054897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 797bb39ccd5f - stable/14 - sockets: virtualize kern.ipc.numopensockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 797bb39ccd5f57c3206665949d3cba35328cfdeb Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=797bb39ccd5f57c3206665949d3cba35328cfdeb commit 797bb39ccd5f57c3206665949d3cba35328cfdeb Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:58 +0000 Commit: Eugene Grosbein CommitDate: 2025-01-17 19:34:16 +0000 sockets: virtualize kern.ipc.numopensockets To avoid breaking POLA on the host machine it reports the same value as before. In a VNET jail it now reports number of sockets in this jail. PR: 219655 Differential Revision: https://reviews.freebsd.org/D48315 (cherry picked from commit 59498e099cc055da7afca8266087b7668be6d7cb) --- sys/kern/uipc_socket.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 162c489ea6fe..1e49b9b20588 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -274,9 +274,23 @@ SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, sizeof(int), sysctl_somaxconn, "I", "Maximum listen socket pending connection accept queue size (compat)"); -static int numopensockets; -SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, - &numopensockets, 0, "Number of open sockets"); +static u_int numopensockets; +static int +sysctl_numopensockets(SYSCTL_HANDLER_ARGS) +{ + u_int val; + +#ifdef VIMAGE + if(!IS_DEFAULT_VNET(curvnet)) + val = curvnet->vnet_sockcnt; + else +#endif + val = numopensockets; + return (sysctl_handle_int(oidp, &val, 0, req)); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, numopensockets, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_numopensockets, "IU", "Number of open sockets"); /* * so_global_mtx protects so_gencnt, numopensockets, and the per-socket From nobody Fri Jan 17 19:42:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZVVp65Xsz5lMpQ; Fri, 17 Jan 2025 19:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZVVp5Qdcz3xXc; Fri, 17 Jan 2025 19:42:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737142930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wuHRgx/J9wKhPYoRqj7tdXebFT2RWgXgwTO5rge4nE=; b=jSnx3I05I47mzIQr35bDxtHBN5wdiTD8okMmYLKhQk4bYdpQZOsLIGNB69NzY6cUgAZKBu bYoGjc+mPR79FGGdBhMqVG1gszSNRnWKF7G1bbzc3KHq7METWkXSf4qxKkvYJ1m+7jpXoA b42C0uv0iy6S/C9Ung/wneUJzr+b+HqlqgKxSiZwDhPENHYQAnPj361+UTF9buzVdZ8gIC k99z82c8m5taTEgusIoHGivvvhJ1OcabsrfyEbjHLgtPjH+Mwdhm7LDy+THeFwAufrk9IF 7UxBNEA+kyW6czNhx7FnWFCqza1esyfelJTawGeXce/xOqk3KsmCzlxVErmVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737142930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wuHRgx/J9wKhPYoRqj7tdXebFT2RWgXgwTO5rge4nE=; b=innp3SMHFop4kC08RYj1S+J9vrtfAWyJDZlIIMk96jfZR2WxOwcmSwh1CHJXD8bNz00Mj/ YNV+0tDAhIxfMhgGGHV6/NhGkXfVJ6ax0yB3q5dBsLjj4hZtE7PLHsd3ttOeR8NqE8TjOb 1oGWn7Ri30Ubox9jbd0doX9ksHl8r94igtNCeQ29vVe0+++hITK4ROv092G7AdTUo58gmf 1kxxOytDYbr0TwcbIfKyNLMxYAB/WPYFEbINqS0RJhWhApHkoggKhQUifZfMmQLOsnt/cJ tzZLR8b/H/QIwSvywpJaEcashVzf0d3mhnEAARG5sSkut1/xMw0zh6ORBlg92Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737142930; a=rsa-sha256; cv=none; b=MlEs5chA/QvZzFxBj9v1kLuoUmzF12vqaYUwrvT8JMRMtrrfhwpYaMoJ7PC6k0HDgGuXKc JUZM0dPkfC3bf65eiQVtkpExyd8KJ3J4QOddICMcss+W4kE+tF5xFltu1y8JrNuXPrH8Lm oHVuKHu6W+/SR1AJIX1LBBYfcKar7WNzdXCAUdO0e3fYofqKTrjoNkHlmlWcZ/zIAIHq1p gxDDmUacVK7k9HimPaS0AA537fMQMzRa67xEyTKXiNlAedKqycBs2IzsTKTnLvADtU0jh5 hjed/yiYFi9nYjpnn+QtbGby8NQqJdevHQ4bIdetz0yqP+d3EB4HqMQTJvx9pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZVVp4lT0zXr4; Fri, 17 Jan 2025 19:42: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 50HJgAki057150; Fri, 17 Jan 2025 19:42:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJgAso057147; Fri, 17 Jan 2025 19:42:10 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:42:10 GMT Message-Id: <202501171942.50HJgAso057147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 08384f613cd8 - stable/13 - sockets: virtualize kern.ipc.numopensockets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08384f613cd808e31fa3ae3dd86fa078b49d3f4b Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=08384f613cd808e31fa3ae3dd86fa078b49d3f4b commit 08384f613cd808e31fa3ae3dd86fa078b49d3f4b Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:58 +0000 Commit: Eugene Grosbein CommitDate: 2025-01-17 19:41:51 +0000 sockets: virtualize kern.ipc.numopensockets To avoid breaking POLA on the host machine it reports the same value as before. In a VNET jail it now reports number of sockets in this jail. PR: 219655 Differential Revision: https://reviews.freebsd.org/D48315 (cherry picked from commit 59498e099cc055da7afca8266087b7668be6d7cb) --- sys/kern/uipc_socket.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 81145ff1e1ac..24cb885504c9 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -246,9 +246,23 @@ SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, sizeof(int), sysctl_somaxconn, "I", "Maximum listen socket pending connection accept queue size (compat)"); -static int numopensockets; -SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD, - &numopensockets, 0, "Number of open sockets"); +static u_int numopensockets; +static int +sysctl_numopensockets(SYSCTL_HANDLER_ARGS) +{ + u_int val; + +#ifdef VIMAGE + if(!IS_DEFAULT_VNET(curvnet)) + val = curvnet->vnet_sockcnt; + else +#endif + val = numopensockets; + return (sysctl_handle_int(oidp, &val, 0, req)); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, numopensockets, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_numopensockets, "IU", "Number of open sockets"); /* * accept_mtx locks down per-socket fields relating to accept queues. See From nobody Fri Jan 17 19:44:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZVYV4Xv1z5lMvs; Fri, 17 Jan 2025 19:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZVYV3sNsz3xfj; Fri, 17 Jan 2025 19:44:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2NQK1c3QXFq20sn50UrrDIg9aFr9qjYh8fReZRYKRcU=; b=muvcWXipJylmhnKEXJm3PNXsVtFhoTqRt5U7Fqb6LC8o/FZkdC9w25zLb4cGdqF7WHt+yn uV+tuXem2+UXuPApxGS3KQLr9SToNdlQDJmMjbON1vh4LkVvULZekZdNy/KJ4BNVtmOePk SACBpnqzLteMjGxMzLUWYLidHPK3rmnmEAVIFMgmpG0//AbiwWtdhD2dAR0yr3XHVea9cu 9hDPJavxi95a0CWRom+cNAINZUj/fCVRMVprn00l1ML+GHVtxS72nqHYdcxLN6KZEPQ0k0 Ym0F2J90vXO8eFlj23YMIuI/MMTVa8/mZoePzi3IKm/3ofbBTBky+6xqpj+/ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2NQK1c3QXFq20sn50UrrDIg9aFr9qjYh8fReZRYKRcU=; b=dbvXZZxgSNBp9lG3pYnh+tajBjnmBhdSoMU3dJqiGpBDvOfKGXYYpk/Z3+DzYs52EvMrlC XxZuwhaiByQNWOk5Afu2SZZayf9/AXg55QrLcK4pe0KgkIqfxzFrbe7qPQjn6XqcZBE1Vc sIsB+vZMDXqSnQHEDpivWOwiLMD4e+6/rTM1ISlqhkH3Q454vEwkrspLHls4yCB3NEXsOr r/Wr42/w26FA8h8SuS2bNgOHUU7atu5cF6yOy6MgC+cYDaR+0owtTmzBpsvBiyjzq28z53 YML/9TKJAyCGswKOrfeDdxiLD2l5yB6sK7ug2UDY1gugEUdV4/IJet+CD3h/TA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737143070; a=rsa-sha256; cv=none; b=sRkfh5MXZ2uwqakLJNtzv/DcUWL/qf719k6ZEl34UnDya1AFP/VaJsbB2yIGCGfwbdJzsj IXS+ljP1mIVH8YL4mcYoQOtEXhhNvfKvB+yQ0XCy5O3iuwoGGRw0glrWAn+URY/k9qDuw0 jWPvHentF/w2kAD80xYokpzs+NJWF+8VmEvNxpVzuov2EQQILPpYyEVP6P2WiBgUDLvqHK T3k1E76uGHBQJSk0hLLuvpOeefKqXVslv6WFbapbplRerGbEDSSM7IpWLoT5Pd8CBFQxUo nxATyKmopU0SOTRat12swIbF1mBpNpLPxrGkMzczL4+LSYIdIh8o6ZeDCAdJbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZVYV3DkzzXYQ; Fri, 17 Jan 2025 19:44: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 50HJiUx1061379; Fri, 17 Jan 2025 19:44:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJiUJZ061376; Fri, 17 Jan 2025 19:44:30 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:44:30 GMT Message-Id: <202501171944.50HJiUJZ061376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: c348cdf13257 - stable/14 - sockets: virtualize kern.ipc.soacceptqueue List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c348cdf132572ab821f7c75a97453c1d238239b9 Auto-Submitted: auto-generated The branch stable/14 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=c348cdf132572ab821f7c75a97453c1d238239b9 commit c348cdf132572ab821f7c75a97453c1d238239b9 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:51 +0000 Commit: Eugene Grosbein CommitDate: 2025-01-17 19:44:15 +0000 sockets: virtualize kern.ipc.soacceptqueue PR: 219655 Differential Revision: https://reviews.freebsd.org/D48314 (cherry picked from commit 4155be454c46bc1ab725aca5c6969b064b74be38) --- sys/kern/uipc_socket.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1e49b9b20588..fcec1ef166fc 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -240,38 +240,39 @@ struct splice32 { * NB: The original sysctl somaxconn is still available but hidden * to prevent confusion about the actual purpose of this number. */ -static u_int somaxconn = SOMAXCONN; +VNET_DEFINE_STATIC(u_int, somaxconn) = SOMAXCONN; +#define V_somaxconn VNET(somaxconn) static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS) { int error; - int val; + u_int val; - val = somaxconn; + val = V_somaxconn; error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr ) return (error); /* * The purpose of the UINT_MAX / 3 limit, is so that the formula - * 3 * so_qlimit / 2 + * 3 * sol_qlimit / 2 * below, will not overflow. */ if (val < 1 || val > UINT_MAX / 3) return (EINVAL); - somaxconn = val; + V_somaxconn = val; return (0); } SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int), - sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size"); SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, - sizeof(int), sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, + sizeof(u_int), sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size (compat)"); static u_int numopensockets; @@ -1516,8 +1517,8 @@ solisten_proto(struct socket *so, int backlog) so->so_options |= SO_ACCEPTCONN; listening: - if (backlog < 0 || backlog > somaxconn) - backlog = somaxconn; + if (backlog < 0 || backlog > V_somaxconn) + backlog = V_somaxconn; so->sol_qlimit = backlog; mtx_unlock(&so->so_snd_mtx); From nobody Fri Jan 17 19:44:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZVYt6Lb3z5lNKY; Fri, 17 Jan 2025 19:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZVYt5p7Cz3y0X; Fri, 17 Jan 2025 19:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fjboSx/9v9mg41QEJJfwcCmStj56Oqiurm63EtYtQCI=; b=Mq4yRlCoJYrDM8bzyKrtFAO6m5lgCWLr3ZGmRMW3Oy/ON33ehpn7Rcr4rGhqkrB5tafrqA B8kjuM2cfSRKw1Uul3rewTsV/aBxLR4hz049Zh5viT+wzMkFd12zJ6RhAYLuKTWqXB2Cy1 08XCA96SMCEbD2dnLAhVXFhqKwkNUUeIqeDAbAH3o8U5/7otiiRt/PdlmrwNWcnpSH8XKB 82H5yDaKEWnfN6/i6IbwI6PwUd1lkAxvLy1agW4zwziDVIr6BTMBcCahdbPiIjr7FbtULD 4Q+2bQhG1GGA8uqXLlLjx7iJU7Td+ZY/9G/4uSTl/LSldowIA8my85HYrr8knw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737143090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fjboSx/9v9mg41QEJJfwcCmStj56Oqiurm63EtYtQCI=; b=kAV/ff3LKmHxUJzAQsI0wj0xztF27RT2PMW8brDXTV8yRCKVAXr29a18+JKVwj+tmqIxbK Dh5Rf08QgGFtLZlPIc4T6AM/lgf8uCQlVDe9Ohh3SYrV1J8wmGGPbP4Yp4d6Jw1g8aTSSe 0u7W3/9f+QdSYb2YdHtKWsErWaYcwiFSruPAmrrydSs//pGdBW7Ue/XzsR3gT0Gmb7Qj34 q5UbI6EpW2cRhyqX2aTFkC9pbq4V9Cw2qumQTSw6h20Cw9DgyjqF6UNKg2DXJ08glcDiHF BkcBWnFOcnFl3UbFKsyHNhCcQjKVyYJrVZqT2D3Od4womymDq16RBJY0KLQ0Bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737143090; a=rsa-sha256; cv=none; b=Dd4UZqRk0yoOTl/fb46IJRj30t8XGv64IaJM7/QvtxWfCSZGL5QwAUDGF3bVc3crvwUxLK 5EGu2AFXPQxCQxueNvsEN3S/LIO9/MxvbQuP7cNqTxcLLJ/xbzn9IlyfIZbHpFoBzotkEO ByRuOaMsW+EDOR+xMj9bSwPH82Kdx3bVz1kKp3jTju+5sIgGfmANpm16f9Z4SsCzwHzB+y unxZ969g+O3B04xcwaH3KiLoVXpSsUBiSBBjdo9b7kFzvq/xrJO2Rj8+9S7zlf3qXliGA2 3nxDQiIUWaT+BKFeEz/LMo0VogWA7x8S3Q8nWA7wz5+SXPZaAOhNjfjeP4znRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZVYt4l14zXLs; Fri, 17 Jan 2025 19:44: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 50HJioOq061532; Fri, 17 Jan 2025 19:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HJio9G061529; Fri, 17 Jan 2025 19:44:50 GMT (envelope-from git) Date: Fri, 17 Jan 2025 19:44:50 GMT Message-Id: <202501171944.50HJio9G061529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 45d1cff2bfc6 - stable/13 - sockets: virtualize kern.ipc.soacceptqueue List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 commit 45d1cff2bfc679aee4d7f8ae8cc827bc163fbd08 Author: Gleb Smirnoff AuthorDate: 2025-01-13 18:08:51 +0000 Commit: Eugene Grosbein CommitDate: 2025-01-17 19:44:36 +0000 sockets: virtualize kern.ipc.soacceptqueue PR: 219655 Differential Revision: https://reviews.freebsd.org/D48314 (cherry picked from commit 4155be454c46bc1ab725aca5c6969b064b74be38) --- sys/kern/uipc_socket.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 24cb885504c9..dd5df8886aa4 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -212,38 +212,39 @@ VNET_DEFINE(struct hhook_head *, socket_hhh[HHOOK_SOCKET_LAST + 1]); * NB: The original sysctl somaxconn is still available but hidden * to prevent confusion about the actual purpose of this number. */ -static u_int somaxconn = SOMAXCONN; +VNET_DEFINE_STATIC(u_int, somaxconn) = SOMAXCONN; +#define V_somaxconn VNET(somaxconn) static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS) { int error; - int val; + u_int val; - val = somaxconn; + val = V_somaxconn; error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr ) return (error); /* * The purpose of the UINT_MAX / 3 limit, is so that the formula - * 3 * so_qlimit / 2 + * 3 * sol_qlimit / 2 * below, will not overflow. */ if (val < 1 || val > UINT_MAX / 3) return (EINVAL); - somaxconn = val; + V_somaxconn = val; return (0); } SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(int), - sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, sizeof(u_int), + sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size"); SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE, 0, - sizeof(int), sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_MPSAFE | CTLFLAG_VNET, 0, + sizeof(u_int), sysctl_somaxconn, "IU", "Maximum listen socket pending connection accept queue size (compat)"); static u_int numopensockets; @@ -990,8 +991,8 @@ solisten_proto(struct socket *so, int backlog) so->so_options |= SO_ACCEPTCONN; listening: - if (backlog < 0 || backlog > somaxconn) - backlog = somaxconn; + if (backlog < 0 || backlog > V_somaxconn) + backlog = V_somaxconn; so->sol_qlimit = backlog; } From nobody Fri Jan 17 20:30:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZWZM2bGHz5lQ7Y; Fri, 17 Jan 2025 20:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZWZM1lc3z44rt; Fri, 17 Jan 2025 20:30:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737145819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q90Yk9BfyD/ON8IlaxPVjA3ytALrgW8CxTR50w5oyCE=; b=CnkHDi6uHS6vq/+Pr2PIE/BHc2zAKFR37nncTEiEEyo8WpLYjAWCi1vaFXxlh1asv550u7 S2845A/jxDsBywe/e8YLT2h8juivRn0uAI5twn+SyLCNkwvRKTzGCe3TNR2jiQbYzX2GNp QT9pgqoCTh8f7To9Dh+p9s3Lt5zZqjWz+2Z+sIVUlp/M58EKpp1VchHoMkhxTezzSzGRbu ddXzw4bKURnOp6aI1iFTgpJmfSfsOZkunaUztNjU4umPsc103l/YRWeibX24nvAMoR8ZuT fjrWtDIxg/fGp8FvOCwKOotL53LKd5I6wMSnXYUCrdxZ7BcHGVjZD1xIaXP11Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737145819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q90Yk9BfyD/ON8IlaxPVjA3ytALrgW8CxTR50w5oyCE=; b=TlTjmpooxFTWHi/+TTIZtG0BO8Hl7t8i9bGgwoUCGfvQop+u/sumLGI+v3yj9NDKYCZFFT b+mnYxVrk+F31KdT6TkUDKGzB41DHyl46y3a28Wp63/qL8ggjVqMHAzEeqUzdrqa3AluOI gPvRJvQqWvYiZo8ToU1WC7pSwHwr/lYh3lFqnKXBVMNRlU4co1WN+iabBCuE6BXYwDYEkv pq9obb5yekGf3UrX9PbDeZEpQYR0lgxH7+eUCrKOTUL+SzKxLZRurdFGVszzAZjBLFLiyz 0wnJrfNpKQ3/4XJ1d4N5bNQmYtEA8Izxnkprw6l9mmZahxl2z2wBV+DPfQheYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737145819; a=rsa-sha256; cv=none; b=w+PRl9JSt49Aq731Tk84R6CJ7D4tI8USUnT5ymuhhQp2xUmoYN+Amcizbzyj6Gki9Ov4ib 9Kvj6IutVxHg4bph823LMEd6tyj0cxKUlYJpxvoohABfpjnpnz3uqgRN+HgsCNmN5jsCDV SCAkIqczEVNwxaRz9hwIZVaLUYaQBtFepmJT/taRrdmXWIAUVQaQOE7D7erJTXnUXa281m t1CKhDlMJ8Jl70qlYhmDW+P3+4iRhkj2DfnTqiL4VpE2g5perVt2BnblIvNO5vKnltxztX MvYFGvTAtEy+SezopJYlGutkPxCoEBLfosIjYrsmcTy630oQnEYjJaSsf5ynBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZWZM1CwPzZ3F; Fri, 17 Jan 2025 20:30: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 50HKUJjs037743; Fri, 17 Jan 2025 20:30:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HKUJx8037740; Fri, 17 Jan 2025 20:30:19 GMT (envelope-from git) Date: Fri, 17 Jan 2025 20:30:19 GMT Message-Id: <202501172030.50HKUJx8037740@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: 194242604ae4 - main - nfscl: Simplify the deleg argument for nfscl_deleg() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 194242604ae4644ced49fac03d9ddc6994ea9e95 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=194242604ae4644ced49fac03d9ddc6994ea9e95 commit 194242604ae4644ced49fac03d9ddc6994ea9e95 Author: Rick Macklem AuthorDate: 2025-01-17 20:29:11 +0000 Commit: Rick Macklem CommitDate: 2025-01-17 20:29:11 +0000 nfscl: Simplify the deleg argument for nfscl_deleg() The deleg argument to nfscl_deleg() is a "struct nfscldeleg **" although the returned pointer value is never used by callers. This patch changes the argument to "struct nfscldeleg *" to simplify the call and avoid any confusion w.r.t. use of the returned value. This patch should not create any NFS semantics change. --- sys/fs/nfs/nfs_var.h | 2 +- sys/fs/nfsclient/nfs_clrpcops.c | 6 +++--- sys/fs/nfsclient/nfs_clstate.c | 10 +++------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 950e0c097457..00d5b914f4af 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -606,7 +606,7 @@ int nfscl_doclose(vnode_t, struct nfsclclient **, NFSPROC_T *); int nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *, bool, bool); int nfscl_deleg(mount_t, struct nfsclclient *, u_int8_t *, int, - struct ucred *, NFSPROC_T *, struct nfscldeleg **); + struct ucred *, NFSPROC_T *, struct nfscldeleg *); void nfscl_lockinit(struct nfsv4lock *); void nfscl_lockexcl(struct nfsv4lock *, void *); void nfscl_lockunlock(struct nfsv4lock *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index c35d0c6295b9..07f046a82d8b 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -452,7 +452,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) NFSUNLOCKNODE(np); (void) nfscl_deleg(nmp->nm_mountp, op->nfso_own->nfsow_clp, - nfhp->nfh_fh, nfhp->nfh_len, cred, p, &dp); + nfhp->nfh_fh, nfhp->nfh_len, cred, p, dp); } } else if (NFSHASNFSV4N(nmp)) { /* @@ -485,7 +485,7 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) NFSUNLOCKNODE(np); (void) nfscl_deleg(nmp->nm_mountp, op->nfso_own->nfsow_clp, - nfhp->nfh_fh, nfhp->nfh_len, cred, p, &dp); + nfhp->nfh_fh, nfhp->nfh_len, cred, p, dp); } } else { error = EIO; @@ -2511,7 +2511,7 @@ nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ if (dp != NULL) (void) nfscl_deleg(nmp->nm_mountp, owp->nfsow_clp, - (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, &dp); + (*nfhpp)->nfh_fh, (*nfhpp)->nfh_len, cred, p, dp); nfscl_ownerrelease(nmp, owp, error, newone, unlocked); if (error == NFSERR_GRACE || error == NFSERR_STALECLIENTID || error == NFSERR_STALEDONTRECOVER || error == NFSERR_DELAY || diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 0a1eb51e279f..8a82fe77690e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -432,9 +432,9 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldeleg *dp, */ int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, - int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) + int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg *dp) { - struct nfscldeleg *dp = *dpp, *tdp; + struct nfscldeleg *tdp; struct nfsmount *nmp; KASSERT(mp != NULL, ("nfscl_deleg: mp NULL")); @@ -457,7 +457,6 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, NFSUNLOCKCLSTATE(); return (NFSERR_BADSTATEID); } - *dpp = NULL; TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, nfsdl_list); LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp, nfsdl_hash); @@ -475,18 +474,15 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, (tdp->nfsdl_flags & NFSCLDL_READ) != 0) { TAILQ_REMOVE(&clp->nfsc_deleg, tdp, nfsdl_list); LIST_REMOVE(tdp, nfsdl_hash); - *dpp = NULL; TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, nfsdl_list); LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, fhlen), dp, nfsdl_hash); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; } else { - *dpp = NULL; tdp = dp; /* Return this one. */ } } else { - *dpp = tdp; tdp = NULL; } } @@ -1637,7 +1633,7 @@ nfscl_expireopen(struct nfsclclient *clp, struct nfsclopen *op, } if (dp != NULL) nfscl_deleg(nmp->nm_mountp, clp, op->nfso_fh, - op->nfso_fhlen, cred, p, &dp); + op->nfso_fhlen, cred, p, dp); } /* From nobody Fri Jan 17 21:10:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZXSs4jD4z5kDyC; Fri, 17 Jan 2025 21:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZXSs1XtZz47dM; Fri, 17 Jan 2025 21:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737148237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFKylcMHdmJM97fEfNpTGFq7Zz3v+tBtvZ1q17U0xiI=; b=DFp6HW/sdho+Bah5Mr1qPkeYH9Z3AmcVluopdPApmwT+Ygphsoen1OVbeafHTDe9EvhPVr oY8CvI6z3pxvGKeWPC4kpoJDyq7GQ7K/8nO0BVhjlzv2PZUOfwc7NVt3JR4AM1h4xZyZdR N/IPDd7z/3gRsVPDTO7C/jy9k20tTU49lVPew5nMcbbD0TC6FP2WncjuEHeDfMZ8AWV6lr 5k3v1HJss8bg2FgAFt2PNLXvdzBKPYSuGUs2cCxTH4SqS+yL6O2SrRT8p6BXcwL2Ug6CoB qVjCMP8rhrUgoCYspURqdJSf98FyIbRPnanp0iMvpiYIJSyrD91ktUosbMahuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737148237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFKylcMHdmJM97fEfNpTGFq7Zz3v+tBtvZ1q17U0xiI=; b=hJkFUsMmFVGU6bkgf65SIC4uNBcvMV//RpvDVe7oSc03qCgdJ42muGa8QheO+lSeooWR1R /9egTvAvVJaGbkYPPjYe1XM2FtefIUfrw729n68umNWXzoCm3n3ZW7AdOUUanuwR734LSM QNHlcMfKHrWguvD1tkDuNAWxgxBhWtcmMx023TvbIVKGmeQB3YcTHiEK0pWFGVxzrQ377f kABuS3fkDzRmpnWqsMHmf9U+qfYtauI9W5uamye56EEQyRlrknYHWyo8BjyZgqndongcd+ sN43LpDshWyP4NqS50W9SyAAI3+Yhzsp0Me1nhpPJBSVgYyopf1l7xo5R1JI9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737148237; a=rsa-sha256; cv=none; b=Q1AvHBxGaVwsDyHZ8Nj6N4HTqtJZgta62T3Q9Wr/9K1sDezlFpB8EXRBdIvhQNwQKBSJ0t +JU9onTho532ULMQWYcDaynRog/9JepTDnSbiMt1zzxwVmf1rnzIgjxrNcEMlXJ03rb/RT HKeRZ8wMVCowM1opdqdU2kLIGDR4MFvivd2eTmKO8ac4/mXFmLW7MGREoXdtjmxGtpHolL nmcwo6v1sF5q6/RBA2mhfTYmtiM8U1gQ63oGG67w9ScYbzqkkAGgvatGf6fE5Rva7gZ5X2 06DP6SA5PpEIrkUEwqD11I5r6Eolk0giI0ZMqdOSkzAqRSat/cjuWyIsxU0jFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZXSs10CGzb6Z; Fri, 17 Jan 2025 21:10: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 50HLAb7b004394; Fri, 17 Jan 2025 21:10:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HLAbia004391; Fri, 17 Jan 2025 21:10:37 GMT (envelope-from git) Date: Fri, 17 Jan 2025 21:10:37 GMT Message-Id: <202501172110.50HLAbia004391@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: a8b49e7c6629 - main - cam: Add 3e/3 as a fatal code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8b49e7c66292852339481536f039719e7914200 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a8b49e7c66292852339481536f039719e7914200 commit a8b49e7c66292852339481536f039719e7914200 Author: Warner Losh AuthorDate: 2025-01-17 21:06:32 +0000 Commit: Warner Losh CommitDate: 2025-01-17 21:07:40 +0000 cam: Add 3e/3 as a fatal code We see this error: (da4:mps0:0:3:0): SCSI sense: HARDWARE FAILURE asc:3e,3 (Logical unit failed self-test) for drives that have failed. Our vendor tells us there's no recovery from that state, though we can still grab logs from the drives and run their diagnostics. Drives in this state need to bascially be remanufactured because some part of them has failed. The prior default behavior is to retry, and retrying takes a long time to work out. Instead, short-circuit the retries and fail right away. I selected ENXIO because no I/O to LBAs is possible for drives in this state (both my experience and per vendor). Some googling suggests that other vendors behave identically, but it was inconclusive. Should this be too pessimistic, we can adjust in the future. Also, this is with some aging drives in our fleet, and if we have more than one drive in this state, our systems take so long to get to mountroot that the watchdog fires sometimes. Adding this patch makes them boot reliably again. MFC After: 1 week Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D48505 --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index a26354e3dd97..0f31757cae25 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -2308,7 +2308,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x3E, 0x02, SS_RDEF, "Timeout on logical unit") }, /* DTLPWROMAEBKVF */ - { SST(0x3E, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x3E, 0x03, SS_FATAL | ENXIO, "Logical unit failed self-test") }, /* DTLPWROMAEBKVF */ { SST(0x3E, 0x04, SS_RDEF, /* XXX TBD */ From nobody Fri Jan 17 21:42:26 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZY9Z3WJdz5kGrD; Fri, 17 Jan 2025 21:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZY9Z2WCLz4F20; Fri, 17 Jan 2025 21:42:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737150146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YOB6qdoqH7au9s9IRbJlqvhdRzycpO0593kHzOfiraA=; b=dKdplNtv0/rtorysVomr0PAgMdHZs2GC7v7N2nfAn4eAmhHwQLfJed1PuGICbkzGnoa9W6 rOol5Z0bUFY3qaGagkBWVxZziPy8Ixq9aJpanWQnZ+CaGWWc1+2Pb7zdef9s4sRlhTacrW 1/b5hPyMwx3SDPfEcfxpK2/t/6bJTKHQoLxHFT0SNhF7Lh3g/99hKzoBpKpLW5WcGjMA0t UHtodxnwqn0ocu3EltACLf6X7UZbYtkT2W5bIQDBoZ6jmeGQdbVd3hbYf4mlr5TDUQy9Gu wejdSYEyKMuXaPc3cw8spqXItSoZRH65RltASxTdWHurguBbUeNBnzKFMVSoQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737150146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YOB6qdoqH7au9s9IRbJlqvhdRzycpO0593kHzOfiraA=; b=IjGexh13Lhh/+w2fEvpSEIsskSVe2AMQlwUgDdHEnBMTv2mU/6YOAlO36gl57xYp2ycA4t ZiCST+CWR+0NVOHbpArR01crs2PY7LzHLOsuDpFEVWI4edIC3mxfkSb8G190Gx6pdMasnj w9WmmqcN8dd7staYCnOalk90Hdc7CMP2HtKmFfJCGjV/A8w4pF/mOw6O0U04Ys1qu8lxZw 3kYHme2vEeWSuIKzgk1Qu8QGrugB/W0WeXO2vCQYUW+DYC8+UqbyXcZ9tWdZsW9exvr2hv d7snDGlQteU/Lryh/yHp4MHK71IjwMXcM8/ID1umEQNJ29+phiuODvNejVxkDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737150146; a=rsa-sha256; cv=none; b=Vz3Kum4iXRsbNRC05siDJieOSK72IptuiGutGnbVZtPzKBW/xHKibIs1wzvrPrKyuyasEV WMtC7/bshgW55UXFby84GFhIPBBxLyRmM1gYZQrAWZ/QpF1n1oqwXxs0sFgr1EzD101UXN f4t88Rl6QYYRaQA97fr78bYjvY0JpkstGJbrh0NKbdZkZZD2O09VMC5uq4tsNBYqIZLESu gpWRnIFD8jh6Xy9UgwJdb0VwcuR9WzTT3PyE2ebJp8lo0xskerGyEqYpPWFzEwStqE9gUl Rr2oE43dVUT7GGfBLt1KTJ4PncdVFOsPEmSX0iK5AzrXLtrztQ7+rqS+OZ02+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZY9Z1sl6zcQK; Fri, 17 Jan 2025 21:42: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 50HLgQIA061072; Fri, 17 Jan 2025 21:42:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HLgQ4Y061069; Fri, 17 Jan 2025 21:42:26 GMT (envelope-from git) Date: Fri, 17 Jan 2025 21:42:26 GMT Message-Id: <202501172142.50HLgQ4Y061069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 4d15b58365ea - main - certctl: Set METALOG ownership to root:wheel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d15b58365ea706129bedfdb37e0c5e8661a640f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4d15b58365ea706129bedfdb37e0c5e8661a640f commit 4d15b58365ea706129bedfdb37e0c5e8661a640f Author: Pat Maddox AuthorDate: 2024-12-15 09:20:24 +0000 Commit: Ed Maste CommitDate: 2025-01-17 21:41:02 +0000 certctl: Set METALOG ownership to root:wheel This sets the correct ownership values when building base.txz This is an updated version of commit 10fa3f2518d4, omitting the `-N ${DESTDIR}${DISTBASE}/etc` from the original commit. install(1) does not validate the arguments passed to -o or -g (see PR283355) so there's no need to have the passwd db available for now. Future work includes plumbing the appropriate passwd db path through certctl, and validating uid and gid in install(1). PR: 283340 Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D48506 --- usr.sbin/certctl/certctl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/certctl/certctl.sh b/usr.sbin/certctl/certctl.sh index 864302ab1160..458f5c53682f 100755 --- a/usr.sbin/certctl/certctl.sh +++ b/usr.sbin/certctl/certctl.sh @@ -334,7 +334,7 @@ fi : ${METALOG:=${DESTDIR}/METALOG} INSTALLFLAGS= if "$UNPRIV" ; then - INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR}" + INSTALLFLAGS="-U -M ${METALOG} -D ${DESTDIR} -o root -g wheel" fi : ${LOCALBASE:=$(sysctl -n user.localbase)} : ${TRUSTPATH:=${DESTDIR}${DISTBASE}/usr/share/certs/trusted:${DESTDIR}${LOCALBASE}/share/certs:${DESTDIR}${LOCALBASE}/etc/ssl/certs} From nobody Fri Jan 17 21:43:35 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZYBw2sgdz5kH9G; Fri, 17 Jan 2025 21:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZYBw0mY0z4FrD; Fri, 17 Jan 2025 21:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737150216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmUkgx2KS8ooFa1ShXY2HT3STDeDhgI/nrbMmqLxK+4=; b=jpr5RIqhhvnH+7v+B/mm/yURuTdsxwbMVVqiQcYtYRXXeGGz3C/ophk1YtoE0XmG0ojIuI WX0oyAsD50PJOBcCmMz9Pwii7XpNfPnpydFQ2sAS/Dt4KzkLQ/pDJBHR0nvH2yeNiqMxxv ddbJ6P5sazJHdBiF04tooxe6JRNhoM2aLihc5KkPRnF54CbzWMOdmfaM45gcqTk7wD8zuY x/X/k+FKvbBrItPDmXvS1zeyybNt/eYzuSbvukBj9T4txRY+CZnmjqJyFVA1PYbnix8bdA SVtU//9i1N3s4sLVs+Rz8u0R9UOIa97DTOyleoyCxSk4wm0Da4ofhmMEB9wr6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737150216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TmUkgx2KS8ooFa1ShXY2HT3STDeDhgI/nrbMmqLxK+4=; b=q+PZ7AIxOTyf5nW9KL3kpqXtn8PuuxCugJOnvhdqOAfS/sq1olHOASE4r/UkJS65rs46hR 64PCtrM+DRj/aTPjBoij42QGhBqKePEp5fIylVWDBCdFSGu2qcwcRpWMY3CaL29e5qQ2WS ZvXj+Vd5sQpcC4x8ypKup18bPzF34A69m/0cIWGQJc8NZh69K5EgcwtpQSol2Lcopc2ZZs 6rLUJgEjWrakL3amRV+nxIbIBz+3ZU0a/5GE/cZmYBu2DSWG7PGyMboGsqGYFrAhinb5gJ oB8M9rbwAFGLzDtD3FWMUrlDRxp5Xbqz+hywgRN7Eqk2StRJkjUBeHLrHWn/xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737150216; a=rsa-sha256; cv=none; b=Fqsq3hwx4OOWh2EDsq83Xe+021TxKgCsOeGONMH7Vr4iaiMKDUEtmafGCb9IrOWMEqzTbs VrWjJ459l3xmPksPd6eORydOAgbKt/O9axWutvksswXfficjvdzQTlryvXEBX184XODf8p 4aCr00ZTAv7sHbopqdEwveJCXeVPq/LNL86zewcDplM5ozztlkA1OUjT0TYMvW67IQ9YZi C4g1pFBkrQA7kg6JQHP+bHh/GxgiQ+Uh0vze5v8VwYqvm/TPUXYdwbJKi8DBAniTBhb4qy 0/2nqea3e6YhahsRAygQUT2J/G6I6nAeWTIxuReOVVD8NkbJNPAq0CcXnI27Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZYBw0HDRzcTR; Fri, 17 Jan 2025 21:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50HLhZAf061310; Fri, 17 Jan 2025 21:43:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50HLhZNx061307; Fri, 17 Jan 2025 21:43:35 GMT (envelope-from git) Date: Fri, 17 Jan 2025 21:43:35 GMT Message-Id: <202501172143.50HLhZNx061307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f26fe2c6669d - main - ctld: correctly parse LUN size on 32-bit arches List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f26fe2c6669d56621ac85f5279aa85503cbf59bc Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f26fe2c6669d56621ac85f5279aa85503cbf59bc commit f26fe2c6669d56621ac85f5279aa85503cbf59bc Author: Alan Somers AuthorDate: 2025-01-17 17:36:08 +0000 Commit: Alan Somers CommitDate: 2025-01-17 21:43:09 +0000 ctld: correctly parse LUN size on 32-bit arches Disk offset values must always be 64-bit, not size_t. PR: 214874 Submitted by: pprocacci@gmail.com MFC after: 2 weeks Event: January 2025 Bug-busting session --- usr.sbin/ctld/ctld.c | 2 +- usr.sbin/ctld/ctld.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 346d1908aa6f..497e0f6e7600 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1568,7 +1568,7 @@ lun_set_serial(struct lun *lun, const char *value) } void -lun_set_size(struct lun *lun, size_t value) +lun_set_size(struct lun *lun, int64_t value) { lun->l_size = value; diff --git a/usr.sbin/ctld/ctld.h b/usr.sbin/ctld/ctld.h index e1bab1a8e3b8..3f4b653d6896 100644 --- a/usr.sbin/ctld/ctld.h +++ b/usr.sbin/ctld/ctld.h @@ -349,7 +349,7 @@ void lun_set_device_id(struct lun *lun, const char *value); void lun_set_path(struct lun *lun, const char *value); void lun_set_scsiname(struct lun *lun, const char *value); void lun_set_serial(struct lun *lun, const char *value); -void lun_set_size(struct lun *lun, size_t value); +void lun_set_size(struct lun *lun, int64_t value); void lun_set_ctl_lun(struct lun *lun, uint32_t value); struct option *option_new(struct options *os, From nobody Sat Jan 18 06:08:16 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZmPF0ccXz5kt0k; Sat, 18 Jan 2025 06:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZmPF035Rz3xrF; Sat, 18 Jan 2025 06:08:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737180497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vVanuR/Wngb5NAXYFkDu4UmSz4jq/0lzSdyHn0CY4X0=; b=NStsicyMkUxrbcIXJbvufWW8Um99gs60YQ7YoenTuD9y74JQFkIPUpqoer/REDxo8zI3DH 0TgrKUZS4raP3DGo7+MPJshBmO9+93PMpfP0Oj4jNtsJJ+V2LpNo6M0e1YKJiWTecMOuZh Oh3NciAkDq0Kh6aps5mfaP2CkPJAv8TsculCqsmE0MwKGhTRYc8SwF+ffWNglniJMs3qpk OcmkCBb6iRODXa1pVIdATQnkRMyZqDAwvNRDgZMPZgsS6CHeKOaPF5ut+yiEmIbIEXJYYw 2XzfQJG3zcjMyw3Qmyp1v1tyjkNhMdnaFZ1IusSlwis5+G07riJ8SLiqstXWnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737180497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vVanuR/Wngb5NAXYFkDu4UmSz4jq/0lzSdyHn0CY4X0=; b=OXuJKuJK7lt+A7qNEM6WGxTnIhdCIoPlD+S0pejufrWIGEOTkdPEKIZWYriaDSNX4faDEF q3eAIu//yKqSfo8GkMR/kwZrTYx48UwyP8MsrlT4uVwqEOJRMBjLNgUo5Z1gvKa+WJvT3J HKUtZ3Cfk1Z+CAAIr0Mgr59M2j0A8GbddJWKM4cBFxIIrAp0CxkOs+zbYiFibvvwtCvl8Y ls/b3kpvJuk8P1Ma+xhTtpjw4YnPYcO3/FbF8+N1JPZ811J3HOPiRkivSCf5yK8xxGoR3V ZRVAtgFenjIfUXpqrCX9nCnS8VBS7zOTmjqwQ8QDoPkvO6idf5Yoyjhi+qTdcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737180497; a=rsa-sha256; cv=none; b=n4r1UE+mYQCqTMPjlsUJ+vMys5hqgL+BGCTvqZHa4AsJZc19Z4BZHOfLK21bw0wrde20PZ tOZgKajKMpHRgJOO0dOyaaIbNq0cJVAH0KgaTRel1k+K5DMrLksDEm6ZZuLodNC5xqELDG 1hqIIUaYplnaLGvdmsi7hjDtkRjxEJ5hEJH6AmBz53I8GajGDRVrYhRtp1t2zAZVXb9OVv bPsqvCwse08fEXXUijgxIQzp8YniqUzaeV8N9/TLR3Lv2wrfIZ2/2HUv/nwkYGYvr+TIQ2 8aQwspRheXRwZy8P878kQAJzYkPQWep55Fflee4pBkMdfkXTXWeppdzGvJT5uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZmPD6hL8zsTj; Sat, 18 Jan 2025 06:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50I68GTv071425; Sat, 18 Jan 2025 06:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50I68Gfa071422; Sat, 18 Jan 2025 06:08:16 GMT (envelope-from git) Date: Sat, 18 Jan 2025 06:08:16 GMT Message-Id: <202501180608.50I68Gfa071422@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: 6a876e97f702 - main - krpc/clnt_vc: clear vnet context before kthread_exit() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a876e97f702c277ea41ad9c90709a4b079c74a3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6a876e97f702c277ea41ad9c90709a4b079c74a3 commit 6a876e97f702c277ea41ad9c90709a4b079c74a3 Author: Gleb Smirnoff AuthorDate: 2025-01-18 05:59:15 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-18 06:06:42 +0000 krpc/clnt_vc: clear vnet context before kthread_exit() Fixes: b2ff4cb1931c2e1509a5741f6743322699ad1e00 --- sys/rpc/clnt_vc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index d26e6c294af6..2e890f3b482b 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -1300,6 +1300,6 @@ clnt_vc_dotlsupcall(void *data) wakeup(&ct->ct_sslrefno); mtx_unlock(&ct->ct_lock); CLNT_RELEASE(cl); - kthread_exit(); CURVNET_RESTORE(); + kthread_exit(); } From nobody Sat Jan 18 06:08:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YZmPG1TRDz5ksjN; Sat, 18 Jan 2025 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YZmPG0ljqz3xsx; Sat, 18 Jan 2025 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737180498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0paNKTvlMEBd5naWJpQgDAc39PfU34S4b6FdNg7Vjvk=; b=Vkp/+wuiWOSoeUlpJIJyzM2dz32VmZSghxuhLSSGUIewa5NtFewbLhh/uQV0nmGf8HtiZR Q5ccYxcWslconAiPmqTJq41kg6G5sZ1twgFeh4Z3+AGt7fw2my0dOturpUbLapMmH26S10 6WmWnAAtO6yv3FKRDw6+MoFwdRs5qK59pPoZEpZSuoMovtuZkLxqlOdFmNML6xn6ShE57t PzUGxHV1Mk4QlTSf5+0DvK1aBLwaSlSWiYEsLtpTTwHGJYVCDNZC4OIubPRvGJQHZVq2X7 bmp5gcjgX/4g0YAyrKWXteoWo3B3EL6yyLxmOzEWNAOclXHVHPkCYSDvu6QkcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737180498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0paNKTvlMEBd5naWJpQgDAc39PfU34S4b6FdNg7Vjvk=; b=DsJuy5swhV5Luj+Z8bmanQYpK6GhtpFICbj5Tf2yKz24Rrx8l/NUUl3pXujjXg8rKKmxgg eaRnCRDG0sKKly42lrMBP9dESi0f+KqzG2Gxw4vzBJZPp4zQIRoP4htOt2KesKpBSiOhyO LoeZ69R9ojhGb9yjUgkawpJzV3joSU4wcxoXBmGii4JmMnlowM+iEDhBEsMKsJdOsTnuKp ZFjOHVD7jip5hqn/jj6tp2Bjn7hw0SUubepTEhk5onKL3MDLuW+bfn+RUlxJ3RW0YKvXgj ctYFcbv70HAkSo11+u9tRVk6BIRBrA16VyV+x+AjutCXHlMSFKHlvS21Qqcujw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737180498; a=rsa-sha256; cv=none; b=U4Aaw0K7HoJKk42BUzusb0jRZBe3LNF1VVdOyBtkGIZCAnsT2wkalXTYpD4Jix1fo+Mzo/ Iw0qfrygf3q3ubmWYfYP+JT5P7iS6F/Ii3wWKi7Vy6ViGWzRoS4gp/tJsy+z7WKDjRmQg3 0S28wEBDuRQ07h9UjOeT9FU55NNHIMrZZs5P3iv93oxsT7E69CaUQ05eIwUxSqvgSfQZKc JP01x+hmfROXyCxNP+Bshaw86Md3pt7C6/0IQGiZGB/7yMp0bZCB1XVuyOPmtRJjC/QpCY Fe5/oQkL56cSFztPiWYUxzqMcuG8GAQipnXLzexkqCX5jfzFRwNvWz8ec4Sxjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YZmPG0HgGzsB3; Sat, 18 Jan 2025 06:08:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50I68HtF071481; Sat, 18 Jan 2025 06:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50I68Hk6071478; Sat, 18 Jan 2025 06:08:17 GMT (envelope-from git) Date: Sat, 18 Jan 2025 06:08:17 GMT Message-Id: <202501180608.50I68Hk6071478@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: 488660360a71 - main - krpc/svc_vc: keep the vnet context during calls into rpctls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 488660360a71f65a31d3709559554c1a90f7220e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=488660360a71f65a31d3709559554c1a90f7220e commit 488660360a71f65a31d3709559554c1a90f7220e Author: Gleb Smirnoff AuthorDate: 2025-01-18 06:01:46 +0000 Commit: Gleb Smirnoff CommitDate: 2025-01-18 06:07:45 +0000 krpc/svc_vc: keep the vnet context during calls into rpctls --- sys/rpc/svc_vc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 9fc4108a5149..f70aabc5425d 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -493,6 +493,7 @@ svc_vc_destroy_common(SVCXPRT *xprt) if (xprt->xp_socket) { if ((xprt->xp_tls & (RPCTLS_FLAGS_HANDSHAKE | RPCTLS_FLAGS_HANDSHFAIL)) != 0) { + CURVNET_SET(xprt->xp_socket->so_vnet); if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0) { /* * If the upcall fails, the socket has @@ -505,7 +506,6 @@ svc_vc_destroy_common(SVCXPRT *xprt) xprt->xp_sslproc, &reterr); } /* Must sorele() to get rid of reference. */ - CURVNET_SET(xprt->xp_socket->so_vnet); sorele(xprt->xp_socket); CURVNET_RESTORE(); } else @@ -853,13 +853,13 @@ tryagain: if ((xprt->xp_tls & RPCTLS_FLAGS_HANDSHAKE) != 0 && error == ENXIO) { KRPC_VNET(svc_vc_tls_alerts)++; - KRPC_CURVNET_RESTORE(); /* Disable reception. */ xprt->xp_dontrcv = TRUE; sx_xunlock(&xprt->xp_lock); ret = rpctls_srv_handlerecord(xprt->xp_sslsec, xprt->xp_sslusec, xprt->xp_sslrefno, xprt->xp_sslproc, &reterr); + KRPC_CURVNET_RESTORE(); sx_xlock(&xprt->xp_lock); xprt->xp_dontrcv = FALSE; if (ret != RPC_SUCCESS || reterr != RPCTLSERR_OK) { From nobody Sat Jan 18 20:06:01 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yb6zt26YBz5kpFl for ; Sat, 18 Jan 2025 20:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yb6zt1H6Rz48xH; Sat, 18 Jan 2025 20:06:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737230762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dztmD0ahxQYbiKmYipdgHRbbJj2LO404keyBhG2/gCY=; b=GkqoyTh4nPRxW+roGJBQkAJwofkA8LkqCiYiyrRjQzGFzUMLhFf3FeoAtBMyUmTKwIH2ZF 3tIsZhCPhx5brOpsD5DeiVJiVIPPAqhDdynO9wjkgn7fTuKmpfK3cWAlyT4j4IFh1ve/7v EybAWRJmBm+riyFaE8z5ebrO1pBa92M/BkSEWQTLvAmkZZnxE9Zs/D86f6PUre94kw54CH bm7dGTlsDfZP5bOM/f0aJk0HCLxDXPYisMAF2jdy0vm1BJYEfYHDJgOr5gairaFMuCLU8R KXpdFEtzszxBtQExDZQZ41R1WQ1gdqd6yVyaIp44tfP9DU1G+ixcSeT9V6dowQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737230762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dztmD0ahxQYbiKmYipdgHRbbJj2LO404keyBhG2/gCY=; b=acEqqJyYq6ZmYvtA6PsOm/jcTA3aSNiQ4PLxcZ90O4qipPNtCNeXRoWkcCOY9reWz/fJWs Qh29KoB7DOJKpxF13nkAl9Ml8AP9WOHDAOZwAC/dg+ZY7DghmR08bPXnWzLM64MyLOfQxP Dpcga/BGU6Gd5d6xd1pyscR5Nv03K1rqvQe1kic3+dGa6QFUjyBw6WTR1B6ZcSkicDl6vM Nl9QETT83WFWgESiyVGMeY8RTMhdL1qGZcyqWwf3DeG7dDy+ZB8hJVqhEwII23EqviWbpc y5GTcbjuK8K1sRGeSPgzNL0sRWgjvTtLOk9UWNZI3MWFTt/CqYoQpJfpkRT6EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737230762; a=rsa-sha256; cv=none; b=iaFZDd3cJ7RhktDO/fBWyOG1lFiMCWkfVhHeDJ6Ak0T0SMLq4yiyyXPgsiJMkaXwEWGWox Fuw/qhvEURx1VS9FT6pwxgmxijdOhUjBj9pHlzTb3m/Ul+g7DBW31400x2mzpDaWYk6XGH hNh8Rd9rfbx3w77qLi4BGfnDzycqnQxzsGBFKlGeTdA2717h95BLhr/x8Rwx8NKTZC1kUX vMbmwCEM7+UKWAo9CDHGnrpTxDQcSH5q2nQYu8yZ1KhoPubS5ayncxVOlWFlObMkNo2RwE CgORwblJ8hp0BgrS6npIdpxrvOnX071MeiHOU1Q/9su56UkZRUp4cAqpceoxPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yb6zt0VnGz3sR; Sat, 18 Jan 2025 20:06: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 50IK61da043218; Sat, 18 Jan 2025 20:06:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50IK615d043215; Sat, 18 Jan 2025 20:06:01 GMT (envelope-from git) Date: Sat, 18 Jan 2025 20:06:01 GMT Message-Id: <202501182006.50IK615d043215@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Warner Losh Subject: git: c7d07369b216 - internal/admin - admin: Reactivate shurd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/internal/admin X-Git-Reftype: branch X-Git-Commit: c7d07369b2168f67ac288c533f2a8ee78fe1e873 Auto-Submitted: auto-generated The branch internal/admin has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c7d07369b2168f67ac288c533f2a8ee78fe1e873 commit c7d07369b2168f67ac288c533f2a8ee78fe1e873 Author: Warner Losh AuthorDate: 2025-01-18 20:03:56 +0000 Commit: Warner Losh CommitDate: 2025-01-18 20:03:56 +0000 admin: Reactivate shurd Stephen Hurd will be doing a bunch of work around c23 compliance and similar areas. Turn is commit bit back on. Approved-by: srcmgr --- access | 1 + 1 file changed, 1 insertion(+) diff --git a/access b/access index f1e21c180250..0b6357c6aaa9 100644 --- a/access +++ b/access @@ -145,6 +145,7 @@ rscheff schweikh se sef +shurd sjg sobomax ssaxena From nobody Sat Jan 18 20:18:13 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yb7Fx612dz5kppK; Sat, 18 Jan 2025 20:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yb7Fx5DZXz4B6L; Sat, 18 Jan 2025 20:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737231493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P2APUkkR5mKdOnGuXv6hD2EclcEZUQD29aUnpkDh8+0=; b=uN+vxeC0cIntR1CSB/Sf45HP+8ldo8QbKov1jUmnFh4jAZO+ssl+oFQObM+uMZMW/BjrF7 VtiRh0s2nFXycWzccvGAI80uMxUyXe1MS8WhLfFlNYEcdCge8spdVNszuXRHMmlpuS8cdR EjeCmgCZIKmXivpabF1VL+e5DtKz+/JsiWMDdYNYwu6HConz+V/GQZJ7gvtLp/bQnfmF6N NKKa5KvNdFqSwm9pcemLHuQhC/OGZkpX0V4T//fXaQ/5ERpeG3r6G0cDw/Q4pUTCwH/oxk BMhsh79SbOJGFV5XCSL8q+Rd0lxpgu3/2cZ70aX7OHLqY1VpdPgYSpGrLogF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737231493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P2APUkkR5mKdOnGuXv6hD2EclcEZUQD29aUnpkDh8+0=; b=RCfEztLHlkayTfX8Tsp3v127Aalp4sYrEELQUPVS+h+avLMZuVddopWCOmYSIbWNreuDl6 Q2mGYL3WHWGyUsvWtCJ25kap2jFp0VzuGNHPja5KCRROPUKLo8bOjuQ2d7h/2Csh9pvLjJ t3frI77L8iShfsR2ot1mtyVcXzOh5NiupJvpe5NMUl5zPMh9SVHf9OjYIcl1gSOrEm5wGl 5+wtYi6kHf+tnE1PSKdmD7q6+w8gFDw6brzBRLw9kjWtVpv3rxBefTGdOLsBS++5Ipy/WX a/8bhP09SSCXUfsY4T6vJetEsvN4SWGOLskAiQAWYIfKJpbVbitfMsGOt7W34A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737231493; a=rsa-sha256; cv=none; b=VSpy3IBdRhL8PIpmOeYM9NLOZPdU3MPm4R1JCH5zW98ZdEE6SyDiis5EaEXVRb+fBURf6e g6eH9kLPmEFzOkRtsHXTKtKy3NDHirRe+xTbv5KjwdkO2Rza8UkzGSss0owWUIsbJBeYOZ Z5A6VcFpYWkJMyVDmWHYJV8JcB7PmNg++IHXsYi1mo+qWmGGKmmmtntSeu4H3bPgdIisWN n17a9kOo85rr4vVaPz3FHS5K2Om1IR46hVbyaBWHCSeG9eALQxjMfSc/lUVnU2mpdCiP0r FnWFeSVVA3AFx02osb4i3pg13goeUhjsp72SGQyhQJGSBkzS0ZXi/FRbvQCwOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yb7Fx4q3cz3st; Sat, 18 Jan 2025 20:18: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 50IKIDFU063463; Sat, 18 Jan 2025 20:18:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50IKIDxt063460; Sat, 18 Jan 2025 20:18:13 GMT (envelope-from git) Date: Sat, 18 Jan 2025 20:18:13 GMT Message-Id: <202501182018.50IKIDxt063460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stephen Hurd Subject: git: bc14b1ebce0e - stable/14 - Expose POSIX functions incorporated into C23 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: shurd X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc14b1ebce0eac01d70d126eae48ae50c1b6112d Auto-Submitted: auto-generated The branch stable/14 has been updated by shurd: URL: https://cgit.FreeBSD.org/src/commit/?id=bc14b1ebce0eac01d70d126eae48ae50c1b6112d commit bc14b1ebce0eac01d70d126eae48ae50c1b6112d Author: Stephen Hurd AuthorDate: 2025-01-18 20:17:48 +0000 Commit: Stephen Hurd CommitDate: 2025-01-18 20:17:48 +0000 Expose POSIX functions incorporated into C23 C23 has incoporated a small number of POSIX functions, so these should be exposed for C23, regardless of POSIX. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D47856 (cherry picked from commit 59677aecb67bbedcfa2ee5d7d2b189193cdc4af7) --- include/string.h | 8 +++++--- include/time.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/string.h b/include/string.h index 7b0cb9f56524..a362dc9e0f3f 100644 --- a/include/string.h +++ b/include/string.h @@ -52,7 +52,7 @@ typedef __size_t size_t; #endif __BEGIN_DECLS -#if __XSI_VISIBLE >= 600 +#if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 2023 void *memccpy(void * __restrict, const void * __restrict, int, size_t); #endif void *memchr(const void *, int, size_t) __pure; @@ -86,7 +86,7 @@ int strcmp(const char *, const char *) __pure; int strcoll(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char *, const char *) __pure; -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE || __ISO_C_VISIBLE >= 2023 char *strdup(const char *) __malloc_like; #endif char *strerror(int); @@ -110,8 +110,10 @@ void strmode(mode_t, char *); char *strncat(char * __restrict, const char * __restrict, size_t); int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); -#if __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 || __ISO_C_VISIBLE >= 2023 char *strndup(const char *, size_t) __malloc_like; +#endif +#if __POSIX_VISIBLE >= 200809 size_t strnlen(const char *, size_t) __pure; #endif #if __BSD_VISIBLE diff --git a/include/time.h b/include/time.h index ff858cc1f420..cac9c76e3f79 100644 --- a/include/time.h +++ b/include/time.h @@ -157,6 +157,8 @@ int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); #if __POSIX_VISIBLE >= 199506 char *asctime_r(const struct tm *, char *); char *ctime_r(const time_t *, char *); +#endif +#if __POSIX_VISIBLE >= 199506 || __ISO_C_VISIBLE >= 2023 struct tm *gmtime_r(const time_t *, struct tm *); struct tm *localtime_r(const time_t *, struct tm *); #endif From nobody Sat Jan 18 20:20:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yb7J716ylz5kq4Y; Sat, 18 Jan 2025 20:20:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yb7J66Q1rz3Cqb; Sat, 18 Jan 2025 20:20:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737231606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFHCX4OOwpXahFive61W9Mq6gsvD/08YVOgGYE3WV4w=; b=csMzIvmnG81y7QdeUMWaUChcnd0nB1sCJh8Y9wHUPTyG+/6kRXIQVJBxOd43T170sWXM2I TnAPxzyBKwYQ4nmBFB2OeOk++1+OrxoUXb3DQeppNfvqSk9rNEH8YrMnaDdhw8x22bnM02 xVFGkYD9u+L3I68QIoJaQaHwTpNUi6HHnEbPHTAx295O7TALEeNwpOjNc8ge7x0pg8Atyo V5Jr3Lw0SPxBPODVTYcCIyfk4P47PhyD2jti3twn2lWOdoZ1DT0dLJzD4O9EsMAfW2q9Vl O+XBCdlczgqADSUJqIOqdzFSCbBt0vFY6haBQPnGtCkDnp5XPg9Zd408v0yXvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737231606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TFHCX4OOwpXahFive61W9Mq6gsvD/08YVOgGYE3WV4w=; b=FWNE1GTW8ZBZ7cmOfiVCjk0Cg0PYopAO9uFnbhJxBPkL2a3EYPtiumngIjsY0HI/0Uxl9C bhVLqIRL4rhGJLaiK6jcjZkzaieUt8clJD1TGxvVfGusGRCEd2T/gqt1UlrQ2OZMeoZgkK vtY6IQRIxb2Ayz5gvpjsnlY0OlsWcWgizqKE711RduSZIhovd+87ZPK5iY6W5vFuaekHxG 6+huQ7eaxc2aSilTF8iNASs7SeUYx4K8Yg6uMtOvvg9EC24NOMLWPPUi9+Hx7qAwSfhLJC LKQMRbKqrGGG8i0E+AW3Q85XH5fBnxqCi51uiSRmQ9fYq1iggvXNV4H9rQW7yw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737231606; a=rsa-sha256; cv=none; b=id7zb1A9vkFpD2KWtK3l2QsztUCiFKoeHScRGWx7KWK++PB3GtLfJicsxVKWQs0TQOvhxt VTnpzd2r4DEehGxoKPNLLZuKOpA5jQlF5VYaf5FuxvdgVv5B0teBV/qEvaJyW4dkcESzku r4AklHuZo6Qc48dgYHdC4FR/ek6lm23MLAu0z/avU+x8+n/wB4i8Y1mOnqH9qSXqH7961c TneeBD1gGgNQ4nWcfFvVFL47ArJnAM72NGvG1HyrblSoVT0LQ42da+3Ds33C2un0+eVAik MsEUulfx9LD/Nd2RBF6pwYLdp7yXPu77DpZ1fERK2hEbN8+Gr7L4sk+2/74wIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yb7J65mBHz3bG; Sat, 18 Jan 2025 20:20: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 50IKK6Bx067159; Sat, 18 Jan 2025 20:20:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50IKK6er067156; Sat, 18 Jan 2025 20:20:06 GMT (envelope-from git) Date: Sat, 18 Jan 2025 20:20:06 GMT Message-Id: <202501182020.50IKK6er067156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stephen Hurd Subject: git: 9e659ecfb231 - stable/13 - Expose POSIX functions incorporated into C23 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: shurd X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e659ecfb231819c5426c992885367032a8c4e94 Auto-Submitted: auto-generated The branch stable/13 has been updated by shurd: URL: https://cgit.FreeBSD.org/src/commit/?id=9e659ecfb231819c5426c992885367032a8c4e94 commit 9e659ecfb231819c5426c992885367032a8c4e94 Author: Stephen Hurd AuthorDate: 2024-12-01 17:34:40 +0000 Commit: Stephen Hurd CommitDate: 2025-01-18 20:19:16 +0000 Expose POSIX functions incorporated into C23 C23 has incoporated a small number of POSIX functions, so these should be exposed for C23, regardless of POSIX. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D47856 (cherry picked from commit 59677aecb67bbedcfa2ee5d7d2b189193cdc4af7) --- include/string.h | 8 +++++--- include/time.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/string.h b/include/string.h index ccc820d8b4b6..1d42b54e43ec 100644 --- a/include/string.h +++ b/include/string.h @@ -52,7 +52,7 @@ typedef __size_t size_t; #endif __BEGIN_DECLS -#if __XSI_VISIBLE >= 600 +#if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 2023 void *memccpy(void * __restrict, const void * __restrict, int, size_t); #endif void *memchr(const void *, int, size_t) __pure; @@ -86,7 +86,7 @@ int strcmp(const char *, const char *) __pure; int strcoll(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char *, const char *) __pure; -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE || __ISO_C_VISIBLE >= 2023 char *strdup(const char *) __malloc_like; #endif char *strerror(int); @@ -104,8 +104,10 @@ void strmode(int, char *); char *strncat(char * __restrict, const char * __restrict, size_t); int strncmp(const char *, const char *, size_t) __pure; char *strncpy(char * __restrict, const char * __restrict, size_t); -#if __POSIX_VISIBLE >= 200809 +#if __POSIX_VISIBLE >= 200809 || __ISO_C_VISIBLE >= 2023 char *strndup(const char *, size_t) __malloc_like; +#endif +#if __POSIX_VISIBLE >= 200809 size_t strnlen(const char *, size_t) __pure; #endif #if __BSD_VISIBLE diff --git a/include/time.h b/include/time.h index 45d3a253ed61..e99872ef6a3d 100644 --- a/include/time.h +++ b/include/time.h @@ -157,6 +157,8 @@ int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); #if __POSIX_VISIBLE >= 199506 char *asctime_r(const struct tm *, char *); char *ctime_r(const time_t *, char *); +#endif +#if __POSIX_VISIBLE >= 199506 || __ISO_C_VISIBLE >= 2023 struct tm *gmtime_r(const time_t *, struct tm *); struct tm *localtime_r(const time_t *, struct tm *); #endif From nobody Sat Jan 18 23:58:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbD8G3HfBz5l3nX; Sat, 18 Jan 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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbD8G1VgYz3XhC; Sat, 18 Jan 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=1737244718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yNAuNIH15ySxmsWvzXcqWE573KMqvMVEM2jHIXgzXf8=; b=lpAdCCQ1Vs2AvW2SuQowwKSOpcABdy9eu4Oe6omQGPHjWubM1T0qMvTUmlviNjTmwE9zYh sLoLHwvS7ueZzYyA+OL2GOyZ6OuPCJwndUsslJiedvGuedWImPkAZr9l4QkjRTwA5wGrju BSLSnaGfkEF/lFcXrVZqeEizALo5gcMkhf0Sqd9jzNYq17Bbou1gbJyg0NFx53eQehtv05 UNBTr101R7saL4+FsM+iwS+fmdSosRAMaPD2KN34PVEtOiGYVbuhdGmQiu00z7SZufBrdi pI3tRmsa6zXowd1CKA2Csa9Qj8WCtg3ObLMHFMo1ZdD0p9ckFO+4mcerZ5zDPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737244718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yNAuNIH15ySxmsWvzXcqWE573KMqvMVEM2jHIXgzXf8=; b=moX+TZLga3eSg+w/NoSrJxD9rhXmhQb0ndxdCo2NY7nGCWn3TWqgXVfpmTv9u7TFY5sw7R PMYrmX28rpqPaAHw+kFWsDYTDwfIgNdvV8JbKrT6/35oPV4sKUQTsd9JQaa7F/nei7Jt1i irQcrZhhNN5Vgt5BX3iP96X7YY4zMcAQ/Dzoflykpffp7M4yIrtlUGbEBHxo0VWeradYzC h1Zge2rOiEP5zd08q75n0X3/Ntl7uOWLvROHX29BMkHxjMz3aZJCmr7d19TrqpJFw4N46/ UBfU6fy2qtS3Dt2F+Laun38cVBrMQaVbs59pZfZj3YPfRFqic9Ersu+oqqvPTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737244718; a=rsa-sha256; cv=none; b=dQS5jDZ0x5NkmhVmaZzvSC4RiaUxVAvU+m60X2+EEd6VutezlcguK5Taj8W940R0CGdR7E Y8b1cwTxmZ8YiUdVpnEvjudQ7AT3/gi6N4YRuPcJS9eMlXrpWKzKhnF9Gy0gu+9trEJINq 8ImCi314m4Ky0YN36HIT6Xdwy1ZWSw8G/11s7/aYl7NAvdZQFSAg8+5F0cZs1UoxMXE7eR SaPsCF0P6MMHIjzbNmMZ+eDYf+wWghU4z7VfsYkvH1S0d6xD4hisC2Pj+vGdEVQH6H+0QR CXylOEG/2/BEQREGE1psut3u26oZhmnN8UcjfF1w/dccYi3mMR2f4NO7FzyA8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbD8G0tPjz8Tq; Sat, 18 Jan 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 50INwcxU073480; Sat, 18 Jan 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 50INwckN073477; Sat, 18 Jan 2025 23:58:38 GMT (envelope-from git) Date: Sat, 18 Jan 2025 23:58:38 GMT Message-Id: <202501182358.50INwckN073477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 685cafd668f5 - stable/14 - pf: allow ICMP messages related to an SCTP state to pass List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 685cafd668f591e2a8afcd723fbb6b744ae07e31 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=685cafd668f591e2a8afcd723fbb6b744ae07e31 commit 685cafd668f591e2a8afcd723fbb6b744ae07e31 Author: Kristof Provost AuthorDate: 2024-12-20 13:38:41 +0000 Commit: Kristof Provost CommitDate: 2025-01-18 21:10:22 +0000 pf: allow ICMP messages related to an SCTP state to pass Much like we already do for TCP and UDP we should also parse SCTP-in-ICMP messages to see if they apply to an SCTP connection we've already allowed. If so we should allow the ICMP packet to pass, even if we'd otherwise block it. Add a test case where we generate an 'ICMP unreachable - need to frag' packet and check that it passes through pf. MFC after: 2 weeks Sponsored by: Orange Business Services (cherry picked from commit 7d5e02b01577047290e937399accc02e6b184ce9) --- sys/netpfil/pf/pf.c | 91 +++++++++++++++++++++++++++++++++++++++++++- tests/sys/netpfil/pf/sctp.sh | 86 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 163eb2cedc27..18b907c45d38 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6760,8 +6760,8 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, &virtual_id, &virtual_type) == 0) { /* - * ICMP query/reply message not related to a TCP/UDP packet. - * Search for an ICMP state. + * ICMP query/reply message not related to a TCP/UDP/SCTP + * packet. Search for an ICMP state. */ ret = pf_icmp_state_lookup(&key, pd, state, m, off, pd->dir, kif, virtual_id, virtual_type, icmp_dir, &iidx, @@ -7165,6 +7165,93 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, break; } #ifdef INET + case IPPROTO_SCTP: { + struct sctphdr sh; + struct pf_state_peer *src; + int copyback = 0; + + if (! pf_pull_hdr(m, off2, &sh, sizeof(sh), NULL, reason, + pd2.af)) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: ICMP error message too short " + "(sctp)\n")); + return (PF_DROP); + } + + key.af = pd2.af; + key.proto = IPPROTO_SCTP; + PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); + PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); + key.port[pd2.sidx] = sh.src_port; + key.port[pd2.didx] = sh.dest_port; + + STATE_LOOKUP(kif, &key, *state, pd); + + if (pd->dir == (*state)->direction) { + src = &(*state)->dst; + } else { + src = &(*state)->src; + } + + if (src->scrub->pfss_v_tag != sh.v_tag) { + DPFPRINTF(PF_DEBUG_MISC, + ("pf: ICMP error message has incorrect " + "SCTP v_tag\n")); + return (PF_DROP); + } + + /* translate source/destination address, if necessary */ + if ((*state)->key[PF_SK_WIRE] != + (*state)->key[PF_SK_STACK]) { + struct pf_state_key *nk = + (*state)->key[pd->didx]; + + if (PF_ANEQ(pd2.src, + &nk->addr[pd2.sidx], pd2.af) || + nk->port[pd2.sidx] != sh.src_port) + pf_change_icmp(pd2.src, &sh.src_port, + daddr, &nk->addr[pd2.sidx], + nk->port[pd2.sidx], NULL, + pd2.ip_sum, icmpsum, + pd->ip_sum, 0, pd2.af); + + if (PF_ANEQ(pd2.dst, + &nk->addr[pd2.didx], pd2.af) || + nk->port[pd2.didx] != sh.dest_port) + pf_change_icmp(pd2.dst, &sh.dest_port, + saddr, &nk->addr[pd2.didx], + nk->port[pd2.didx], NULL, + pd2.ip_sum, icmpsum, + pd->ip_sum, 0, pd2.af); + copyback = 1; + } + + if (copyback) { + switch (pd2.af) { +#ifdef INET + case AF_INET: + m_copyback(m, off, ICMP_MINLEN, + (caddr_t )&pd->hdr.icmp); + m_copyback(m, ipoff2, sizeof(h2), + (caddr_t )&h2); + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + m_copyback(m, off, + sizeof(struct icmp6_hdr), + (caddr_t )&pd->hdr.icmp6); + m_copyback(m, ipoff2, sizeof(h2_6), + (caddr_t )&h2_6); + break; +#endif /* INET6 */ + } + m_copyback(m, off2, sizeof(sh), (caddr_t)&sh); + } + + return (PF_PASS); + break; + } case IPPROTO_ICMP: { struct icmp *iih = &pd2.hdr.icmp; diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 95a780747d82..563103827fac 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -745,6 +745,91 @@ timeout_cleanup() pft_cleanup } +atf_test_case "related_icmp" "cleanup" +related_icmp_head() +{ + atf_set descr 'Verify that ICMP messages related to an SCTP connection are allowed' + atf_set require.user root +} + +related_icmp_body() +{ + sctp_init + + epair_cl=$(vnet_mkepair) + epair_rtr=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + ifconfig ${epair_cl}a 192.0.2.1/24 up + route add default 192.0.2.2 + + vnet_mkjail rtr ${epair_cl}b ${epair_rtr}a + jexec rtr ifconfig ${epair_cl}b 192.0.2.2/24 up + jexec rtr ifconfig ${epair_rtr}a 198.51.100.1/24 up + jexec rtr sysctl net.inet.ip.forwarding=1 + jexec rtr route add default 198.51.100.2 + + vnet_mkjail rtr2 ${epair_rtr}b ${epair_srv}a + jexec rtr2 ifconfig ${epair_rtr}b 198.51.100.2/24 up + jexec rtr2 ifconfig ${epair_srv}a 203.0.113.1/24 up + jexec rtr2 ifconfig ${epair_srv}a mtu 1300 + jexec rtr2 sysctl net.inet.ip.forwarding=1 + jexec rtr2 route add default 198.51.100.1 + + vnet_mkjail srv ${epair_srv}b + jexec srv ifconfig ${epair_srv}b 203.0.113.2/24 up + jexec srv ifconfig ${epair_srv}b mtu 1300 + jexec srv route add default 203.0.113.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.2 + atf_check -s exit:0 -o ignore \ + ping -c 1 198.51.100.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.1 + atf_check -s exit:0 -o ignore \ + ping -c 1 203.0.113.2 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "block proto icmp" \ + "pass proto sctp" + + # Make sure SCTP traffic passes + echo "foo" | jexec srv nc --sctp -N -l 1234 & + sleep 1 + + out=$(nc --sctp -N -w 3 203.0.113.2 1234) + if [ "$out" != "foo" ]; then + jexec rtr pfctl -ss -vv + jexec rtr pfctl -sr -vv + atf_fail "SCTP connection failed" + fi + + # Do we see ICMP traffic if we send overly large traffic? + echo "foo" | jexec srv nc --sctp -N -l 1234 >/dev/null & + sleep 1 + + atf_check -s exit:0 -o not-match:".*destination unreachable:.*" \ + netstat -s -p icmp + + # Generate traffic that will be fragmented by rtr2, and will provoke an + # ICMP unreachable - need to frag (mtu 1300) message + dd if=/dev/random bs=1600 count=1 | nc --sctp -N -w 3 203.0.113.2 1234 + + # We'd expect to see an ICMP message + atf_check -s exit:0 -o match:".*destination unreachable: 1" \ + netstat -s -p icmp +} + +related_icmp_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -757,4 +842,5 @@ atf_init_test_cases() atf_add_test_case "rdr_v4" atf_add_test_case "pfsync" atf_add_test_case "timeout" + atf_add_test_case "related_icmp" } From nobody Sun Jan 19 00:25:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbDlJ1mjnz5l5LQ; Sun, 19 Jan 2025 00:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbDlJ1DDkz3bk8; Sun, 19 Jan 2025 00:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PqtUXM8xzlAkvPTAlYlMR9dcXuwNCoqyjPUxsa4Fhk=; b=oMTFezeFbjJk/k+sn1Uz/Onn5M42FzRHty+uauoM8imT5BuQwh0SUxIuRJ5seYMsV9U0tV hll0iSAuFnH9QKsJyvRU9zGeu8z623YczXsWARGDI7fDCMHZEr1h5y4OBTmXPCZ4U+XLbq tuCJ8xOkkb6CbsrkC5bN1GpT810wJh09JYwR8T7BzdXVCHUmgNI7Eh7Yq4Dz4TC1Iel+3m AcStIdImV4zCCZU34q66rqWm9swH8RTeSFh42UZe+L0NuH+FcRgYsBqbSXm+nHJuQojaNV yQcx/Pdunb3FZhGVr8v4m27LfBMlYH6jxJbwIy4ucoL2Gyg/FU2PE8xiZL6f8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2PqtUXM8xzlAkvPTAlYlMR9dcXuwNCoqyjPUxsa4Fhk=; b=g8hu+wPH6dg96QjJiPqQ9Eu411lFz2q90nKNSSdYCkcar3i6A3nELZtw3rTX44BwqdjiGm tFeKp9ansQrjbVkhvWl/qdDTYkto7oaFwHwMOn4k2SG/TN2+WbfayFJNHL6WTXGFJccEhB NN6+DXX9YMUpWNmuztAjIJrQlQ5bL0+vzNvL23fZ3CKtoCnQcu2bDibzHIUGfJtOb4VW6W +4zuBeZPXRtGJ1ISlUsE1NLG91LEgeAdB408V8ok49uA+yS+7DR5bo2fLHvu/6ra8kzXrp LElGke0NneJIwfzPzTOm7YRkWkTqnHvJuQjvz2iCha9sskYDNu9cTDW0RnkKHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737246332; a=rsa-sha256; cv=none; b=GdrhqJ2QjeHWmf0xhgUXx9Vbu5ph8f6+BBRitjNr82wwoIm7A8mmz8RONuqYQb6iVDs+lm tcrr/I6mXUQ37IBrqB5aQJnH6anKa8Th2d0/flvSqesAkvYORlOTEHNcY79uExIw/duwzy 0iVIMHpSE9tok4QqyGw/zXRku6OnHJ2T4AhIxmP7z4CO3f0JL+3SDoKXZyqS+9KG3dWDgt ob/mBJBDSpZyXuxluMhKxnz6e9Iqo3k7ratJ52PFzD2HJmzY+KnRZ2WHrQrru6ICR0TT4B QT1edrpFl/AKYETQF6PDLmWyV5/FKupPpi7xqPvi2b2cIji5HppmXrEQetK6TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbDlJ0cx9z9gJ; Sun, 19 Jan 2025 00:25: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 50J0PVdO029547; Sun, 19 Jan 2025 00:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50J0PVoV029542; Sun, 19 Jan 2025 00:25:31 GMT (envelope-from git) Date: Sun, 19 Jan 2025 00:25:31 GMT Message-Id: <202501190025.50J0PVoV029542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6823172ca2c5 - stable/14 - amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Cezanne" cpus List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6823172ca2c5a3d2ad1a2937046dd5961919f458 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6823172ca2c5a3d2ad1a2937046dd5961919f458 commit 6823172ca2c5a3d2ad1a2937046dd5961919f458 Author: Simon Wells AuthorDate: 2025-01-12 11:45:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-19 00:24:57 +0000 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Cezanne" cpus PR: 284009 (cherry picked from commit 7aa6eeb220d89a3c29eb4f768f258622c3803f46) --- sys/dev/amdsmn/amdsmn.c | 2 +- sys/dev/amdtemp/amdtemp.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 4f85c830b327..1380eff98114 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -58,7 +58,7 @@ #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ -#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 +#define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 #define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 37ec49f6975b..2e1be3c54f8d 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -113,7 +113,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 #define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 /* Also M70H, F19H M00H/M20H */ -#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 +#define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M40H_ROOT 0x14b5 #define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 @@ -869,6 +869,7 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) switch (model) { case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */ case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */ + case 0x50 ... 0x5f: /* Zen3 Ryzen "Cezanne" */ maxreg = 8; _Static_assert((int)NUM_CCDS >= 8, ""); break; From nobody Sun Jan 19 00:25:33 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbDlK26Tqz5l5PM; Sun, 19 Jan 2025 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbDlK1Tylz3bk9; Sun, 19 Jan 2025 00:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73jqCiat/WpW8DqkMLcY026zKtI7xCozsDphsxZzohY=; b=lJ9TVWFlln25s1BkfJor1r0Tgq0BOKusPPkluNW+mEMuceZdK76wW0o1IOyzBpX6I4shrf hajwiFX2bZex4E8Gy7zGEjqHZT+p5+BnrcdlH1UzNHacDxpzDsn1GvNOIlo1pAQAnWzQRD lqtyUPlTR4y7g1ApFgY7qTj0wxXfO0CFJROvDWFlVz087ZyNy6BtNo3whCjlyYfXbT16TJ WpxxCzjKDN49Vgs/NQ16B39LWtyRfsisztcPHZLqxX/1JOBMHnTo/kXXdGm2E8cCxSqxs+ ujvEzK2ZMxuEhhX8Mf+ZL3Be0tZTnBmoaBxEq0wUxjDUx3ygO7rt117fMbgQwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737246333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73jqCiat/WpW8DqkMLcY026zKtI7xCozsDphsxZzohY=; b=qYOm/V9dprjpFIYgz8ggiNI6JbUVeq/niJJJTdAOsq9h8qtwccB8q4CEahp/k0+74iJssC VeUK47lq4XCa/M0o5YLB3UDBuIdvCZ4UA10fHx3wR37szHngruzM0EE+qf6a8Lkn47dUfi 5u5oSLvTDvkR/RP53jTKhldMUH1xa9cGTLVehsx9PlfgZiSFefFpPDHmJPgINLiKbA7QGA 89i8KzMmMn565ot2nF1LWz4os5SoPjOQVB3K6PGkaPS/oX3UJOIrM8TSEfkonfuLxYyf/m uPNPiTgu/ufvX1Wc0tgqlQJSdcoQRoNPIdSosM0MdEEWuMBKeotU8mnyT0TmNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737246333; a=rsa-sha256; cv=none; b=JvrpCXvEA3jA294FjEwThYZMRzujEi/EAsGC0+IFVH0w9AIvDkXH328+h23xlZxZR72KkJ oZXYzXVVi3SyfWhfSOyKNpnOhtBWjN4QCMVAVD/9kanEqFPHN5g7unnGcOpRwFnRBTVg5e Q4EryxLfKnYZ8TZHNCNz1mdwSouV3OVPo5MgJRgTbWihX+CY4AjY/yutQOwk6ncHX9Yehp Vo8okfSzU7IgpjolaOeV7u+eChzFTPpKXSbNBcav2vMIK7JX3+rAtHRYB/XzzVmGhh9cWR 6iP0qIGRYdlykwLz3LEEEM5JMMs0GF3zszbaIbjf+ahg5f0p1kccUKeCZ3J6Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbDlK15gWzBH0; Sun, 19 Jan 2025 00:25: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 50J0PXOI029588; Sun, 19 Jan 2025 00:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50J0PXSM029585; Sun, 19 Jan 2025 00:25:33 GMT (envelope-from git) Date: Sun, 19 Jan 2025 00:25:33 GMT Message-Id: <202501190025.50J0PXSM029585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 15e2065a1ee5 - stable/14 - amdsmn(4), amdtemp(4): add support for Zen 5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 15e2065a1ee5b744b7f04d976ecfc31b49504081 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15e2065a1ee5b744b7f04d976ecfc31b49504081 commit 15e2065a1ee5b744b7f04d976ecfc31b49504081 Author: Simon Wells AuthorDate: 2025-01-12 11:46:05 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-19 00:24:58 +0000 amdsmn(4), amdtemp(4): add support for Zen 5 PR: 284010 (cherry picked from commit a9a71513ccfcb38346c84b006b43d45511d1652c) --- sys/dev/amdsmn/amdsmn.c | 3 ++- sys/dev/amdtemp/amdtemp.c | 28 +++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index 1380eff98114..262adcc4bff3 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -61,7 +61,7 @@ #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT 0x14a4 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT 0x14b5 -#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 +#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define PCI_DEVICE_ID_AMD_19H_M70H_ROOT 0x14e8 struct pciid; @@ -212,6 +212,7 @@ amdsmn_probe(device_t dev) case 0x15: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 2e1be3c54f8d..cad16c80ee17 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -116,7 +116,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630 /* Also F19H M50H */ #define DEVICEID_AMD_HOSTB19H_M10H_ROOT 0x14a4 #define DEVICEID_AMD_HOSTB19H_M40H_ROOT 0x14b5 -#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 +#define DEVICEID_AMD_HOSTB19H_M60H_ROOT 0x14d8 /* Also F1AH M40H */ #define DEVICEID_AMD_HOSTB19H_M70H_ROOT 0x14e8 static const struct amdtemp_product { @@ -231,6 +231,7 @@ static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor); static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor); static void amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model); static void amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model); +static void amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model); static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t amdtemp_methods[] = { @@ -318,6 +319,7 @@ amdtemp_probe(device_t dev) case 0x16: case 0x17: case 0x19: + case 0x1a: break; default: return (ENXIO); @@ -477,6 +479,7 @@ amdtemp_attach(device_t dev) break; case 0x17: case 0x19: + case 0x1a: sc->sc_ntemps = 1; sc->sc_gettemp = amdtemp_gettemp17h; needsmn = true; @@ -540,6 +543,8 @@ amdtemp_attach(device_t dev) amdtemp_probe_ccd_sensors17h(dev, model); else if (family == 0x19) amdtemp_probe_ccd_sensors19h(dev, model); + else if (family == 0x1a) + amdtemp_probe_ccd_sensors1ah(dev, model); else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), @@ -893,3 +898,24 @@ amdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model) amdtemp_probe_ccd_sensors(dev, maxreg); } + +static void +amdtemp_probe_ccd_sensors1ah(device_t dev, uint32_t model) +{ + struct amdtemp_softc *sc = device_get_softc(dev); + uint32_t maxreg; + + switch (model) { + case 0x40 ... 0x4f: /* Zen5 Ryzen "Granite Ridge" */ + sc->sc_temp_base = AMDTEMP_ZEN4_CCD_TMP_BASE; + maxreg = 8; + _Static_assert((int)NUM_CCDS >= 8, ""); + break; + default: + device_printf(dev, + "Unrecognized Family 1ah Model: %02xh\n", model); + return; + } + + amdtemp_probe_ccd_sensors(dev, maxreg); +} From nobody Sun Jan 19 10:31:48 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbVBs0NWSz5l2PJ; Sun, 19 Jan 2025 10:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbVBr6gQ1z4Ntm; Sun, 19 Jan 2025 10:31:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737282708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3Yc5RxiFnwtcxuuQEoyjKKCLQXsmRyNx9+/7CKWSlU=; b=OmmxBCc9Dd6xd0buWq1uH2ILs4MChgZdc0t4a6nZrI4UI/RV8jhQjYqoHDrBwOwANWvhSE JGwUbLWUtR9MR/JamX/Yv1u1XEaBYeiKLc+pxtm9XmUPBOeOMiSwJ/NKSQtItyN/lMXFwq MWzx3o9XHHmAFAbJBnplO4NVnJQ9HWpXrrVLk00ySOplmKHgfIqwzr6WuawcOcdkOL18x2 rqDwKkbf+2sTcX7UcWp5UKN7vvRWt7kvAktHKX/8x1G2BGHngmAKSbKju7HWu+yhrqIW9p 5hEa25bzRDpzl7TQn9Rq6MI80XtqhyiJskxntrxu1bvMr0Ux9n41CAp2wzMkvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737282708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3Yc5RxiFnwtcxuuQEoyjKKCLQXsmRyNx9+/7CKWSlU=; b=tXQZZR640+SHBOsA91J8y3G0WxR5zJ50R38oif8UHjVVtbt/X7/PcFg1f2n2IOpZ+l6Xsf 7LxhR6K4gQh38JrBFwgjD3y1DGEBFwZVyCfVGfxKr/QoenzCaV4b5DcqWgUqcAu8p0In48 EzcymRFWjIDttN8OlyxZ+Qu8zQ8MmljkviwwxQ8VmD78wUNiaPjpTzGFt9+cF38g+Pz8wu gYFIfa1aS4z3I0KT88jhmmWbS3SffVu0Wn7rkD8IaSHaGM3j1YOG27f0rDIZ6Hc7Ynq/+q ZZijd3AXCwRN2m+Ynz3oRBS3wmOrliGyKe7jtiJozFcvM1vExQ17o8IVw4vT7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737282708; a=rsa-sha256; cv=none; b=h/LU/rBf+vAEG2M8aT1Yo42dHOPAz2Uqzq4rpC4MsdmJsEHrUSP22VBfwiEKELl844Ru47 gwiG8E5qmdBr2lEXHa70sXgYRS/RC5Obfp+6r6EDxz4AABmyCIwPSulpMskhVcPTQ7sSZW MP0saQ9aJFs+d5/ORQ5+k2PaWPOnFyPsjixUjyOQ6KwmhsYFpqHLwrMH1GYqbAIdOtbHXn 8Yr7ThIqE4zUZ/hJ+S6ndty/XpusnyC09GmxtABFbf5mgWyY2vp/q4UfiCQAbbUnwNTkAM jErI68fSp38xvktca209cR69vHTrwN+JP+wr5y0Al8DUi2mz2twV0+bVwIMNIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbVBr6G7Nzmqv; Sun, 19 Jan 2025 10:31: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 50JAVmZS066168; Sun, 19 Jan 2025 10:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JAVmcI066165; Sun, 19 Jan 2025 10:31:48 GMT (envelope-from git) Date: Sun, 19 Jan 2025 10:31:48 GMT Message-Id: <202501191031.50JAVmcI066165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: bfa14ad08796 - stable/14 - release: fix architecture for OCI images List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bfa14ad08796f33435ad57f393725ca56fcbfce5 Auto-Submitted: auto-generated The branch stable/14 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=bfa14ad08796f33435ad57f393725ca56fcbfce5 commit bfa14ad08796f33435ad57f393725ca56fcbfce5 Author: Doug Rabson AuthorDate: 2024-12-04 13:23:58 +0000 Commit: Doug Rabson CommitDate: 2025-01-19 10:31:02 +0000 release: fix architecture for OCI images PR: 283260 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48051 (cherry picked from commit e2fc29e53986c69ac91d40e7f1ef8fbca317771e) --- release/scripts/make-oci-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/make-oci-image.sh b/release/scripts/make-oci-image.sh index a139a38d1930..6180ed9d53b4 100644 --- a/release/scripts/make-oci-image.sh +++ b/release/scripts/make-oci-image.sh @@ -56,7 +56,7 @@ else base_image=scratch fi -c=$(buildah from ${base_image}) +c=$(buildah from --arch ${arch} ${base_image}) m=$(buildah mount $c) oci_image_build buildah unmount $c From nobody Sun Jan 19 10:31:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbVBt2st4z5l31K; Sun, 19 Jan 2025 10:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbVBt0WqWz4Nrs; Sun, 19 Jan 2025 10:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737282710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zKbNOtdMBJpdTcD8xDEG2DKvBy2XEctqCNot+8kCZFU=; b=GY/p+4OODXDvZDaALoxeBVzlMdBivfjzqt+0sLM6yJTtLucpUV3RS/dUuaTOY382OZLuc6 CqNQBn5pjVk4VVICHj3AHNTRZ0fI5ar3hStBf1nvBmsksMpEybha/XLiR+yw6Y2PVbBaMI p9zVofV1sdccv1XlGyw78j6gs75wi9r9SLecR1FGqbPeK9c4OgAJPyQm5f+mElJmnaAzsK hlQkB/9oMTLt7pdCVQzIEGkJ3BL4YUV4uhgYV7daCz0wDNUa0hJmbbBJILk6OHCRa1mZRJ OSPDOFCSfHoCuEp2w0uWePyisr7NpCyStvKjHepmBE5iVX1yeGJ12j1HZwvJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737282710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zKbNOtdMBJpdTcD8xDEG2DKvBy2XEctqCNot+8kCZFU=; b=LXnqhIfmqQrbJ0F0pJlv/uzQw5izfRMKjd1g9xjT7h+XVF8qC/hpNYSv/iNXfHUbFGuxFF uJTfVRpSO9wXOacNEXp8nqNTXgft6Yvk3CtcjmOAUj2WpxbIKEViO6kBlwRfSJ3WS0rUdy CU0ADLSdiU4WC+sXIoUhdrd5aPRSGwtYWAVzaqdj60IHiRlQW0/19pyF01W0JXbfgA7v2G FyTT9iyy2i6ZL9Y3TMScTauXa5JIU6UJuwgomf/Py1jYW7nQ9xByQZRzPl8Ld18nLLMVSH IENSANbMc1MhhrEXqRRWSocVT+Ip2xDakniWNo38KPe0MEVQeW+rupI61yyx3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737282710; a=rsa-sha256; cv=none; b=VLRzxqE5rKfSXCbqtn+SXSo9tV6UJo0EQNttGMzftesXcRulsNv/pvRK7aG+DfpkCjuv3T IscCiqAQgDpHO4ErUCj0z/FeWAceWRh98HWk8pppvdK0peXz0g2UMCyvlcAZUJk7tBxYLa UjZh1GquPAZO3MvdMBy4GOp98jcVCQOM2qTtFhBGi5b66eVRT7KgvgyxlmIIffCFVGE0TP ToSoGTVOXm91DcV/SOXflwOP9tYvvn8hNl1coEtD/WCGTcl5RjeesBjZ42PmGiDqF0TMKs 5CwV4x7bTZbEM/wSOmtnL3ChKagiYUQy7LzAIFCZCtSSgGvy2cXiBoPoAiWHig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbVBs6mDKzmYh; Sun, 19 Jan 2025 10:31: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 50JAVnj6066205; Sun, 19 Jan 2025 10:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JAVnKS066202; Sun, 19 Jan 2025 10:31:49 GMT (envelope-from git) Date: Sun, 19 Jan 2025 10:31:49 GMT Message-Id: <202501191031.50JAVnKS066202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: 6ede5a29d5e7 - stable/14 - release: install etc files from the source tree, not the host List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6ede5a29d5e7faa852a193d8fcbbbdf874d143c2 Auto-Submitted: auto-generated The branch stable/14 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=6ede5a29d5e7faa852a193d8fcbbbdf874d143c2 commit 6ede5a29d5e7faa852a193d8fcbbbdf874d143c2 Author: Doug Rabson AuthorDate: 2024-12-23 10:19:27 +0000 Commit: Doug Rabson CommitDate: 2025-01-19 10:31:02 +0000 release: install etc files from the source tree, not the host Reviewed by: cperciva MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D48180 (cherry picked from commit bc77aa7df7339b166c0d6394526fe59dea89f4b1) --- release/Makefile.oci | 2 ++ release/tools/oci-image-static.conf | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/release/Makefile.oci b/release/Makefile.oci index 461c95f49636..da35156c5a95 100644 --- a/release/Makefile.oci +++ b/release/Makefile.oci @@ -24,6 +24,8 @@ OCI_DEPS_minimal= container-image-dynamic.txz .for _IMG in ${OCI_IMAGES} OCI_TARGETS+= container-image-${_IMG}.txz container-image-${_IMG}.txz: ${OCI_DEPS_${_IMG}} + # Adjust PATH so that we run pwd_mkdb from the bootstrap tools + env PATH=${OBJTOP}/tmp/legacy/bin:${PATH:Q} \ sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} skopeo copy \ containers-storage:localhost/freebsd${REVISION:R}-${_IMG}:latest \ diff --git a/release/tools/oci-image-static.conf b/release/tools/oci-image-static.conf index 27cfb3c6778c..552328e66f3c 100644 --- a/release/tools/oci-image-static.conf +++ b/release/tools/oci-image-static.conf @@ -7,17 +7,20 @@ OCI_BASE_IMAGE= oci_image_build() { - mtree -deU -p $m/ -f /etc/mtree/BSD.root.dist > /dev/null - mtree -deU -p $m/var -f /etc/mtree/BSD.var.dist > /dev/null - mtree -deU -p $m/usr -f /etc/mtree/BSD.usr.dist > /dev/null - mtree -deU -p $m/usr/include -f /etc/mtree/BSD.include.dist > /dev/null - mtree -deU -p $m/usr/lib -f /etc/mtree/BSD.debug.dist > /dev/null + local srcdir=${curdir}/.. + mtree -deU -p $m/ -f ${srcdir}/etc/mtree/BSD.root.dist > /dev/null + mtree -deU -p $m/var -f ${srcdir}/etc/mtree/BSD.var.dist > /dev/null + mtree -deU -p $m/usr -f ${srcdir}/etc/mtree/BSD.usr.dist > /dev/null + mtree -deU -p $m/usr/include -f ${srcdir}/etc/mtree/BSD.include.dist > /dev/null + mtree -deU -p $m/usr/lib -f ${srcdir}/etc/mtree/BSD.debug.dist > /dev/null install_packages ${abi} ${workdir} $m FreeBSD-caroot FreeBSD-zoneinfo - cp /etc/master.passwd $m/etc + cp ${srcdir}/etc/master.passwd $m/etc pwd_mkdb -p -d $m/etc $m/etc/master.passwd || return $? - cp /etc/group $m/etc || return $? - cp /etc/termcap.small $m/etc/termcap.small || return $? - cp /etc/termcap.small $m/usr/share/misc/termcap || return $? + cp ${srcdir}/etc/group $m/etc || return $? + # termcap.small is generated so we get it from OBJDIR - make sets our + # working directory to OBJDIR/release + cp ../etc/termcap/termcap.small $m/etc/termcap.small || return $? + cp ../etc/termcap/termcap.small $m/usr/share/misc/termcap || return $? env DESTDIR=$m /usr/sbin/certctl rehash # Generate a suitable repo config for pkgbase case ${branch} in From nobody Sun Jan 19 11:06:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbVyk2Jh2z5l4fl; Sun, 19 Jan 2025 11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbVyk1B1cz3DbC; Sun, 19 Jan 2025 11: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=1737284782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Y06ddS1ejMjS03FkNHitUm+7og2aKO5OoaMjGi94wE=; b=bWTyepIFX7t1xdYZLyj8Oc/GzlSN6ZvgcMSwJAkgnHhm/LxEmyZWKGgGYqT61tn8r3X/7s DtcfohUcnhfPxRymSQ4hNZCgNieSUZteeaeqyDaerDBiDcyuJDw5G0QmdLfJV+5aPvPO7k moi/NnGz3mL04gHoT7bq6jQbe7bqIHxoo4vDqEC0hL1rYzRsRfsMyRrWzwceyBLJzMLeS4 B9cwuPPeDU2lpOcJe2EtkQsvgg947eLtykmsDh+oLOi5dUSHBcBT7D3ZreMLrzb8b447Ms eeERbrCth8S41LnCsyiEIRtDMF1CtDlqWLb9jaw6YPxgSXxb9l5+1NpYuAL5KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737284782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Y06ddS1ejMjS03FkNHitUm+7og2aKO5OoaMjGi94wE=; b=MNhI/BGoIUOM3tpi+v/Y1CWKGVJabqJD4q2JQporitxtGDUTxKdhZbPxmJ9fmnWWW+GA+c gtea0Z8EqbaKGCF7u8M6I2YEvVfK6snplGwN8mXk1N/t/2wYJ2zhCJn0h+JG/hjrXGTl5v BDBwUsJheTgtd3d5ZqI2N2ScUO+KmlXYK+xk6dJafKens2dJMa/y/LgqNHeWxusOf3RN1k DmSutiT6BcoeFk6a21Zpru+jEnZkZ3Gv5DPtrkbg/SPWpuy9grFveycJtfVOCJ20YnDpl6 kWhwz7NGDea//qvV6xfzTTG87H7+o2i+LP0e1KUQqyEh2ieAwWXKByqlQ2C5EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737284782; a=rsa-sha256; cv=none; b=D6IjrrDU8unv6IkxuE/P5teGUoun8iHKgH8eHbHKunN42YC+YZwQ+n9C60vmSwQwnk8gxB DaU2W9NGtTORUS7JOldyJQyzEi1BDGg9gp7AJ81Cc8UMNkhPGDPiaSHBQnbM+/7t2QI2BN EJJUWyQNPV6446/quhq4D7xH4I2iLszQTDPC3daWBMy8kQwGKl3FqeXwR+h3U4RUdJe0D7 jZQCxSOaP1O/bEION1QobMYEIXEJ7k6y4iRSuMBmrz4IxxrUHe4yxzIwNhFMxu24ZEWsf2 /qUY6tyfl4cpLI2aFjF0LFb0NsELi2VtHMKeoCiiQOvCUwEeCNUVpYS71im9rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbVyk0YxjznLv; Sun, 19 Jan 2025 11: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 50JB6MP4026868; Sun, 19 Jan 2025 11:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JB6LFf026865; Sun, 19 Jan 2025 11:06:21 GMT (envelope-from git) Date: Sun, 19 Jan 2025 11:06:21 GMT Message-Id: <202501191106.50JB6LFf026865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: dc3f24ea8a25 - stable/14 - Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dc3f24ea8a2505cc17b26e081a7de9376e6934e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=dc3f24ea8a2505cc17b26e081a7de9376e6934e1 commit dc3f24ea8a2505cc17b26e081a7de9376e6934e1 Author: Dimitry Andric AuthorDate: 2025-01-16 20:04:36 +0000 Commit: Dimitry Andric CommitDate: 2025-01-19 11:05:53 +0000 Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. PR: 280562 MFC after: 3 days (cherry picked from commit 6c05f3a74f30934ee60919cc97e16ec69b542b06) --- contrib/llvm-project/clang/lib/Driver/Driver.cpp | 5 + .../clang/lib/Driver/ToolChains/Hexagon.cpp | 2 +- .../clang/lib/Format/UnwrappedLineParser.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 2 +- .../compiler-rt/lib/lsan/lsan_interceptors.cpp | 2 + contrib/llvm-project/libcxx/include/__config | 2 +- .../llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 2 +- .../CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 8 +- .../llvm-project/llvm/lib/MC/WasmObjectWriter.cpp | 111 +++++++++++++-------- .../lib/Target/Hexagon/HexagonISelLowering.cpp | 4 + .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 11 +- .../llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 7 ++ .../lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 17 ++-- .../llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td | 2 +- .../llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td | 5 +- .../AggressiveInstCombine.cpp | 3 +- .../lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 5 +- .../lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 +- lib/clang/include/VCSVersion.inc | 6 +- lib/clang/include/clang/Basic/Version.inc | 6 +- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +- lib/clang/include/llvm/Config/config.h | 4 +- lib/clang/include/llvm/Config/llvm-config.h | 4 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 25 files changed, 138 insertions(+), 87 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Driver/Driver.cpp b/contrib/llvm-project/clang/lib/Driver/Driver.cpp index ecae475f75da..f9dc8ab24fa9 100644 --- a/contrib/llvm-project/clang/lib/Driver/Driver.cpp +++ b/contrib/llvm-project/clang/lib/Driver/Driver.cpp @@ -6189,6 +6189,11 @@ std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const { if (auto P = SearchPaths(TC.getFilePaths())) return *P; + SmallString<128> R2(ResourceDir); + llvm::sys::path::append(R2, "..", "..", Name); + if (llvm::sys::fs::exists(Twine(R2))) + return std::string(R2); + return std::string(Name); } diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp index be7851adecea..76cedf312d68 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp @@ -379,9 +379,9 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA, if (NeedsXRayDeps) linkXRayRuntimeDeps(HTC, Args, CmdArgs); - CmdArgs.push_back("-lclang_rt.builtins-hexagon"); if (!Args.hasArg(options::OPT_nolibc)) CmdArgs.push_back("-lc"); + CmdArgs.push_back("-lclang_rt.builtins-hexagon"); } if (D.CCCIsCXX()) { if (HTC.ShouldLinkCXXStdlib(Args)) diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp index bfb592ae0749..e3fb976ee1cc 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp @@ -512,7 +512,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { break; do { NextTok = Tokens->getNextToken(); - } while (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof)); + } while (!NextTok->HasUnescapedNewline && NextTok->isNot(tok::eof)); while (NextTok->is(tok::comment)) NextTok = Tokens->getNextToken(); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp b/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp index 4e4f91de8cd5..18262993af28 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp @@ -11919,7 +11919,7 @@ bool Sema::isStdInitializerList(QualType Ty, QualType *Element) { if (TemplateClass->getIdentifier() != &PP.getIdentifierTable().get("initializer_list") || !getStdNamespace()->InEnclosingNamespaceSetOf( - TemplateClass->getDeclContext())) + TemplateClass->getNonTransparentDeclContext())) return false; // This is a template called std::initializer_list, but is it the right // template? diff --git a/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp b/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp index b569c337e976..efbf2fdfb0ab 100644 --- a/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp +++ b/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp @@ -77,6 +77,8 @@ INTERCEPTOR(void*, malloc, uptr size) { } INTERCEPTOR(void, free, void *p) { + if (UNLIKELY(!p)) + return; if (DlsymAlloc::PointerIsMine(p)) return DlsymAlloc::Free(p); ENSURE_LSAN_INITED; diff --git a/contrib/llvm-project/libcxx/include/__config b/contrib/llvm-project/libcxx/include/__config index 458910d6139e..8c83cb9abad0 100644 --- a/contrib/llvm-project/libcxx/include/__config +++ b/contrib/llvm-project/libcxx/include/__config @@ -27,7 +27,7 @@ // _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM. // Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is // defined to XXYYZZ. -# define _LIBCPP_VERSION 190105 +# define _LIBCPP_VERSION 190107 # define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y # define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h index d4e61c858890..d74896772bf5 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h @@ -838,7 +838,7 @@ private: SDValue ScalarizeVecRes_BUILD_VECTOR(SDNode *N); SDValue ScalarizeVecRes_EXTRACT_SUBVECTOR(SDNode *N); SDValue ScalarizeVecRes_FP_ROUND(SDNode *N); - SDValue ScalarizeVecRes_ExpOp(SDNode *N); + SDValue ScalarizeVecRes_UnaryOpWithExtraInput(SDNode *N); SDValue ScalarizeVecRes_INSERT_VECTOR_ELT(SDNode *N); SDValue ScalarizeVecRes_LOAD(LoadSDNode *N); SDValue ScalarizeVecRes_SCALAR_TO_VECTOR(SDNode *N); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 92b62ccdc275..ea95aaef8a1e 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -58,7 +58,11 @@ void DAGTypeLegalizer::ScalarizeVectorResult(SDNode *N, unsigned ResNo) { case ISD::BUILD_VECTOR: R = ScalarizeVecRes_BUILD_VECTOR(N); break; case ISD::EXTRACT_SUBVECTOR: R = ScalarizeVecRes_EXTRACT_SUBVECTOR(N); break; case ISD::FP_ROUND: R = ScalarizeVecRes_FP_ROUND(N); break; - case ISD::FPOWI: R = ScalarizeVecRes_ExpOp(N); break; + case ISD::AssertZext: + case ISD::AssertSext: + case ISD::FPOWI: + R = ScalarizeVecRes_UnaryOpWithExtraInput(N); + break; case ISD::INSERT_VECTOR_ELT: R = ScalarizeVecRes_INSERT_VECTOR_ELT(N); break; case ISD::LOAD: R = ScalarizeVecRes_LOAD(cast(N));break; case ISD::SCALAR_TO_VECTOR: R = ScalarizeVecRes_SCALAR_TO_VECTOR(N); break; @@ -426,7 +430,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_FP_ROUND(SDNode *N) { N->getOperand(1)); } -SDValue DAGTypeLegalizer::ScalarizeVecRes_ExpOp(SDNode *N) { +SDValue DAGTypeLegalizer::ScalarizeVecRes_UnaryOpWithExtraInput(SDNode *N) { SDValue Op = GetScalarizedVector(N->getOperand(0)); return DAG.getNode(N->getOpcode(), SDLoc(N), Op.getValueType(), Op, N->getOperand(1)); diff --git a/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp b/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp index f25dc92fa235..852646924567 100644 --- a/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp +++ b/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp @@ -1326,6 +1326,22 @@ static bool isInSymtab(const MCSymbolWasm &Sym) { return true; } +static bool isSectionReferenced(MCAssembler &Asm, MCSectionWasm &Section) { + StringRef SectionName = Section.getName(); + + for (const MCSymbol &S : Asm.symbols()) { + const auto &WS = static_cast(S); + if (WS.isData() && WS.isInSection()) { + auto &RefSection = static_cast(WS.getSection()); + if (RefSection.getName() == SectionName) { + return true; + } + } + } + + return false; +} + void WasmObjectWriter::prepareImports( SmallVectorImpl &Imports, MCAssembler &Asm) { // For now, always emit the memory import, since loads and stores are not @@ -1482,8 +1498,10 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm, LLVM_DEBUG(dbgs() << "Processing Section " << SectionName << " group " << Section.getGroup() << "\n";); - // .init_array sections are handled specially elsewhere. - if (SectionName.starts_with(".init_array")) + // .init_array sections are handled specially elsewhere, include them in + // data segments if and only if referenced by a symbol. + if (SectionName.starts_with(".init_array") && + !isSectionReferenced(Asm, Section)) continue; // Code is handled separately @@ -1853,49 +1871,54 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm, if (EmptyFrag.getKind() != MCFragment::FT_Data) report_fatal_error(".init_array section should be aligned"); - const MCFragment &AlignFrag = *EmptyFrag.getNext(); - if (AlignFrag.getKind() != MCFragment::FT_Align) - report_fatal_error(".init_array section should be aligned"); - if (cast(AlignFrag).getAlignment() != - Align(is64Bit() ? 8 : 4)) - report_fatal_error(".init_array section should be aligned for pointers"); - - const MCFragment &Frag = *AlignFrag.getNext(); - if (Frag.hasInstructions() || Frag.getKind() != MCFragment::FT_Data) - report_fatal_error("only data supported in .init_array section"); - - uint16_t Priority = UINT16_MAX; - unsigned PrefixLength = strlen(".init_array"); - if (WS.getName().size() > PrefixLength) { - if (WS.getName()[PrefixLength] != '.') + const MCFragment *nextFrag = EmptyFrag.getNext(); + while (nextFrag != nullptr) { + const MCFragment &AlignFrag = *nextFrag; + if (AlignFrag.getKind() != MCFragment::FT_Align) + report_fatal_error(".init_array section should be aligned"); + if (cast(AlignFrag).getAlignment() != + Align(is64Bit() ? 8 : 4)) report_fatal_error( - ".init_array section priority should start with '.'"); - if (WS.getName().substr(PrefixLength + 1).getAsInteger(10, Priority)) - report_fatal_error("invalid .init_array section priority"); - } - const auto &DataFrag = cast(Frag); - const SmallVectorImpl &Contents = DataFrag.getContents(); - for (const uint8_t * - P = (const uint8_t *)Contents.data(), - *End = (const uint8_t *)Contents.data() + Contents.size(); - P != End; ++P) { - if (*P != 0) - report_fatal_error("non-symbolic data in .init_array section"); - } - for (const MCFixup &Fixup : DataFrag.getFixups()) { - assert(Fixup.getKind() == - MCFixup::getKindForSize(is64Bit() ? 8 : 4, false)); - const MCExpr *Expr = Fixup.getValue(); - auto *SymRef = dyn_cast(Expr); - if (!SymRef) - report_fatal_error("fixups in .init_array should be symbol references"); - const auto &TargetSym = cast(SymRef->getSymbol()); - if (TargetSym.getIndex() == InvalidIndex) - report_fatal_error("symbols in .init_array should exist in symtab"); - if (!TargetSym.isFunction()) - report_fatal_error("symbols in .init_array should be for functions"); - InitFuncs.push_back( - std::make_pair(Priority, TargetSym.getIndex())); + ".init_array section should be aligned for pointers"); + + const MCFragment &Frag = *AlignFrag.getNext(); + nextFrag = Frag.getNext(); + if (Frag.hasInstructions() || Frag.getKind() != MCFragment::FT_Data) + report_fatal_error("only data supported in .init_array section"); + + uint16_t Priority = UINT16_MAX; + unsigned PrefixLength = strlen(".init_array"); + if (WS.getName().size() > PrefixLength) { + if (WS.getName()[PrefixLength] != '.') + report_fatal_error( + ".init_array section priority should start with '.'"); + if (WS.getName().substr(PrefixLength + 1).getAsInteger(10, Priority)) + report_fatal_error("invalid .init_array section priority"); + } + const auto &DataFrag = cast(Frag); + const SmallVectorImpl &Contents = DataFrag.getContents(); + for (const uint8_t * + P = (const uint8_t *)Contents.data(), + *End = (const uint8_t *)Contents.data() + Contents.size(); + P != End; ++P) { + if (*P != 0) + report_fatal_error("non-symbolic data in .init_array section"); + } + for (const MCFixup &Fixup : DataFrag.getFixups()) { + assert(Fixup.getKind() == + MCFixup::getKindForSize(is64Bit() ? 8 : 4, false)); + const MCExpr *Expr = Fixup.getValue(); + auto *SymRef = dyn_cast(Expr); + if (!SymRef) + report_fatal_error( + "fixups in .init_array should be symbol references"); + const auto &TargetSym = cast(SymRef->getSymbol()); + if (TargetSym.getIndex() == InvalidIndex) + report_fatal_error("symbols in .init_array should exist in symtab"); + if (!TargetSym.isFunction()) + report_fatal_error("symbols in .init_array should be for functions"); + InitFuncs.push_back(std::make_pair(Priority, TargetSym.getIndex())); + } } } diff --git a/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 7aeaebc584c6..995c5143e0a5 100644 --- a/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -3796,6 +3796,8 @@ EVT HexagonTargetLowering::getOptimalMemOpType( bool HexagonTargetLowering::allowsMemoryAccess( LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags, unsigned *Fast) const { + if (!VT.isSimple()) + return false; MVT SVT = VT.getSimpleVT(); if (Subtarget.isHVXVectorType(SVT, true)) return allowsHvxMemoryAccess(SVT, Flags, Fast); @@ -3806,6 +3808,8 @@ bool HexagonTargetLowering::allowsMemoryAccess( bool HexagonTargetLowering::allowsMisalignedMemoryAccesses( EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags, unsigned *Fast) const { + if (!VT.isSimple()) + return false; MVT SVT = VT.getSimpleVT(); if (Subtarget.isHVXVectorType(SVT, true)) return allowsHvxMisalignedMemoryAccesses(SVT, Flags, Fast); diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 823fb428472e..badbb4259974 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -1396,8 +1396,9 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM, } // Custom-legalize bitcasts from fixed-length vectors to scalar types. - setOperationAction(ISD::BITCAST, {MVT::i8, MVT::i16, MVT::i32, MVT::i64}, - Custom); + setOperationAction(ISD::BITCAST, {MVT::i8, MVT::i16, MVT::i32}, Custom); + if (Subtarget.is64Bit()) + setOperationAction(ISD::BITCAST, MVT::i64, Custom); if (Subtarget.hasStdExtZfhminOrZhinxmin()) setOperationAction(ISD::BITCAST, MVT::f16, Custom); if (Subtarget.hasStdExtFOrZfinx()) @@ -6317,7 +6318,8 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op, DAG.getNode(RISCVISD::FMV_W_X_RV64, DL, MVT::f32, NewOp0); return FPConv; } - if (VT == MVT::f64 && Op0VT == MVT::i64 && XLenVT == MVT::i32) { + if (VT == MVT::f64 && Op0VT == MVT::i64 && !Subtarget.is64Bit() && + Subtarget.hasStdExtDOrZdinx()) { SDValue Lo, Hi; std::tie(Lo, Hi) = DAG.SplitScalar(Op0, DL, MVT::i32, MVT::i32); SDValue RetReg = @@ -12616,7 +12618,8 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N, SDValue FPConv = DAG.getNode(RISCVISD::FMV_X_ANYEXTW_RV64, DL, MVT::i64, Op0); Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, FPConv)); - } else if (VT == MVT::i64 && Op0VT == MVT::f64 && XLenVT == MVT::i32) { + } else if (VT == MVT::i64 && Op0VT == MVT::f64 && !Subtarget.is64Bit() && + Subtarget.hasStdExtDOrZdinx()) { SDValue NewReg = DAG.getNode(RISCVISD::SplitF64, DL, DAG.getVTList(MVT::i32, MVT::i32), Op0); SDValue RetReg = DAG.getNode(ISD::BUILD_PAIR, DL, MVT::i64, diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp index 6c0cbeadebf4..7f4bbe786108 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -2536,6 +2536,13 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI, } } + if (int Idx = RISCVII::getFRMOpNum(Desc); + Idx >= 0 && MI.getOperand(Idx).getImm() == RISCVFPRndMode::DYN && + !MI.readsRegister(RISCV::FRM, /*TRI=*/nullptr)) { + ErrInfo = "dynamic rounding mode should read FRM"; + return false; + } + return true; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td index b860273d639e..93fd0b2aada3 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -6471,7 +6471,7 @@ defm PseudoVFRDIV : VPseudoVFRDIV_VF_RM; //===----------------------------------------------------------------------===// // 13.5. Vector Widening Floating-Point Multiply //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in { +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFWMUL : VPseudoVWMUL_VV_VF_RM; } @@ -6504,7 +6504,7 @@ defm PseudoVFWMACCBF16 : VPseudoVWMAC_VV_VF_BF_RM; //===----------------------------------------------------------------------===// // 13.8. Vector Floating-Point Square-Root Instruction //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in defm PseudoVFSQRT : VPseudoVSQR_V_RM; //===----------------------------------------------------------------------===// @@ -6516,7 +6516,7 @@ defm PseudoVFRSQRT7 : VPseudoVRCP_V; //===----------------------------------------------------------------------===// // 13.10. Vector Floating-Point Reciprocal Estimate Instruction //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in defm PseudoVFREC7 : VPseudoVRCP_V_RM; //===----------------------------------------------------------------------===// @@ -6627,9 +6627,10 @@ defm PseudoVFNCVT_F_X : VPseudoVNCVTF_W_RM; defm PseudoVFNCVT_RM_F_XU : VPseudoVNCVTF_RM_W; defm PseudoVFNCVT_RM_F_X : VPseudoVNCVTF_RM_W; -let hasSideEffects = 0, hasPostISelHook = 1 in +let hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFNCVT_F_F : VPseudoVNCVTD_W_RM; defm PseudoVFNCVTBF16_F_F : VPseudoVNCVTD_W_RM; +} defm PseudoVFNCVT_ROD_F_F : VPseudoVNCVTD_W; } // mayRaiseFPException = true @@ -6665,8 +6666,7 @@ let Predicates = [HasVInstructionsAnyF] in { //===----------------------------------------------------------------------===// // 14.3. Vector Single-Width Floating-Point Reduction Instructions //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, - hasSideEffects = 0 in { +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFREDOSUM : VPseudoVFREDO_VS_RM; defm PseudoVFREDUSUM : VPseudoVFRED_VS_RM; } @@ -6678,9 +6678,8 @@ defm PseudoVFREDMAX : VPseudoVFREDMINMAX_VS; //===----------------------------------------------------------------------===// // 14.4. Vector Widening Floating-Point Reduction Instructions //===----------------------------------------------------------------------===// -let IsRVVWideningReduction = 1, - hasSideEffects = 0, - mayRaiseFPException = true in { +let IsRVVWideningReduction = 1, hasSideEffects = 0, mayRaiseFPException = true, + hasPostISelHook = 1 in { defm PseudoVFWREDUSUM : VPseudoVFWRED_VS_RM; defm PseudoVFWREDOSUM : VPseudoVFWREDO_VS_RM; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td index 3bd6da286828..994859817014 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td @@ -694,7 +694,7 @@ let Predicates = [HasVendorXCVmem, IsRV32], AddedComplexity = 1 in { def : CVStriPat; def : CVStrriPat; - def : CVStrriPat; + def : CVStrriPat; def : CVStrriPat; def : CVStrrPat; diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td index 71aa1f19e089..eacc75b9a6c4 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td @@ -217,7 +217,8 @@ let Predicates = [HasVendorXSfvfwmaccqqq], DecoderNamespace = "XSfvfwmaccqqq" in def VFWMACC_4x4x4 : CustomSiFiveVMACC<0b111100, OPFVV, "sf.vfwmacc.4x4x4">; } -let Predicates = [HasVendorXSfvfnrclipxfqf], DecoderNamespace = "XSfvfnrclipxfqf" in { +let Predicates = [HasVendorXSfvfnrclipxfqf], DecoderNamespace = "XSfvfnrclipxfqf", + Uses = [FRM] in { def VFNRCLIP_XU_F_QF : CustomSiFiveVFNRCLIP<0b100010, OPFVF, "sf.vfnrclip.xu.f.qf">; def VFNRCLIP_X_F_QF : CustomSiFiveVFNRCLIP<0b100011, OPFVF, "sf.vfnrclip.x.f.qf">; } @@ -399,7 +400,7 @@ multiclass VPseudoSiFiveVFWMACC { multiclass VPseudoSiFiveVFNRCLIP { foreach i = 0-4 in - let hasSideEffects = 0 in + let hasSideEffects = 0, hasPostISelHook = 1 in defm "Pseudo" # NAME : VPseudoBinaryRoundingModegetType()), 0); Load1Ptr = Load1Ptr->stripAndAccumulateConstantOffsets( DL, Offset1, /* AllowNonInbounds */ true); - Load1Ptr = Builder.CreatePtrAdd(Load1Ptr, - Builder.getInt32(Offset1.getZExtValue())); + Load1Ptr = Builder.CreatePtrAdd(Load1Ptr, Builder.getInt(Offset1)); } // Generate wider load. NewLoad = Builder.CreateAlignedLoad(WiderType, Load1Ptr, LI1->getAlign(), diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index c235d2fb2a5b..f99f4487c554 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -1249,8 +1249,9 @@ static BasicBlock *buildClonedLoopBlocks( assert(VMap.lookup(&I) == &ClonedI && "Mismatch in the value map!"); // Forget SCEVs based on exit phis in case SCEV looked through the phi. - if (SE && isa(I)) - SE->forgetValue(&I); + if (SE) + if (auto *PN = dyn_cast(&I)) + SE->forgetLcssaPhiWithNewPredecessor(&L, PN); BasicBlock::iterator InsertPt = MergeBB->getFirstInsertionPt(); diff --git a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 746ba51a981f..fd08d5d9d755 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -18596,8 +18596,11 @@ bool SLPVectorizerPass::vectorizeCmpInsts(iterator_range CmpInsts, if (R.isDeleted(I)) continue; for (Value *Op : I->operands()) - if (auto *RootOp = dyn_cast(Op)) + if (auto *RootOp = dyn_cast(Op)) { Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R, TTI); + if (R.isDeleted(I)) + break; + } } // Try to vectorize operands as vector bundles. for (CmpInst *I : CmpInsts) { diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index 7624a2e4b17a..a18ba351aaab 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -1,8 +1,8 @@ -#define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define CLANG_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define LLDB_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLDB_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 5104f9d7ad7a..92e55f9316cf 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -1,8 +1,8 @@ -#define CLANG_VERSION 19.1.5 -#define CLANG_VERSION_STRING "19.1.5" +#define CLANG_VERSION 19.1.7 +#define CLANG_VERSION_STRING "19.1.7" #define CLANG_VERSION_MAJOR 19 #define CLANG_VERSION_MAJOR_STRING "19" #define CLANG_VERSION_MINOR 1 -#define CLANG_VERSION_PATCHLEVEL 5 +#define CLANG_VERSION_PATCHLEVEL 7 #define CLANG_VENDOR "FreeBSD " diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 6cf430b53591..ef16a34f470a 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style #define LLD_FREEBSD_VERSION 1400007 -#define LLD_VERSION_STRING "19.1.5 (FreeBSD llvmorg-19.1.5-0-gab4b5a2db582-" __XSTRING(LLD_FREEBSD_VERSION) ")" +#define LLD_VERSION_STRING "19.1.7 (FreeBSD llvmorg-19.1.7-0-gcd708029e0b2-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/lib/clang/include/lldb/Version/Version.inc b/lib/clang/include/lldb/Version/Version.inc index 5aa1f29215b4..02d44970ff54 100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@ -1,6 +1,6 @@ -#define LLDB_VERSION 19.1.5 -#define LLDB_VERSION_STRING "19.1.5" +#define LLDB_VERSION 19.1.7 +#define LLDB_VERSION_STRING "19.1.7" #define LLDB_VERSION_MAJOR 19 #define LLDB_VERSION_MINOR 1 -#define LLDB_VERSION_PATCH 5 +#define LLDB_VERSION_PATCH 7 /* #undef LLDB_FULL_VERSION_STRING */ diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index f86e4b6b5946..1968fb5072c9 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -338,10 +338,10 @@ #define PACKAGE_NAME "LLVM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LLVM 19.1.5" +#define PACKAGE_STRING "LLVM 19.1.7" /* Define to the version of this package. */ -#define PACKAGE_VERSION "19.1.5" +#define PACKAGE_VERSION "19.1.7" /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index 966249436723..4ca2d0083398 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -176,10 +176,10 @@ #define LLVM_VERSION_MINOR 1 /* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH 5 +#define LLVM_VERSION_PATCH 7 /* LLVM version string */ -#define LLVM_VERSION_STRING "19.1.5" +#define LLVM_VERSION_STRING "19.1.7" /* Whether LLVM records statistics for use with GetStatistics(), * PrintStatistics() or PrintStatisticsJSON() diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index db3347a0e5a5..76aa3f075586 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ -#define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Sun Jan 19 11:06:37 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbVz14CVJz5l4jD; Sun, 19 Jan 2025 11:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbVz13LC2z3DGx; Sun, 19 Jan 2025 11:06:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737284797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0Tz2iyF8qR0pMgsJDAL1gVHrxGv9j4WefojDMAYvvw=; b=TNtE0+HHQHg6ivDKId644JxjOVZGnGRxL+EtQW3eL/sDbUmNcR6/B7ei+mN20m/+i7BR5s k8GTNJQQ7gq6+N3I50MRcmIA3k2BxXpE3PLlWaPpSRzDqe+n3N0VbhTht245QrUKl5JOGo GRmPIObBmnnWpW7u5fbUeIlsEf3ZabGWG8e+LEdR6aVULJWfMEKqA6vy+aEn9lVRU2fFLQ PZ2wsjqFvZtGvv2/gX/4G6WfyjgpoPpH1q2+r5O2zFRThaXo3v5z772lFlZOFXA6bT7h/O xIMY+SzfdYqB9AP8A+u0Nj63vZwDfTXn9uwcZ/x+CC2Q6w/gNmcaiMcNgE4V3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737284797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c0Tz2iyF8qR0pMgsJDAL1gVHrxGv9j4WefojDMAYvvw=; b=kY9XmRI9nKGcyAPukJgx9h9kD5PL14Ls7D3qWC1H4YfdOjw8EiRMW2S+ldKf0/3RvPFgNh CVXGGjA9uwpsl15jP1J5WlYW7HA0jfPJhLNVs/dBcpo6l8mQZST0+g72e/DLNpSSU8xkEQ VRvQAFqgdLU+u9bePRQm2aAWF49+r5daTAvJaxq7BgQ586602x/1SBLCtYdYhgjp2as2// Alb7CFRjsrainYycw+5rG49B+3r2WGov+7/9KvhekSEqGhtpANsk3wI/7uoigHs4Uwssel 5DEHSLuII6x8xXCxggKdRhPaR8IVkeetERzkkzhOFoht/kr6BJ6YRNuzDBbFzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737284797; a=rsa-sha256; cv=none; b=M+/HHovboocZ6X+8JGmCY/soTQhsFXjv45oXVwgUB6DAJw3ndsX0fvcOfp9SL/N1tycBAV sle4/dTpksOOwWcQ32mbzXkaEVDLO+ff4EJ+07A9QcZoqlqaEFMU0JzlJKH1V3LjyvJ5dR 0MFMS5ekVgQQj33kQCXHKp82MLuhCuaPmHBkqJiqYbJYXOPV+9M45CeCqRYjBG8O1ckIuh y9wDTWFiQZDCOkLqVAH2nApsgHfbiAYmieihfXpP+wWVP9XvzMSa5jzqJZPtRscapwTH6I l840IUh16xqA19c5NmjRHFE/03LUqR9TN/OBvcKA3FAcob5YBpJ3+JWiwlDhDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbVz12gjyznqn; Sun, 19 Jan 2025 11:06: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 50JB6bCt027067; Sun, 19 Jan 2025 11:06:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JB6bPI027062; Sun, 19 Jan 2025 11:06:37 GMT (envelope-from git) Date: Sun, 19 Jan 2025 11:06:37 GMT Message-Id: <202501191106.50JB6bPI027062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2611bae42b7d - stable/13 - Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2611bae42b7d471bcf2c4826bf2ae37c27f983a8 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2611bae42b7d471bcf2c4826bf2ae37c27f983a8 commit 2611bae42b7d471bcf2c4826bf2ae37c27f983a8 Author: Dimitry Andric AuthorDate: 2025-01-16 20:04:36 +0000 Commit: Dimitry Andric CommitDate: 2025-01-19 11:06:03 +0000 Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. PR: 280562 MFC after: 3 days (cherry picked from commit 6c05f3a74f30934ee60919cc97e16ec69b542b06) --- contrib/llvm-project/clang/lib/Driver/Driver.cpp | 5 + .../clang/lib/Driver/ToolChains/Hexagon.cpp | 2 +- .../clang/lib/Format/UnwrappedLineParser.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 2 +- .../compiler-rt/lib/lsan/lsan_interceptors.cpp | 2 + contrib/llvm-project/libcxx/include/__config | 2 +- .../llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 2 +- .../CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 8 +- .../llvm-project/llvm/lib/MC/WasmObjectWriter.cpp | 111 +++++++++++++-------- .../lib/Target/Hexagon/HexagonISelLowering.cpp | 4 + .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 11 +- .../llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 7 ++ .../lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 17 ++-- .../llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td | 2 +- .../llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td | 5 +- .../AggressiveInstCombine.cpp | 3 +- .../lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 5 +- .../lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 +- lib/clang/include/VCSVersion.inc | 6 +- lib/clang/include/clang/Basic/Version.inc | 6 +- lib/clang/include/lld/Common/Version.inc | 2 +- lib/clang/include/lldb/Version/Version.inc | 6 +- lib/clang/include/llvm/Config/config.h | 4 +- lib/clang/include/llvm/Config/llvm-config.h | 4 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 25 files changed, 138 insertions(+), 87 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Driver/Driver.cpp b/contrib/llvm-project/clang/lib/Driver/Driver.cpp index ecae475f75da..f9dc8ab24fa9 100644 --- a/contrib/llvm-project/clang/lib/Driver/Driver.cpp +++ b/contrib/llvm-project/clang/lib/Driver/Driver.cpp @@ -6189,6 +6189,11 @@ std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const { if (auto P = SearchPaths(TC.getFilePaths())) return *P; + SmallString<128> R2(ResourceDir); + llvm::sys::path::append(R2, "..", "..", Name); + if (llvm::sys::fs::exists(Twine(R2))) + return std::string(R2); + return std::string(Name); } diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp index be7851adecea..76cedf312d68 100644 --- a/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp +++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/Hexagon.cpp @@ -379,9 +379,9 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA, if (NeedsXRayDeps) linkXRayRuntimeDeps(HTC, Args, CmdArgs); - CmdArgs.push_back("-lclang_rt.builtins-hexagon"); if (!Args.hasArg(options::OPT_nolibc)) CmdArgs.push_back("-lc"); + CmdArgs.push_back("-lclang_rt.builtins-hexagon"); } if (D.CCCIsCXX()) { if (HTC.ShouldLinkCXXStdlib(Args)) diff --git a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp index bfb592ae0749..e3fb976ee1cc 100644 --- a/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp +++ b/contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp @@ -512,7 +512,7 @@ void UnwrappedLineParser::calculateBraceTypes(bool ExpectClassBody) { break; do { NextTok = Tokens->getNextToken(); - } while (NextTok->NewlinesBefore == 0 && NextTok->isNot(tok::eof)); + } while (!NextTok->HasUnescapedNewline && NextTok->isNot(tok::eof)); while (NextTok->is(tok::comment)) NextTok = Tokens->getNextToken(); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp b/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp index 4e4f91de8cd5..18262993af28 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp @@ -11919,7 +11919,7 @@ bool Sema::isStdInitializerList(QualType Ty, QualType *Element) { if (TemplateClass->getIdentifier() != &PP.getIdentifierTable().get("initializer_list") || !getStdNamespace()->InEnclosingNamespaceSetOf( - TemplateClass->getDeclContext())) + TemplateClass->getNonTransparentDeclContext())) return false; // This is a template called std::initializer_list, but is it the right // template? diff --git a/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp b/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp index b569c337e976..efbf2fdfb0ab 100644 --- a/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp +++ b/contrib/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp @@ -77,6 +77,8 @@ INTERCEPTOR(void*, malloc, uptr size) { } INTERCEPTOR(void, free, void *p) { + if (UNLIKELY(!p)) + return; if (DlsymAlloc::PointerIsMine(p)) return DlsymAlloc::Free(p); ENSURE_LSAN_INITED; diff --git a/contrib/llvm-project/libcxx/include/__config b/contrib/llvm-project/libcxx/include/__config index 458910d6139e..8c83cb9abad0 100644 --- a/contrib/llvm-project/libcxx/include/__config +++ b/contrib/llvm-project/libcxx/include/__config @@ -27,7 +27,7 @@ // _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM. // Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is // defined to XXYYZZ. -# define _LIBCPP_VERSION 190105 +# define _LIBCPP_VERSION 190107 # define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y # define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h index d4e61c858890..d74896772bf5 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h @@ -838,7 +838,7 @@ private: SDValue ScalarizeVecRes_BUILD_VECTOR(SDNode *N); SDValue ScalarizeVecRes_EXTRACT_SUBVECTOR(SDNode *N); SDValue ScalarizeVecRes_FP_ROUND(SDNode *N); - SDValue ScalarizeVecRes_ExpOp(SDNode *N); + SDValue ScalarizeVecRes_UnaryOpWithExtraInput(SDNode *N); SDValue ScalarizeVecRes_INSERT_VECTOR_ELT(SDNode *N); SDValue ScalarizeVecRes_LOAD(LoadSDNode *N); SDValue ScalarizeVecRes_SCALAR_TO_VECTOR(SDNode *N); diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 92b62ccdc275..ea95aaef8a1e 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -58,7 +58,11 @@ void DAGTypeLegalizer::ScalarizeVectorResult(SDNode *N, unsigned ResNo) { case ISD::BUILD_VECTOR: R = ScalarizeVecRes_BUILD_VECTOR(N); break; case ISD::EXTRACT_SUBVECTOR: R = ScalarizeVecRes_EXTRACT_SUBVECTOR(N); break; case ISD::FP_ROUND: R = ScalarizeVecRes_FP_ROUND(N); break; - case ISD::FPOWI: R = ScalarizeVecRes_ExpOp(N); break; + case ISD::AssertZext: + case ISD::AssertSext: + case ISD::FPOWI: + R = ScalarizeVecRes_UnaryOpWithExtraInput(N); + break; case ISD::INSERT_VECTOR_ELT: R = ScalarizeVecRes_INSERT_VECTOR_ELT(N); break; case ISD::LOAD: R = ScalarizeVecRes_LOAD(cast(N));break; case ISD::SCALAR_TO_VECTOR: R = ScalarizeVecRes_SCALAR_TO_VECTOR(N); break; @@ -426,7 +430,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_FP_ROUND(SDNode *N) { N->getOperand(1)); } -SDValue DAGTypeLegalizer::ScalarizeVecRes_ExpOp(SDNode *N) { +SDValue DAGTypeLegalizer::ScalarizeVecRes_UnaryOpWithExtraInput(SDNode *N) { SDValue Op = GetScalarizedVector(N->getOperand(0)); return DAG.getNode(N->getOpcode(), SDLoc(N), Op.getValueType(), Op, N->getOperand(1)); diff --git a/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp b/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp index f25dc92fa235..852646924567 100644 --- a/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp +++ b/contrib/llvm-project/llvm/lib/MC/WasmObjectWriter.cpp @@ -1326,6 +1326,22 @@ static bool isInSymtab(const MCSymbolWasm &Sym) { return true; } +static bool isSectionReferenced(MCAssembler &Asm, MCSectionWasm &Section) { + StringRef SectionName = Section.getName(); + + for (const MCSymbol &S : Asm.symbols()) { + const auto &WS = static_cast(S); + if (WS.isData() && WS.isInSection()) { + auto &RefSection = static_cast(WS.getSection()); + if (RefSection.getName() == SectionName) { + return true; + } + } + } + + return false; +} + void WasmObjectWriter::prepareImports( SmallVectorImpl &Imports, MCAssembler &Asm) { // For now, always emit the memory import, since loads and stores are not @@ -1482,8 +1498,10 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm, LLVM_DEBUG(dbgs() << "Processing Section " << SectionName << " group " << Section.getGroup() << "\n";); - // .init_array sections are handled specially elsewhere. - if (SectionName.starts_with(".init_array")) + // .init_array sections are handled specially elsewhere, include them in + // data segments if and only if referenced by a symbol. + if (SectionName.starts_with(".init_array") && + !isSectionReferenced(Asm, Section)) continue; // Code is handled separately @@ -1853,49 +1871,54 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm, if (EmptyFrag.getKind() != MCFragment::FT_Data) report_fatal_error(".init_array section should be aligned"); - const MCFragment &AlignFrag = *EmptyFrag.getNext(); - if (AlignFrag.getKind() != MCFragment::FT_Align) - report_fatal_error(".init_array section should be aligned"); - if (cast(AlignFrag).getAlignment() != - Align(is64Bit() ? 8 : 4)) - report_fatal_error(".init_array section should be aligned for pointers"); - - const MCFragment &Frag = *AlignFrag.getNext(); - if (Frag.hasInstructions() || Frag.getKind() != MCFragment::FT_Data) - report_fatal_error("only data supported in .init_array section"); - - uint16_t Priority = UINT16_MAX; - unsigned PrefixLength = strlen(".init_array"); - if (WS.getName().size() > PrefixLength) { - if (WS.getName()[PrefixLength] != '.') + const MCFragment *nextFrag = EmptyFrag.getNext(); + while (nextFrag != nullptr) { + const MCFragment &AlignFrag = *nextFrag; + if (AlignFrag.getKind() != MCFragment::FT_Align) + report_fatal_error(".init_array section should be aligned"); + if (cast(AlignFrag).getAlignment() != + Align(is64Bit() ? 8 : 4)) report_fatal_error( - ".init_array section priority should start with '.'"); - if (WS.getName().substr(PrefixLength + 1).getAsInteger(10, Priority)) - report_fatal_error("invalid .init_array section priority"); - } - const auto &DataFrag = cast(Frag); - const SmallVectorImpl &Contents = DataFrag.getContents(); - for (const uint8_t * - P = (const uint8_t *)Contents.data(), - *End = (const uint8_t *)Contents.data() + Contents.size(); - P != End; ++P) { - if (*P != 0) - report_fatal_error("non-symbolic data in .init_array section"); - } - for (const MCFixup &Fixup : DataFrag.getFixups()) { - assert(Fixup.getKind() == - MCFixup::getKindForSize(is64Bit() ? 8 : 4, false)); - const MCExpr *Expr = Fixup.getValue(); - auto *SymRef = dyn_cast(Expr); - if (!SymRef) - report_fatal_error("fixups in .init_array should be symbol references"); - const auto &TargetSym = cast(SymRef->getSymbol()); - if (TargetSym.getIndex() == InvalidIndex) - report_fatal_error("symbols in .init_array should exist in symtab"); - if (!TargetSym.isFunction()) - report_fatal_error("symbols in .init_array should be for functions"); - InitFuncs.push_back( - std::make_pair(Priority, TargetSym.getIndex())); + ".init_array section should be aligned for pointers"); + + const MCFragment &Frag = *AlignFrag.getNext(); + nextFrag = Frag.getNext(); + if (Frag.hasInstructions() || Frag.getKind() != MCFragment::FT_Data) + report_fatal_error("only data supported in .init_array section"); + + uint16_t Priority = UINT16_MAX; + unsigned PrefixLength = strlen(".init_array"); + if (WS.getName().size() > PrefixLength) { + if (WS.getName()[PrefixLength] != '.') + report_fatal_error( + ".init_array section priority should start with '.'"); + if (WS.getName().substr(PrefixLength + 1).getAsInteger(10, Priority)) + report_fatal_error("invalid .init_array section priority"); + } + const auto &DataFrag = cast(Frag); + const SmallVectorImpl &Contents = DataFrag.getContents(); + for (const uint8_t * + P = (const uint8_t *)Contents.data(), + *End = (const uint8_t *)Contents.data() + Contents.size(); + P != End; ++P) { + if (*P != 0) + report_fatal_error("non-symbolic data in .init_array section"); + } + for (const MCFixup &Fixup : DataFrag.getFixups()) { + assert(Fixup.getKind() == + MCFixup::getKindForSize(is64Bit() ? 8 : 4, false)); + const MCExpr *Expr = Fixup.getValue(); + auto *SymRef = dyn_cast(Expr); + if (!SymRef) + report_fatal_error( + "fixups in .init_array should be symbol references"); + const auto &TargetSym = cast(SymRef->getSymbol()); + if (TargetSym.getIndex() == InvalidIndex) + report_fatal_error("symbols in .init_array should exist in symtab"); + if (!TargetSym.isFunction()) + report_fatal_error("symbols in .init_array should be for functions"); + InitFuncs.push_back(std::make_pair(Priority, TargetSym.getIndex())); + } } } diff --git a/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 7aeaebc584c6..995c5143e0a5 100644 --- a/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -3796,6 +3796,8 @@ EVT HexagonTargetLowering::getOptimalMemOpType( bool HexagonTargetLowering::allowsMemoryAccess( LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags, unsigned *Fast) const { + if (!VT.isSimple()) + return false; MVT SVT = VT.getSimpleVT(); if (Subtarget.isHVXVectorType(SVT, true)) return allowsHvxMemoryAccess(SVT, Flags, Fast); @@ -3806,6 +3808,8 @@ bool HexagonTargetLowering::allowsMemoryAccess( bool HexagonTargetLowering::allowsMisalignedMemoryAccesses( EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags, unsigned *Fast) const { + if (!VT.isSimple()) + return false; MVT SVT = VT.getSimpleVT(); if (Subtarget.isHVXVectorType(SVT, true)) return allowsHvxMisalignedMemoryAccesses(SVT, Flags, Fast); diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 823fb428472e..badbb4259974 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -1396,8 +1396,9 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine &TM, } // Custom-legalize bitcasts from fixed-length vectors to scalar types. - setOperationAction(ISD::BITCAST, {MVT::i8, MVT::i16, MVT::i32, MVT::i64}, - Custom); + setOperationAction(ISD::BITCAST, {MVT::i8, MVT::i16, MVT::i32}, Custom); + if (Subtarget.is64Bit()) + setOperationAction(ISD::BITCAST, MVT::i64, Custom); if (Subtarget.hasStdExtZfhminOrZhinxmin()) setOperationAction(ISD::BITCAST, MVT::f16, Custom); if (Subtarget.hasStdExtFOrZfinx()) @@ -6317,7 +6318,8 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op, DAG.getNode(RISCVISD::FMV_W_X_RV64, DL, MVT::f32, NewOp0); return FPConv; } - if (VT == MVT::f64 && Op0VT == MVT::i64 && XLenVT == MVT::i32) { + if (VT == MVT::f64 && Op0VT == MVT::i64 && !Subtarget.is64Bit() && + Subtarget.hasStdExtDOrZdinx()) { SDValue Lo, Hi; std::tie(Lo, Hi) = DAG.SplitScalar(Op0, DL, MVT::i32, MVT::i32); SDValue RetReg = @@ -12616,7 +12618,8 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N, SDValue FPConv = DAG.getNode(RISCVISD::FMV_X_ANYEXTW_RV64, DL, MVT::i64, Op0); Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, FPConv)); - } else if (VT == MVT::i64 && Op0VT == MVT::f64 && XLenVT == MVT::i32) { + } else if (VT == MVT::i64 && Op0VT == MVT::f64 && !Subtarget.is64Bit() && + Subtarget.hasStdExtDOrZdinx()) { SDValue NewReg = DAG.getNode(RISCVISD::SplitF64, DL, DAG.getVTList(MVT::i32, MVT::i32), Op0); SDValue RetReg = DAG.getNode(ISD::BUILD_PAIR, DL, MVT::i64, diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp index 6c0cbeadebf4..7f4bbe786108 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -2536,6 +2536,13 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI, } } + if (int Idx = RISCVII::getFRMOpNum(Desc); + Idx >= 0 && MI.getOperand(Idx).getImm() == RISCVFPRndMode::DYN && + !MI.readsRegister(RISCV::FRM, /*TRI=*/nullptr)) { + ErrInfo = "dynamic rounding mode should read FRM"; + return false; + } + return true; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td index b860273d639e..93fd0b2aada3 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -6471,7 +6471,7 @@ defm PseudoVFRDIV : VPseudoVFRDIV_VF_RM; //===----------------------------------------------------------------------===// // 13.5. Vector Widening Floating-Point Multiply //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in { +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFWMUL : VPseudoVWMUL_VV_VF_RM; } @@ -6504,7 +6504,7 @@ defm PseudoVFWMACCBF16 : VPseudoVWMAC_VV_VF_BF_RM; //===----------------------------------------------------------------------===// // 13.8. Vector Floating-Point Square-Root Instruction //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in defm PseudoVFSQRT : VPseudoVSQR_V_RM; //===----------------------------------------------------------------------===// @@ -6516,7 +6516,7 @@ defm PseudoVFRSQRT7 : VPseudoVRCP_V; //===----------------------------------------------------------------------===// // 13.10. Vector Floating-Point Reciprocal Estimate Instruction //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, hasSideEffects = 0 in +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in defm PseudoVFREC7 : VPseudoVRCP_V_RM; //===----------------------------------------------------------------------===// @@ -6627,9 +6627,10 @@ defm PseudoVFNCVT_F_X : VPseudoVNCVTF_W_RM; defm PseudoVFNCVT_RM_F_XU : VPseudoVNCVTF_RM_W; defm PseudoVFNCVT_RM_F_X : VPseudoVNCVTF_RM_W; -let hasSideEffects = 0, hasPostISelHook = 1 in +let hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFNCVT_F_F : VPseudoVNCVTD_W_RM; defm PseudoVFNCVTBF16_F_F : VPseudoVNCVTD_W_RM; +} defm PseudoVFNCVT_ROD_F_F : VPseudoVNCVTD_W; } // mayRaiseFPException = true @@ -6665,8 +6666,7 @@ let Predicates = [HasVInstructionsAnyF] in { //===----------------------------------------------------------------------===// // 14.3. Vector Single-Width Floating-Point Reduction Instructions //===----------------------------------------------------------------------===// -let mayRaiseFPException = true, - hasSideEffects = 0 in { +let mayRaiseFPException = true, hasSideEffects = 0, hasPostISelHook = 1 in { defm PseudoVFREDOSUM : VPseudoVFREDO_VS_RM; defm PseudoVFREDUSUM : VPseudoVFRED_VS_RM; } @@ -6678,9 +6678,8 @@ defm PseudoVFREDMAX : VPseudoVFREDMINMAX_VS; //===----------------------------------------------------------------------===// // 14.4. Vector Widening Floating-Point Reduction Instructions //===----------------------------------------------------------------------===// -let IsRVVWideningReduction = 1, - hasSideEffects = 0, - mayRaiseFPException = true in { +let IsRVVWideningReduction = 1, hasSideEffects = 0, mayRaiseFPException = true, + hasPostISelHook = 1 in { defm PseudoVFWREDUSUM : VPseudoVFWRED_VS_RM; defm PseudoVFWREDOSUM : VPseudoVFWREDO_VS_RM; } diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td index 3bd6da286828..994859817014 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td @@ -694,7 +694,7 @@ let Predicates = [HasVendorXCVmem, IsRV32], AddedComplexity = 1 in { def : CVStriPat; def : CVStrriPat; - def : CVStrriPat; + def : CVStrriPat; def : CVStrriPat; def : CVStrrPat; diff --git a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td index 71aa1f19e089..eacc75b9a6c4 100644 --- a/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td +++ b/contrib/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td @@ -217,7 +217,8 @@ let Predicates = [HasVendorXSfvfwmaccqqq], DecoderNamespace = "XSfvfwmaccqqq" in def VFWMACC_4x4x4 : CustomSiFiveVMACC<0b111100, OPFVV, "sf.vfwmacc.4x4x4">; } -let Predicates = [HasVendorXSfvfnrclipxfqf], DecoderNamespace = "XSfvfnrclipxfqf" in { +let Predicates = [HasVendorXSfvfnrclipxfqf], DecoderNamespace = "XSfvfnrclipxfqf", + Uses = [FRM] in { def VFNRCLIP_XU_F_QF : CustomSiFiveVFNRCLIP<0b100010, OPFVF, "sf.vfnrclip.xu.f.qf">; def VFNRCLIP_X_F_QF : CustomSiFiveVFNRCLIP<0b100011, OPFVF, "sf.vfnrclip.x.f.qf">; } @@ -399,7 +400,7 @@ multiclass VPseudoSiFiveVFWMACC { multiclass VPseudoSiFiveVFNRCLIP { foreach i = 0-4 in - let hasSideEffects = 0 in + let hasSideEffects = 0, hasPostISelHook = 1 in defm "Pseudo" # NAME : VPseudoBinaryRoundingModegetType()), 0); Load1Ptr = Load1Ptr->stripAndAccumulateConstantOffsets( DL, Offset1, /* AllowNonInbounds */ true); - Load1Ptr = Builder.CreatePtrAdd(Load1Ptr, - Builder.getInt32(Offset1.getZExtValue())); + Load1Ptr = Builder.CreatePtrAdd(Load1Ptr, Builder.getInt(Offset1)); } // Generate wider load. NewLoad = Builder.CreateAlignedLoad(WiderType, Load1Ptr, LI1->getAlign(), diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index c235d2fb2a5b..f99f4487c554 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -1249,8 +1249,9 @@ static BasicBlock *buildClonedLoopBlocks( assert(VMap.lookup(&I) == &ClonedI && "Mismatch in the value map!"); // Forget SCEVs based on exit phis in case SCEV looked through the phi. - if (SE && isa(I)) - SE->forgetValue(&I); + if (SE) + if (auto *PN = dyn_cast(&I)) + SE->forgetLcssaPhiWithNewPredecessor(&L, PN); BasicBlock::iterator InsertPt = MergeBB->getFirstInsertionPt(); diff --git a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 746ba51a981f..fd08d5d9d755 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -18596,8 +18596,11 @@ bool SLPVectorizerPass::vectorizeCmpInsts(iterator_range CmpInsts, if (R.isDeleted(I)) continue; for (Value *Op : I->operands()) - if (auto *RootOp = dyn_cast(Op)) + if (auto *RootOp = dyn_cast(Op)) { Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R, TTI); + if (R.isDeleted(I)) + break; + } } // Try to vectorize operands as vector bundles. for (CmpInst *I : CmpInsts) { diff --git a/lib/clang/include/VCSVersion.inc b/lib/clang/include/VCSVersion.inc index 7624a2e4b17a..a18ba351aaab 100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@ -1,8 +1,8 @@ -#define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define CLANG_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define CLANG_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git" -#define LLDB_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLDB_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git" diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 5104f9d7ad7a..92e55f9316cf 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -1,8 +1,8 @@ -#define CLANG_VERSION 19.1.5 -#define CLANG_VERSION_STRING "19.1.5" +#define CLANG_VERSION 19.1.7 +#define CLANG_VERSION_STRING "19.1.7" #define CLANG_VERSION_MAJOR 19 #define CLANG_VERSION_MAJOR_STRING "19" #define CLANG_VERSION_MINOR 1 -#define CLANG_VERSION_PATCHLEVEL 5 +#define CLANG_VERSION_PATCHLEVEL 7 #define CLANG_VENDOR "FreeBSD " diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 6cf430b53591..ef16a34f470a 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style #define LLD_FREEBSD_VERSION 1400007 -#define LLD_VERSION_STRING "19.1.5 (FreeBSD llvmorg-19.1.5-0-gab4b5a2db582-" __XSTRING(LLD_FREEBSD_VERSION) ")" +#define LLD_VERSION_STRING "19.1.7 (FreeBSD llvmorg-19.1.7-0-gcd708029e0b2-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/lib/clang/include/lldb/Version/Version.inc b/lib/clang/include/lldb/Version/Version.inc index 5aa1f29215b4..02d44970ff54 100644 --- a/lib/clang/include/lldb/Version/Version.inc +++ b/lib/clang/include/lldb/Version/Version.inc @@ -1,6 +1,6 @@ -#define LLDB_VERSION 19.1.5 -#define LLDB_VERSION_STRING "19.1.5" +#define LLDB_VERSION 19.1.7 +#define LLDB_VERSION_STRING "19.1.7" #define LLDB_VERSION_MAJOR 19 #define LLDB_VERSION_MINOR 1 -#define LLDB_VERSION_PATCH 5 +#define LLDB_VERSION_PATCH 7 /* #undef LLDB_FULL_VERSION_STRING */ diff --git a/lib/clang/include/llvm/Config/config.h b/lib/clang/include/llvm/Config/config.h index f86e4b6b5946..1968fb5072c9 100644 --- a/lib/clang/include/llvm/Config/config.h +++ b/lib/clang/include/llvm/Config/config.h @@ -338,10 +338,10 @@ #define PACKAGE_NAME "LLVM" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LLVM 19.1.5" +#define PACKAGE_STRING "LLVM 19.1.7" /* Define to the version of this package. */ -#define PACKAGE_VERSION "19.1.5" +#define PACKAGE_VERSION "19.1.7" /* Define to the vendor of this package. */ /* #undef PACKAGE_VENDOR */ diff --git a/lib/clang/include/llvm/Config/llvm-config.h b/lib/clang/include/llvm/Config/llvm-config.h index 966249436723..4ca2d0083398 100644 --- a/lib/clang/include/llvm/Config/llvm-config.h +++ b/lib/clang/include/llvm/Config/llvm-config.h @@ -176,10 +176,10 @@ #define LLVM_VERSION_MINOR 1 /* Patch version of the LLVM API */ -#define LLVM_VERSION_PATCH 5 +#define LLVM_VERSION_PATCH 7 /* LLVM version string */ -#define LLVM_VERSION_STRING "19.1.5" +#define LLVM_VERSION_STRING "19.1.7" /* Whether LLVM records statistics for use with GetStatistics(), * PrintStatistics() or PrintStatisticsJSON() diff --git a/lib/clang/include/llvm/Support/VCSRevision.h b/lib/clang/include/llvm/Support/VCSRevision.h index db3347a0e5a5..76aa3f075586 100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@ -1,2 +1,2 @@ -#define LLVM_REVISION "llvmorg-19.1.5-0-gab4b5a2db582" +#define LLVM_REVISION "llvmorg-19.1.7-0-gcd708029e0b2" #define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git" From nobody Sun Jan 19 13:32:19 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbZC724j5z5lFW4; Sun, 19 Jan 2025 13:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbZC71P7Tz3Rj8; Sun, 19 Jan 2025 13:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737293539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3irkfsldD8M2A8H/HD3F4RDldiC8o/t4lDn/7+mRyI=; b=ZdFFpH79vdwKmIlsz+77kaNF6K2NEbc0ODzlAea9vO3SczINskT++tbS36m24uj1hqY8mT 6B24kc4eOOdzosiGcMdtFUXmxwxFWLDbkRYycBFqXX1zkZD8EB4Wgkktwy+5R8mNLmOeuS SRDiOzWV71Ge7spLZreYudjzP/Zr2oBOEJ6SXe1P1ttNd9PrdAf2OyzV57R9qB2PNZsZk5 bM9ujBwRxDaaQ9GdO/wn0oRhV20PnUuN79bfCgurxTXetKNIxwGq3XxJPMxGDqwhhHIUv/ 4ftEwtUWZiYG1Fy1dd6juyT10mJ6aNe6DZobuXwJl8NfBALop7edzbacaLbkSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737293539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J3irkfsldD8M2A8H/HD3F4RDldiC8o/t4lDn/7+mRyI=; b=xs6utp00+nvFG3VsJ7xo7cp+9BLUXVX6wS4oqGJGci6SJHnt9XxkpUWEZ+A87nrV+5tLeZ i0UQYxwCIDOyrXBeANmtYo/k+P4zKWnluzycIxrkb9lfOtuplTZnY+eGFvRoFC2F2M8OA6 KrZQ8YGIPQK3L5ZkCDi7rxwWKNNGFPSZS/OGCR20YzjS6GHHb1ylGjlHuelZ84NYzuaMFc XzeU19BCyEIy2nLQRPcdnpSRu2gnXb7rl0c6COHJc/uLpGMMEnp6vuZzUZcYbh1KPr4GTj zgABN97sr8Qp/HZLd856xesWSIO374ONefGEt9OYpTWtZQGepAH82xgF3U6euA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737293539; a=rsa-sha256; cv=none; b=B2Nezd+HApP167NoqqAe99EFLo+h0N9DJol71Bq5+vSNp/XSIs5hkb+toUHFxMAUzJJudd uR+M2uyxf0JEzlPXoiLp24wITgvQuBEP8N1SbFZ2akDhe5TP89OwC5Y6MPl4dJQEETkq8l C7AfEFLOX7hEIxri/u7Q7SeEbOB4J3j2ibuoOzuNEQR9AyP4QK5v23byOWPBpGP7NyA3Nj dLtgMH7Np+1FenFhbDTrXj1dmLe0125AZ69asi+tlOl/pDtareAxzKmDuIZ5l+rW9H/D2e 5AkRq2/ttZddMHo6IL2alqGNgx72wS73Le9W4sXyrbVex8NFHgmISyVyCokTPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbZC70rf9zsSm; Sun, 19 Jan 2025 13:32: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 50JDWJEw005319; Sun, 19 Jan 2025 13:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JDWJ9T005316; Sun, 19 Jan 2025 13:32:19 GMT (envelope-from git) Date: Sun, 19 Jan 2025 13:32:19 GMT Message-Id: <202501191332.50JDWJ9T005316@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: f5cf173de0dc - main - kill.1: mention special PID 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5cf173de0dc62dbf47a8bbdcae28aac947d90a6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5cf173de0dc62dbf47a8bbdcae28aac947d90a6 commit f5cf173de0dc62dbf47a8bbdcae28aac947d90a6 Author: artembunichev AuthorDate: 2025-01-19 12:49:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-19 13:29:27 +0000 kill.1: mention special PID 0 PR: 284158 MFC after: 3 days --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index ce9cb06382f8..02357ff60c19 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -79,6 +79,9 @@ of the default .Pp The following PIDs have special meanings: .Bl -tag -width indent +.It 0 +The signal is sent to all processes whose group ID is equal to the process +group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. From nobody Sun Jan 19 13:32:20 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbZC85rzVz5lFW7; Sun, 19 Jan 2025 13:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbZC82H7zz3RLj; Sun, 19 Jan 2025 13:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737293540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F61vXgNBpxUJOm6QHuwHKwnnlgbCC7YLY04WdX4TBb8=; b=gpgd5dOVxEs6dhUZWm0pDC+qdVAtVLahl4/P8qvPOGBvKZxTuLc8fnbmbaM+2tbvGPMLGS m1zv4NoJ98LDM8YbRThi53NdL3+tQ0kT89DSx9zqeFrydeX0N9ZSK3/o/AvzJDdMFntLrP NBIDr3SaVsYRYs/MpONp2zK8SMfTzwKfVMlI8j+44v7F9bzXwi44nxkLWqvFoDflQCmy+h wkI5DjOusDmd+7c4CkNyNV7ismsCrcXz+umDkmg5BAr365U4yBxwsD42Gf2NcwrhYYkfCr h/yJd3f6A3N0ZDcsMJzy1j2Iom7YWgeQ0exDxI24Sya72Dv1FODdsznlR2kHqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737293540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F61vXgNBpxUJOm6QHuwHKwnnlgbCC7YLY04WdX4TBb8=; b=ppA0shYuwQP+6mPCzh8XGnWIJkEbICAbab3zSWsrE1HysnvVACyUDdNet4pALxKx4ga9CJ dPSJKYAhImz4/Vjysyd0ZeI4e4m0c1tVJn0ViUR027JF/eQNJ2btKKTQ0tk+L8Ul2dThVB 7Kj2iv6XRlTMwkeliZVUnXEoUqrBe6nBpsXOnRsVaHUKDLWTHKuFFNgpoTMhxQClId9kNL 35IZqsx/LLgvwsp2+E9W6HjUMZiYx0o5B/DQHTovRqTwwPzl1s58X9zF+eEY/gIaeK9brR +4w1TlKxyXWhlnv8bB+A43DERnKf8opnjMJYcE2p/sVwV9zEvHzicHdyeYsfog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737293540; a=rsa-sha256; cv=none; b=w6NeRMlTn+lbSdPz20dDTPrsUZxEOFRdoSkTFBUqjtHeO1TRk7UyDT+ymE9p0dAcHSHNTc UBgTleaBajMP5ny+Mcp3FBCjJwxLTevEyw7X0/OxbCBl6wiEDQU3g5zkStRSv8GS9iFNw+ hc+DovmcoY/fKt++71KuwSp5DpuiiaqYJbp3ou8qR5r57yY71KoXqfh8a5yn4s6uTFkv2w p2rWyT68gZEx46+3o+B+iY78eIlZ8sdOEC4lCV76NIIe4YlubcV/jXAJiPv9FSPl7kELLc cOBNeoOmFTTi6wX1e5mIo8cPmbkTjOfQhTCObW5mz532dpIJVTR0PNwGM+7ECA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbZC81qWDzrwb; Sun, 19 Jan 2025 13:32: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 50JDWKEb005353; Sun, 19 Jan 2025 13:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JDWKUQ005350; Sun, 19 Jan 2025 13:32:20 GMT (envelope-from git) Date: Sun, 19 Jan 2025 13:32:20 GMT Message-Id: <202501191332.50JDWKUQ005350@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: d6c2d4fe975c - main - kill.1: mention special meaning of PGID as a PID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6c2d4fe975c70975bdc6bec76d044408f6dcb8c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6c2d4fe975c70975bdc6bec76d044408f6dcb8c commit d6c2d4fe975c70975bdc6bec76d044408f6dcb8c Author: artembunichev AuthorDate: 2025-01-19 12:58:55 +0000 Commit: Konstantin Belousov CommitDate: 2025-01-19 13:31:36 +0000 kill.1: mention special meaning of PGID as a PID PR: 284158 MFC after: 3 days --- bin/kill/kill.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/kill/kill.1 b/bin/kill/kill.1 index 02357ff60c19..003d09f09339 100644 --- a/bin/kill/kill.1 +++ b/bin/kill/kill.1 @@ -85,6 +85,9 @@ group ID of the sender, and for which the process has permission. .It -1 If superuser, broadcast the signal to all processes; otherwise broadcast to all processes belonging to the user. +.It - Ns Ar PGID +The signal is sent to all processes that belong to the specified +process group ID (PGID). .El .Pp Some of the more commonly used signals: From nobody Sun Jan 19 16:18:17 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybdtd3ySnz5lQtT; Sun, 19 Jan 2025 16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybdtd3NfDz3hjl; Sun, 19 Jan 2025 16: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=1737303497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wH1J/laaCzZiHMRJOXLQuJ7dgUGQo7tqcNriSuTYadM=; b=R4cgBT2DAAdMqUj3uv/Q4SQJ7baaUbZSfuGcgVG5Ch6FNC40+WYzR5XyXLrKwDhxpWRYox pUI0P2t8GzdbKv/3i2wGnBnJQOg/MNwmOJBtbLcBiW5abQtrba6/B1p8qUjPliSOBm0qt7 24QDSGCxtJlH07tSvR5XpS9PO5cxpBK/3TbIWBXY2pln7MNb7djkkJ55o8TooIXm7JGVvy RdxwaoamgG947X9PTbW38ZZlcjyXSHEKlmLNm7UN+IT7O9f0a6rawCko87BEOYFvUbrUly r9Q97QgABd45zo8oLyo1aL/RL/ItHq2vKDQLj/F0cCrFNfRO9WPFlOqstIyg6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737303497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wH1J/laaCzZiHMRJOXLQuJ7dgUGQo7tqcNriSuTYadM=; b=COAnRO+1jLkPPaR0hskzsWg4sQzMk29pkGOSKubQuXVSxXGXP7N0iXYuCjJcjMIo0GHBW7 inppZSDPVaHIEX/Xagu8ZwLwJAoWYCK1fHH7o6uQ5t4VtuWE3A0VUMwwHfTygVP9XPOAQs OJ+4EDWRnz0hWW1yXKid4WmB/jckxZNTC2pYNNHFp8s5CW/GQ+g+kWfsgwkGW23G19Lp9F oIuIVM9l53psT/RyKmiYenJWieMLrFCR2EDMtvzx7bZXocUNUaStm5rUqq1vyS00Onk0Ac ZPoz7h30RgMSUfjqLqVIW7ePljhyUK1f2YDgiJ1XdGuk9NM+NnoP7cn74GRuCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737303497; a=rsa-sha256; cv=none; b=IKcRP+DC9FOnRGtDAd0GGGAdbtkkjVjI49n8LPcKmc16oYyhcLc4Q+Tzy8x4N6bq0yuLBC UvKdRsEdpCn96hNdGdyWOqpeY8W0FDqI1bS3jMA8AbCqpG+VQlK6WfYNghOQmFGTTyF0F7 zxGQ+Im8u53/sI6LQKdoJbomRLY5hqh6fDL6VZk3r09DCWnDYGrV+ewY5kA8COJoG3IirX tuUzQmBAqFY2hPR+2Nskj8q7nzs7a3Q/vH8hmRf4rSotnQ0f03dfsPuKCmLCb4MXE4N3LG fUtDZK3VZwEQOemW5Gzg0MWMSe/EKT8stoV+G0bTeI8EJcOeXtojBYKOpFe7ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybdtd2hVwzxS9; Sun, 19 Jan 2025 16: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 50JGIHYW005683; Sun, 19 Jan 2025 16: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 50JGIH1I005680; Sun, 19 Jan 2025 16:18:17 GMT (envelope-from git) Date: Sun, 19 Jan 2025 16:18:17 GMT Message-Id: <202501191618.50JGIH1I005680@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: c5056a3931b4 - main - getentropy tests: Update after commit 473681a1a506da List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5056a3931b41a803a24b89400d38d5c5f843612 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c5056a3931b41a803a24b89400d38d5c5f843612 commit c5056a3931b41a803a24b89400d38d5c5f843612 Author: Mark Johnston AuthorDate: 2025-01-19 16:17:05 +0000 Commit: Mark Johnston CommitDate: 2025-01-19 16:17:05 +0000 getentropy tests: Update after commit 473681a1a506da - Use GETENTROPY_MAX instead of hard-coding the value. - Check for EINVAL instead of EIO Fixes: 473681a1a506 ("libc: Fix getentropy POSIX 2024 conformance issues") --- lib/libc/tests/gen/getentropy_test.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libc/tests/gen/getentropy_test.c b/lib/libc/tests/gen/getentropy_test.c index 156d3a94a7de..6ac9d5678ea6 100644 --- a/lib/libc/tests/gen/getentropy_test.c +++ b/lib/libc/tests/gen/getentropy_test.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -62,13 +63,13 @@ ATF_TC_BODY(getentropy_sizes, tc) char buf[512]; ATF_REQUIRE_EQ(getentropy(buf, sizeof(buf)), -1); - ATF_REQUIRE_EQ(errno, EIO); - ATF_REQUIRE_EQ(getentropy(buf, 257), -1); - ATF_REQUIRE_EQ(errno, EIO); + ATF_REQUIRE_EQ(errno, EINVAL); + ATF_REQUIRE_EQ(getentropy(buf, GETENTROPY_MAX + 1), -1); + ATF_REQUIRE_EQ(errno, EINVAL); /* Smaller sizes always succeed: */ - ATF_REQUIRE_EQ(getentropy(buf, 256), 0); - ATF_REQUIRE_EQ(getentropy(buf, 128), 0); + ATF_REQUIRE_EQ(getentropy(buf, GETENTROPY_MAX), 0); + ATF_REQUIRE_EQ(getentropy(buf, GETENTROPY_MAX / 2), 0); ATF_REQUIRE_EQ(getentropy(buf, 0), 0); } From nobody Sun Jan 19 17:00:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YbfqW0HXcz5lTJZ; Sun, 19 Jan 2025 17:00:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YbfqV6ckqz3nY9; Sun, 19 Jan 2025 17:00:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737306039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljo761V8ZJlioZoXJ2hIeJU/7D2W/H7C9YrcoMaugC0=; b=iMmwW+Y8Hr+n4QM2crJuz2Vm0BrK82GGbyqLMR86yIDkF7Dqa9AVyCbi9gdaywrT6XqV6v ctx7nbT22NzeZdRObAY0Cg7WDFiUUBg0TXpRAWCCAV5Zga6a1o9vS5vXj5b0ih90uOdPok FsQXwn4bNPEEV0uXS0q0OOFRokRC5kPnCFgeB0TcTFn8bNeKQxeCNYGvEZwGaekvUv9bio mJbQ5G0Nl+zmR14irVirDnoqlDUe5pBpMQXa6YfPNyblFViEgfNXdRocJka/StSIX3HUcg GuPoyEADHSqPUHLBi6svese1pW4eC5iOCfunL9k7tLq6tEVycNPcHimTAUIwBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737306039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljo761V8ZJlioZoXJ2hIeJU/7D2W/H7C9YrcoMaugC0=; b=G9V94nQ/g2RQR1jqnZrx19P4TStc0GcnKPyf2wdOCDfX3+Wygcz10399O6/H/7IfGhNQTv RTlg29VXbfOU3Chjm9v9PSlQ/CqOk5vNE2DT00KlfyUKujIbhpFd/JWqLhc7EGTPdsbCGo 64HXFDRybYCrdRVXJnKHzVc57iNch6Q51m9IIbnVD8e9UTZOO2HNEG9BB4OhIQoPt4vXwD 29qJTchyEyp6smB1742Fjz6EPSUiFE/7aiGfbvX5UDkt/1m0GiNMsW5PTU8aPdl3s3VqdJ aOlKeI7jHgFM/SUytVuYrGlLMWFZrV1jqzrSwAHTpafGpBzlFNTCPPUe4+kLtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737306039; a=rsa-sha256; cv=none; b=CiYgLCy0JsguyEAN+z6bjxyKpO4PYD8LKLqO9Jvl9VD5WdkcUD63TYV+yOfdHKgFoVESpF HExpamm53oA8n8Bh6zhPiIgKR3DZ45/pkCiU2Q1X607fa4vGYzZec4gXXq0u4ZU3aDG0pE w4Jmona5jMrOjr9ZI12aCsCyqVPWnw23hhwrJFCAoO+uiM6cSpwM+ByjIqbJwpHUCwYVqG R6AB6VtYK2DztNA8k3tT2b0RKplZ0fkrQ2i7sptD9MT8Jz6aruwcWaWHWoq8UF4JiuguU2 Ym7IV13Rwm0YqSZ3TuI37YhsWoGXOFWkY8o682zH/pUq/m0ArJ5kIIF4PpKgtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YbfqV69yNzyVM; Sun, 19 Jan 2025 17:00: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 50JH0cIW090475; Sun, 19 Jan 2025 17:00:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JH0c9a090472; Sun, 19 Jan 2025 17:00:38 GMT (envelope-from git) Date: Sun, 19 Jan 2025 17:00:38 GMT Message-Id: <202501191700.50JH0c9a090472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: David Bright Subject: git: 2f35419fb26d - main - stand/efihttp: Add device type check to efihttp_fs_open() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dab X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f35419fb26d1e45850696a8e732a12874bc1078 Auto-Submitted: auto-generated The branch main has been updated by dab: URL: https://cgit.FreeBSD.org/src/commit/?id=2f35419fb26d1e45850696a8e732a12874bc1078 commit 2f35419fb26d1e45850696a8e732a12874bc1078 Author: Yongbo Yao AuthorDate: 2025-01-19 16:50:18 +0000 Commit: David Bright CommitDate: 2025-01-19 17:00:26 +0000 stand/efihttp: Add device type check to efihttp_fs_open() Ensure the open operation targets an HTTP device. Return EINVAL if not, to prevent potential system crashes when used on other devices. Differential Revision: https://reviews.freebsd.org/D48439 Reviewed by: dab, imp, vangyzen Sponsored by: Dell Technologies --- stand/efi/libefi/efihttp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/libefi/efihttp.c b/stand/efi/libefi/efihttp.c index bcc0f7e4d79e..fd0ed744047c 100644 --- a/stand/efi/libefi/efihttp.c +++ b/stand/efi/libefi/efihttp.c @@ -565,6 +565,8 @@ efihttp_fs_open(const char *path, struct open_file *f) if (!efihttp_init_done) return (ENXIO); + if (f->f_dev != &efihttp_dev) + return (EINVAL); /* * If any path fails to open, try with a trailing slash in * case it's a directory. From nobody Sun Jan 19 19:31:47 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybk9v6cDfz5lcjw; Sun, 19 Jan 2025 19:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybk9v5TTKz40Xy; Sun, 19 Jan 2025 19:31:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737315107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=orbfZUCUSuFLDjWfA4b6LJOlq2YuUNdiaEKQaRTFxMw=; b=OGwT/HWidIrK1eIM0qpXARtsjtyt1pCctwq4fOxEY+T9KnDD6RrYqnE05uewUg4BetRht+ TXG+Ke5J+xk7Unv8CVR3NKV3uSM2es+Waco7VJW/85HpDdWpCooI+Eclhj44nG3aMrRscf IPiK8vRQ2RR+QzjfGTl3l1lBxxGNegNy98gPtCeJjKeja36TS2ubbyzPPVQPI2OoOcfLO8 nVy74yYw8inDbq5ZoCAsnqjvmaNoTby3rBl5DnRxO0LA7TeYAgP7+HbAD/eYPVNxM+qa7+ 0c1CCpWff97wj01S8Lnb5fUDRf0QdVw9LWz+OQA3+CSxAkdNEZ6y8T7ySX8NgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737315107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=orbfZUCUSuFLDjWfA4b6LJOlq2YuUNdiaEKQaRTFxMw=; b=Bu0+2Sn66Cm766iVA01mSVEFQ+t3TeGkcsZVx/00KQcCVBJXh18YPKm6SBB0Xi4P25kMi1 9FHFV4eH+XDPE5wum/R6husUzf71i33Qq/TVojIfSzoRDxk6Y634stKy9s1+TjB0uqleXV tE2Z21M0218mPtvRlPPs9aS0iconPDq/ee2gKIYK5J16fUqMLKbqTiEoOZxsmFG/2dVAbe K61br1U6oDxuDI5EsQcuAv5uB6V5iq42UJlvCes+T19zyMYvW6x/Duq/LFHJVgLKV1pL0x b3+v/P1iXJQriSiVw+RBEaaCpDu7PJfm+VgC1a3XiK3KY2otbgcAJ1TPijUX8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737315107; a=rsa-sha256; cv=none; b=yi1eyatdtnd1y6hFNJuSnLzlBWnESV5JMi+rEd1+vcDzeTHONolqNVAxe8OiVWFyxVX+r0 7jw0RqZg0DNCpcgWKwYzTijetEwHYq1U+PL0AbxyIW/6stsI8F/ufqpzuv0cxnpv3kZa11 ahLLOpa6akeRlY4TobzpPquRbnDSFPa1qmt9G1UMNjsbSvD/6rRbQhgU0Mb96ohNlwo34S 5LrVhz9uIv9XVha0ZvYMufzTSDdNWzMqX/f85HeorxoQlnwn0523LBYZsVzEaS1GaI460h /ntALv6IsTldWGy5rC26uJQWhapY+K5GNXr3WJiA6m3dVCIXb+DAxj7l/BanrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybk9v52Xsz13Lq; Sun, 19 Jan 2025 19:31: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 50JJVlp9075564; Sun, 19 Jan 2025 19:31:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JJVled075561; Sun, 19 Jan 2025 19:31:47 GMT (envelope-from git) Date: Sun, 19 Jan 2025 19:31:47 GMT Message-Id: <202501191931.50JJVled075561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f31dbc1c2dc5 - stable/14 - timeout(1): Add -v/--verbose option to show diagnosis info List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f31dbc1c2dc54d1006186bca137b1c4ed2169f91 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f31dbc1c2dc54d1006186bca137b1c4ed2169f91 commit f31dbc1c2dc54d1006186bca137b1c4ed2169f91 Author: Gordon Bergling AuthorDate: 2025-01-04 08:52:56 +0000 Commit: Gordon Bergling CommitDate: 2025-01-19 19:30:13 +0000 timeout(1): Add -v/--verbose option to show diagnosis info The -v/--verbose option enables this utility to show diagnosis info to stderr about any signal sent on timeout. This implementation refers to GNU coreutils's timeout(1). Reviewed by: bapt, Alexander Ziaee (manpages) Approved by: bapt (src) Obtained from: DragonFlyBSD Differential Revision: https://reviews.freebsd.org/D48225 (cherry picked from commit d633a7d12105a54551622882f4eee80a13a1445a) --- bin/timeout/timeout.1 | 6 ++++-- bin/timeout/timeout.c | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index b8ec3030b271..1a5fd95a6256 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 28, 2024 +.Dd January 4, 2025 .Dt TIMEOUT 1 .Os .Sh NAME @@ -34,7 +34,7 @@ .Nm .Op Fl k Ar time | Fl -kill-after Ar time .Op Fl s Ar sig | Fl -signal Ar sig -.Op Fl -kill-after Ar time | Fl k Ar time +.Op Fl v | Fl -verbose .Op Fl -foreground .Op Fl -preserve-status .Ar duration @@ -76,6 +76,8 @@ Specify the signal to send on timeout. By default, .Dv SIGTERM is sent. +.It Fl v , Fl -verbose +Show information to stderr about any signal sent on timeout. .It Fl -foreground Do not propagate timeout to the children of .Ar command . diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 3803aeeca883..68abb28e2c50 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -49,14 +49,17 @@ static sig_atomic_t sig_chld = 0; static sig_atomic_t sig_term = 0; static sig_atomic_t sig_alrm = 0; static sig_atomic_t sig_ign = 0; +static const char *command = NULL; +static bool verbose = false; static void usage(void) { fprintf(stderr, "Usage: %s [-k time | --kill-after time]" - " [-s sig | --signal sig] [--foreground] [--preserve-status]" - " \n", getprogname()); + " [-s sig | --signal sig] [-v | --verbose] [--foreground]" + " [--preserve-status] \n", + getprogname()); exit(EXIT_FAILURE); } @@ -146,6 +149,16 @@ sig_handler(int signo) } } +static void +send_sig(pid_t pid, int signo) +{ + if (verbose) { + warnx("sending signal %s(%d) to command '%s'", + sys_signame[signo], signo, command); + } + kill(pid, signo); +} + static void set_interval(double iv) { @@ -196,10 +209,11 @@ main(int argc, char **argv) { "kill-after", required_argument, NULL, 'k'}, { "signal", required_argument, NULL, 's'}, { "help", no_argument, NULL, 'h'}, + { "verbose", no_argument, NULL, 'v'}, { NULL, 0, NULL, 0 } }; - while ((ch = getopt_long(argc, argv, "+k:s:h", longopts, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "+k:s:vh", longopts, NULL)) != -1) { switch (ch) { case 'k': do_second_kill = true; @@ -208,6 +222,9 @@ main(int argc, char **argv) case 's': killsig = parse_signal(optarg); break; + case 'v': + verbose = true; + break; case 0: break; case 'h': @@ -226,6 +243,7 @@ main(int argc, char **argv) first_kill = parse_duration(argv[0]); argc--; argv++; + command = argv[0]; if (!foreground) { /* Acquire a reaper */ @@ -316,7 +334,7 @@ main(int argc, char **argv) procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall); } else - kill(pid, killsig); + send_sig(pid, killsig); if (do_second_kill) { set_interval(second_kill); @@ -333,7 +351,7 @@ main(int argc, char **argv) procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall); } else - kill(pid, sig_term); + send_sig(pid, sig_term); if (do_second_kill) { set_interval(second_kill); From nobody Sun Jan 19 23:54:18 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybr0p6Xc4z5lt7x; Sun, 19 Jan 2025 23:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybr0p5THnz3Zwr; Sun, 19 Jan 2025 23:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737330858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOZTE/hKGUJvG512YViQRSQKjW6RW0rMElVvbd+0isk=; b=wlNZHBmcBSefndNhOlQfXb36nj9aKFItJmZQGw4YNZ/c4MzSEnyn1dhWYgud+oWf0ka5ZP hGGrrzvYf9sRnHCXmtRk5HRON/LDW0Z5CNWR104qWsiGaCbWwhV1+RVCNJfqLZXKoobC3v EYDnyyiksIp+qunAHbGc0UddzhE8u1kNli/w40O8B3Xzq9K9ViC7nfnmyOdcQom2JA+qP9 Pd5I8sN2kJn1rdXUXLju30jkLTEwgYI7jMGjZPEzIpknc/YQL8TN7KIJc+wXhppgtBFK1m RwZiQCMGhvxT6QSc6IkunnyGz1V9lMPpOkQEROACHzFgLmqnCYdX+c+7D0s9PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737330858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOZTE/hKGUJvG512YViQRSQKjW6RW0rMElVvbd+0isk=; b=dBByQy3PzyfzfjDvpBWKP0l4pft7kj6+pFlQ0dhvwoZY5sqW9KZXLFkf1Kji/fPSKT4ff8 CKb1Rx9xEfg35r64yEz0EV2pXcms8zlec/ZTGip6MnLBaM8WnHhF9NyNZCme7uI0scEf6p ITfX+5DAIlMGqXvgoIMmme4n9dgvcz3+pIp824MonqQZBb5r7IdPnwoSu6sQbt1PfJh4jk oOH+/OfPeZ9FoxqJaI5H1kG/B3loHRRvJYOvvU7bC0D/31C0ZStrWaDxnoMhyzwX1quUui VbCOM7DiCocOcBHOEc+ilaCTl6lONDE+zx9VSCQow7aa61oYoxB/gRmjGKbUUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737330858; a=rsa-sha256; cv=none; b=pRNoFN8mW86ewkhELuYrgg46iFWzgAn05T8Ag7DB0kBpj8q5OpVnzhfg8bxw1BFueP0olT /Ffu+hbNz6FtzCCBZuBnnobUYZGrREjvohFoBRd+7aw3e99NYyCqR7DvUjnbpRnCVWwEwZ KQWIKpF6BclbiLpjz2bwV4cKXOC86PTTon6+hHEBrpWYzHuMjm6n7mg+ChR1kOnhY1dB5b Utg5Mtnh1rIuiNsmqXZqxBXUqDZSpfGrIszevg72rCil11sprJXz2njw6yDnWAnoWftVXm NkoZG/Ji//b3J/P2qyqAAYP6c1a2xns0LfMJ+OdZv/+2BCcCqd9H0KLhoVySgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybr0p52vLz1BC3; Sun, 19 Jan 2025 23:54:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50JNsIuw060822; Sun, 19 Jan 2025 23:54:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JNsIZ9060819; Sun, 19 Jan 2025 23:54:18 GMT (envelope-from git) Date: Sun, 19 Jan 2025 23:54:18 GMT Message-Id: <202501192354.50JNsIZ9060819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: ead3cd3ef628 - stable/14 - mountd.c: Define a new -a command line option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ead3cd3ef628ab11e814eea7c673eb6407f96c55 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ead3cd3ef628ab11e814eea7c673eb6407f96c55 commit ead3cd3ef628ab11e814eea7c673eb6407f96c55 Author: Rick Macklem AuthorDate: 2024-12-28 21:24:51 +0000 Commit: Rick Macklem CommitDate: 2025-01-19 23:52:48 +0000 mountd.c: Define a new -a command line option Bugzilla PR#282995 reported that, when a file system was exported with the "-alldirs" flag, the export succeeded even if the directory path was not a server file system mount point. This behaviour for "-alldirs" was only documented in the Example section of exports(5) and had not been enforced since FreeBSD2. (A patch applied between FreeBSD1 and FreeBSD2 broke the check for file system mount point.) Since the behaviour of allowing the export has existed since FreeBSD2, the concensus on a mailing list was that it would be a POLA violation to change it now. Therefore, this patch adds a new "-a" mountd command line option to enforce a check for the exported directory being a server file system mount point. PR: 282995 (cherry picked from commit 07cd69e272da2f116950f2bde6dfcc404f869f0c) --- usr.sbin/mountd/mountd.c | 51 +++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 20055d885b08..f412adbe741e 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -228,7 +228,8 @@ static int do_export_mount(struct exportlist *, struct statfs *); static int do_mount(struct exportlist *, struct grouplist *, uint64_t, struct expcred *, char *, int, struct statfs *, int, int *); static int do_opt(char **, char **, struct exportlist *, - struct grouplist *, int *, uint64_t *, struct expcred *); + struct grouplist *, int *, uint64_t *, struct expcred *, + char *); static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); static struct exportlist *get_exp(void); static void free_dir(struct dirlist *); @@ -303,6 +304,7 @@ static int *sock_fd; static int sock_fdcnt; static int sock_fdpos; static int suspend_nfsd = 0; +static int alldirs_fail = 0; static int opt_flags; static int have_v6 = 1; @@ -331,6 +333,7 @@ static gid_t *tmp_groups = NULL; #define OP_MASKLEN 0x200 #define OP_SEC 0x400 #define OP_CLASSMASK 0x800 /* mask not specified, is Class A/B/C default */ +#define OP_NOTROOT 0x1000 /* Mark the the mount path is not a fs root */ #ifdef DEBUG static int debug = 1; @@ -469,7 +472,7 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2Adeh:lnp:RrS")) != -1) + while ((c = getopt(argc, argv, "2Aadeh:lnp:RrS")) != -1) switch (c) { case '2': force_v2 = 1; @@ -477,6 +480,9 @@ main(int argc, char **argv) case 'A': warn_admin = 0; break; + case 'a': + alldirs_fail = 1; + break; case 'e': /* now a no-op, since this is the default */ break; @@ -1592,6 +1598,7 @@ get_exportlist_one(int passno) v4root_phase = 0; dirhead = (struct dirlist *)NULL; unvis_dir[0] = '\0'; + fsb.f_mntonname[0] = '\0'; while (get_line()) { if (debug) @@ -1652,7 +1659,7 @@ get_exportlist_one(int passno) warnx("doing opt %s", cp); got_nondir = 1; if (do_opt(&cp, &endcp, ep, grp, &has_host, - &exflags, &anon)) { + &exflags, &anon, unvis_dir)) { getexp_err(ep, tgrp, NULL); goto nextline; } @@ -1733,19 +1740,9 @@ get_exportlist_one(int passno) fsb.f_fsid.val[1]); } - if (warn_admin != 0 && - (ep->ex_flag & EX_ADMINWARN) == 0 && - strcmp(unvis_dir, fsb.f_mntonname) != - 0) { - if (debug) - warnx("exporting %s exports entire " - "%s file system", unvis_dir, - fsb.f_mntonname); - syslog(LOG_ERR, "Warning: exporting %s " - "exports entire %s file system", - unvis_dir, fsb.f_mntonname); - ep->ex_flag |= EX_ADMINWARN; - } + if (strcmp(unvis_dir, fsb.f_mntonname) != + 0) + opt_flags |= OP_NOTROOT; /* * Add dirpath to export mount point. @@ -1815,6 +1812,17 @@ get_exportlist_one(int passno) "WARNING: No mask specified for %s, " "using out-of-date default", (&grp->gr_ptr.gt_net)->nt_name); + if ((opt_flags & OP_NOTROOT) != 0 && warn_admin != 0 && + (ep->ex_flag & EX_ADMINWARN) == 0 && unvis_dir[0] != '\0' && + fsb.f_mntonname[0] != '\0') { + if (debug) + warnx("exporting %s exports entire %s file " + "system", unvis_dir, fsb.f_mntonname); + syslog(LOG_ERR, "Warning: exporting %s exports " + "entire %s file system", unvis_dir, + fsb.f_mntonname); + ep->ex_flag |= EX_ADMINWARN; + } if (check_options(dirhead)) { getexp_err(ep, tgrp, NULL); goto nextline; @@ -2838,7 +2846,7 @@ parsesec(char *seclist, struct exportlist *ep) */ static int do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, - int *has_hostp, uint64_t *exflagsp, struct expcred *cr) + int *has_hostp, uint64_t *exflagsp, struct expcred *cr, char *unvis_dir) { char *cpoptarg, *cpoptend; char *cp, *endcp, *cpopt, savedc, savedc2; @@ -2923,6 +2931,12 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp, syslog(LOG_ERR, "= after op: %s", cpopt); return (1); } + if ((opt_flags & OP_NOTROOT) != 0) { + syslog(LOG_ERR, "%s: path %s not mount point", + cpopt, unvis_dir); + if (alldirs_fail != 0) + return (1); + } opt_flags |= OP_ALLDIRS; } else if (!strcmp(cpopt, "public")) { if (fnd_equal == 1) { @@ -3319,7 +3333,8 @@ do_mount(struct exportlist *ep, struct grouplist *grp, uint64_t exflags, ret = 1; goto error_exit; } - if (opt_flags & OP_ALLDIRS) { + if ((opt_flags & OP_ALLDIRS) && + alldirs_fail != 0) { if (errno == EINVAL) syslog(LOG_ERR, "-alldirs requested but %s is not a filesystem mountpoint", From nobody Sun Jan 19 23:58:50 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ybr626RjPz5ltYR; Sun, 19 Jan 2025 23:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ybr6233dGz3ZkL; Sun, 19 Jan 2025 23:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFAMaFa4zJbgM3j2UGLgXbelg8MjZ4WctHvM2KecyG0=; b=cnAif1JoF3hpTEhw6nf7EkskIPehgdzBpQqeotWZZmbIpOok+MfdJ4mmGZAaOhseEth02x 5mcfumNMzHb4IPD9xlKTcvLKbFhosZp7OXj2896+ef8rmu7YpObpfz81iABTynKpaA4sMI BCrygRKEcA0zhFUbHfDQIQ00eXIYuXKha/2yDGQxfCC/VXDcIdQ8eyMbTbnv4mA+/GYbrh RqZZfkDsUMFLbUk0W6BLinPnm2t3+oz6ErOi85CrCKEDPCgJl0S9d9K7da20+GePLGk3MS qXS9EKN7Ki9pXAlPplFny1RkECWYfm4J8Wn3x7Lz+0MlinIbTdFSoWOnfeuY5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737331130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFAMaFa4zJbgM3j2UGLgXbelg8MjZ4WctHvM2KecyG0=; b=TVnSx/imoEEc90O/M60nj32L8OsMVWmuajOAkP6YUMhLcZogfoUtP5Hjl2yGBmRX/RBqal qYZA+unAQNH3QKyDPB4IQvWx+mj5i7T+aalsAIQqaHF7C4OAa6CKWP5/NS/yz7+HcE9AqQ Lbt/qRji+PPpp245CU3kkN1scceA5Bwj+zP0Z9UGyXizPyfOVdfvDDQOFpU4eOD3RbOvWU /lCOiU8SdZfe/j3YeXP8xIieSwgmK/wWRavIk69Idxe+6SLv6k2xIumcsr6JB//LuCwVIZ HGBrMZ3xiG4LSJYNfTm+3Ie7gFNSqryklWygj1g+uqi2ZzSMXer2zsL5y2tPug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737331130; a=rsa-sha256; cv=none; b=lEMD1H60sPy3az+vCSe35UygsApsLlOQVG9Vs8cVwogBR/VgsQ6XMUE4xB9Wma34jqTHZ5 VDsjscm8dDwnCKUcISwyhu2GIDzMCcfPyIu6FDq/0dpm2Q7vZwOyukhaSLTgL34tS6qike r25EEKONfAmQdxPeLYppCNvfpSOvUo+4JYONwMSxrrKeOLA6yGGakeLEEPAXHAZriJ90X+ GUcjTfecHk2DIY+xWwvFYMrol7JmIa/CUzdPbhTabd3afKD0SNrKcQ2gI6soAba6FHHMYU QYzW4efm9Sy3V6g9jB3Ibag2vCpG+3jgVZUVt0gdA49bE4e8IFALrA+ay/cwSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ybr622XFvz1B2Y; Sun, 19 Jan 2025 23:58: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 50JNwoM0062247; Sun, 19 Jan 2025 23:58:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50JNwodA062244; Sun, 19 Jan 2025 23:58:50 GMT (envelope-from git) Date: Sun, 19 Jan 2025 23:58:50 GMT Message-Id: <202501192358.50JNwodA062244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 3ac1af1c0f07 - stable/14 - mound.8: Document the new -a command line option List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3ac1af1c0f07dbef049d42830732979ee35b3618 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3ac1af1c0f07dbef049d42830732979ee35b3618 commit 3ac1af1c0f07dbef049d42830732979ee35b3618 Author: Rick Macklem AuthorDate: 2024-12-28 21:30:56 +0000 Commit: Rick Macklem CommitDate: 2025-01-19 23:58:13 +0000 mound.8: Document the new -a command line option Commit 07cd69e272da adds a new "-a" mountd option. This patch updates the man page for it. This is a content change. PR: 282995 (cherry picked from commit 6db916d21a09aebf3e7cb5c95e2ad714ab2b8882) --- usr.sbin/mountd/mountd.8 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/usr.sbin/mountd/mountd.8 b/usr.sbin/mountd/mountd.8 index 3eff5d598fe7..015f54729fdf 100644 --- a/usr.sbin/mountd/mountd.8 +++ b/usr.sbin/mountd/mountd.8 @@ -27,7 +27,7 @@ .\" .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" -.Dd April 8, 2024 +.Dd December 16, 2024 .Dt MOUNTD 8 .Os .Sh NAME @@ -37,7 +37,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2AdelnRrS +.Op Fl 2AadelnRrS .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -72,6 +72,17 @@ actually exports the entire local file system and not just the subtree below the directory exported. (See .Xr exports 5 ) +.It Fl a +Enforce the check for an exported directory being a file +system mount point, if the +.Fl -alldirs +option is specified in +.Xr exports 5 +for the export file line. +With this option, the exports line will fail, whereas +without this option, a warning will be generated by +.Xr syslog 8 , +but the export will be done. .It Fl d Output debugging information. .Nm @@ -235,7 +246,8 @@ the current list of remote mounted file systems .Xr jail 8 , .Xr nfsd 8 , .Xr rpcbind 8 , -.Xr showmount 8 +.Xr showmount 8 , +.Xr syslog 8 .Sh HISTORY The .Nm