From nobody Sun Dec 17 02:39:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4St6cB4GdRz53sdm; Sun, 17 Dec 2023 02:39:38 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4St6cB3T5hz3W7g; Sun, 17 Dec 2023 02:39:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702780778; h=from:from:reply-to:subject: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=RrYGUTZ8wcoobOy4eDRVcuAMxL4UAy+G4dwXOSU5UqU=; b=CaVPH7FGtzaFJH7tx+dTHIwDWeTcVVp8/5AYfBVN3LWbLM6bFsfK0GG0MuPJ2LI2QX2NGy dhPPpJ6H+nM+qfV22E490EUR7p24kRqvNEZM2DKpb+2h7rrb+f1bIoc75yRmnTVp3YW3DE q6RxxvKberMGBemw4uu92jViPYNBJ1iGCbyRbmtuxYQhGfVCDY/G5OdsPhDBmGiNxLP9gQ WfmX9sixZF+LHRx9KpdVQh0qKr84hkvZecAfXhaMb5KIrMurIEZZ/zZCXl4tvis81UrCsZ wCOJ6bAlP+PhleN1LDrNhQbrMUxmioWgv0JnpVDZweMP8tTwxhuG/AuR9MBZ1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702780778; a=rsa-sha256; cv=none; b=wOGhlamzZqNHRI0NN61ZZkc+uT1aipegqenyK96qhWZwY0BbjRX/NJgE0vP97wFAmhccZz 0JoVn3fv648AaFiOv683wGNEitTmzqYTUn9lX7hISi7ENF0BnjiSHz2RyX/DMEwtwEm9Zx cp3G3DGlZG69bAazPk51THQIMfBz7Knuj5ZBvXhEzkKsZz7EPwMb1yo8DJzdowb/sGuaZP JYUxbf1oN5rKRIy0X+d10ID44b55Y+UWz2/Qu4BVUSKuY4I65F1WxKfGMhsGSvFz44lmLH tzMXbqm9qdxTnpvqro9xEZlOrXEm+scfZiHYTis+q9eGi0EYJ3EJnM/s0EEmFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702780778; h=from:from:reply-to:subject: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=RrYGUTZ8wcoobOy4eDRVcuAMxL4UAy+G4dwXOSU5UqU=; b=JrW2Nkzh+wbthQcQGhTvqmxtv/aaqgX/4YmZR7Czx24guD9nP0isg1yb1Dew/5of1mfQNb yL6KQ7jO89N9YkSC7/NvAT80sRHu3/YZgIOFKjfcNfJRaj8jwoVhb7Vw3IiNJ7HfVmGsin FRCJUST8uiTpbvsJDMNjW9FDFl7wHwIzErfA1k+O/WU+/7yeBK37G3QbQfw8xnMZUeoK94 ZCz4YK6J5W946UvDHO7I3Meg6ASrrjasjXHOhQT7RT7oEvm1STuHJ10OZ1iImqciULZ0Ds BzQai5LY2nrOYM+MNTtFaPBQTiVkPF1u0q/ROJx5b3Ou6Mix9cTOuieCyNZRXA== 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 4St6c96Lhyzymj; Sun, 17 Dec 2023 02:39:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <5ec2e86c-65c5-4733-b22a-443a9c103bde@FreeBSD.org> Date: Sat, 16 Dec 2023 20:39:35 -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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: ca39f23347e1 - main - ufs: do not leave around empty buffers shadowing disk content Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202312152209.3BFM9J2o038542@gitrepo.freebsd.org> From: Kyle Evans In-Reply-To: <202312152209.3BFM9J2o038542@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/15/23 16:09, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ca39f23347e1416a28dde13279bfe5841ad9a746 > > commit ca39f23347e1416a28dde13279bfe5841ad9a746 > Author: Konstantin Belousov > AuthorDate: 2023-12-11 22:57:28 +0000 > Commit: Konstantin Belousov > CommitDate: 2023-12-15 22:06:10 +0000 > > ufs: do not leave around empty buffers shadowing disk content > > If the ffs_write() operation specified to overwrite the whole buffer, > ffs tries to save the read by not validating allocated buffer. Then > uiommove() might fail with EFAULT, in which case pages are left zeroed > and marked valid but not read from the disk. Then vn_io_fault() logic > retries the write after holding the user pages to avoid EFAULTs. In > erronous case of really faulty buffer, or in contrived case of writing > from file to itself, we are left with zeroed buffer instead of valid > content written back to disk. > > Handle the situation by releasing non-cached buffer on fault, instead > of clearing it. Note that buffers with alive dependencies cannot be > released, but also either they cannot have valid content on the disk > because dependency on data buffer means that it was not yet written, or > they were reallocated by fragment extension or ffs_reallocbks(), and are > already fully valid. > > Reported by: kevans > Discussed with: mav > In collaboration with: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Thanks! From nobody Sun Dec 17 03:46:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4St84x2gsqz53xvQ; Sun, 17 Dec 2023 03:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4St84x0bBQz3Zyb; Sun, 17 Dec 2023 03:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702784769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYau8iiB70wYChszxqe8B91oGrPnDpunk7htl1k5CpI=; b=c5fsA2iixfrWSNKaOjroV1TvwgrPYEkF0/TortOsosGMM8t0iBvdF4LjP3jFlTpv0aPMif 7BBZUCL3swmThkMl28JWiHXVOTNT32le3CLklLLcKH/96HIdqTbRsSA8uU+MPu8wKc/TT1 V3pmkBo8PIVCIx2/xGcgAkuDBWRzfLfYsnF0CTFWB7bb8xUUxyFiuCReb4TTQnF0SMpa6r cnvm4PkhwIuBPp2zmkkxR/G8SIa6pkKIZvuXfouGaTc516CPLtq7c893J9amkqfem9J/R5 JtnX3KVjZRKBlrBdkQ8yBy4Q4iWMlFvyWq1cf4nHkgSQX7Lg4ZAfKsmj/MJUHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702784769; a=rsa-sha256; cv=none; b=W2gTkbr5MLT2qOHG8gIfJVjy7FEKzmG8GQh6Uzc9+Ry7gn/eEw1kMO3nFKGF+mTMYhrfCV Jrq424vHsNL1HpzICuKk6xr3z3ebIoWbWyfdmgWPAqbeEVI2EovgOroX1taAva1arOXMFq B9iiDwDp3/oBsZEriwoFvoejRkZkUL8K35Cib1HG413KXGXPiTdC249IeYWNOBXVSJlIS3 Ltqe1fndQgSL1kP/IUus/RB4qoEQ3uqxxPr+MrPlilzfkVt1IXbxq40zGH3GTTd0DExTNt KDKERCKHXgrAgHDXePG8C6RVV9imFHG+cSqY0oJFquSFxekEb1ETah7t2eBtdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702784769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DYau8iiB70wYChszxqe8B91oGrPnDpunk7htl1k5CpI=; b=vhvkMsKbfbTS1sgsPk6GvNpewX1iiBjznZ4WEr4mLxvQu6YOhVE4ukO9oPuB43tELoR/mh R1GXMdC6PAvnea/XI39EfdYviRrc4I3DEIqbhfzyfLlWxuNmVTtyaherDt/aDc/YXHQTyj pMjfmpbLrik3AarhJBdCgUNbubcoFSiEeXD+FQEVrVucC3tSyfqQ1v27WwfrqBvNBNGBj+ 7CRcucAXjEGwn1H6YViUx378sg+w6a35593RAklXjo7VqMpg/AcPbem7xDYwpTKnLbHqh3 stV3Xdl3t+TKmuZqZneEoQ6j+ttUcjOE4zGd80N4EEd/hVXu7IADEotuu2S7Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4St84w6mLxz6bL; Sun, 17 Dec 2023 03:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BH3k8aP017908; Sun, 17 Dec 2023 03:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BH3k8Fg017905; Sun, 17 Dec 2023 03:46:08 GMT (envelope-from git) Date: Sun, 17 Dec 2023 03:46:08 GMT Message-Id: <202312170346.3BH3k8Fg017905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 636bf719194c - stable/14 - Increase UFS/FFS maximum link count from 32767 to 65530. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 636bf719194ce27390b45b8f68e430993670d2dd Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=636bf719194ce27390b45b8f68e430993670d2dd commit 636bf719194ce27390b45b8f68e430993670d2dd Author: Kirk McKusick AuthorDate: 2023-12-03 20:36:42 +0000 Commit: Kirk McKusick CommitDate: 2023-12-17 03:45:51 +0000 Increase UFS/FFS maximum link count from 32767 to 65530. Differential Revision: https://reviews.freebsd.org/D42767 (cherry picked from commit 35a301555bff2ac27a727c10641b7efb3f162988) --- sys/ufs/ffs/ffs_alloc.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 ++-- sys/ufs/ufs/dinode.h | 6 +++--- sys/ufs/ufs/inode.h | 10 ++++++++-- sys/ufs/ufs/ufs_lookup.c | 8 ++++---- sys/ufs/ufs/ufs_vnops.c | 32 ++++++++++++++++---------------- 6 files changed, 34 insertions(+), 28 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 2bf5b6c58302..690df0c12793 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3332,7 +3332,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; ip = VTOI(vp); ip->i_nlink += cmd.size; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); ip->i_effnlink += cmd.size; UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_MODIFIED); error = ffs_update(vp, 1); diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 28ffb806b308..961cb4493621 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -10048,7 +10048,7 @@ handle_workitem_remove(struct dirrem *dirrem, int flags) KASSERT(ip->i_nlink >= 0, ("handle_workitem_remove: file ino " "%ju negative i_nlink %d", (intmax_t)ip->i_number, ip->i_nlink)); - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (ip->i_nlink < ip->i_effnlink) panic("handle_workitem_remove: bad file delta"); @@ -10071,7 +10071,7 @@ handle_workitem_remove(struct dirrem *dirrem, int flags) ip->i_nlink -= 2; KASSERT(ip->i_nlink >= 0, ("handle_workitem_remove: directory ino " "%ju negative i_nlink %d", (intmax_t)ip->i_number, ip->i_nlink)); - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (ip->i_nlink < ip->i_effnlink) panic("handle_workitem_remove: bad dir delta"); diff --git a/sys/ufs/ufs/dinode.h b/sys/ufs/ufs/dinode.h index b429562f1159..b4117a99c262 100644 --- a/sys/ufs/ufs/dinode.h +++ b/sys/ufs/ufs/dinode.h @@ -125,7 +125,7 @@ typedef int64_t ufs_time_t; struct ufs2_dinode { uint16_t di_mode; /* 0: IFMT, permissions; see below. */ - int16_t di_nlink; /* 2: File link count. */ + uint16_t di_nlink; /* 2: File link count. */ uint32_t di_uid; /* 4: File owner. */ uint32_t di_gid; /* 8: File group. */ uint32_t di_blksize; /* 12: Inode blocksize. */ @@ -180,7 +180,7 @@ struct ufs2_dinode { */ struct ufs1_dinode { uint16_t di_mode; /* 0: IFMT, permissions; see below. */ - int16_t di_nlink; /* 2: File link count. */ + uint16_t di_nlink; /* 2: File link count. */ union { uint32_t di_freelink; /* 4: SUJ: Next unlinked inode. */ uint32_t di_dirdepth; /* 4: IFDIR: depth from root dir */ @@ -210,6 +210,6 @@ struct ufs1_dinode { uint64_t di_modrev; /* 120: i_modrev for NFSv4 */ }; -#define UFS_LINK_MAX 32767 +#define UFS_LINK_MAX 65500 /* leave a few spare for special values */ #endif /* _UFS_UFS_DINODE_H_ */ diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 81500e10ebb1..dc7e2560d6e3 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -97,7 +97,7 @@ struct inode { ino_t i_number; /* The identity of the inode. */ uint32_t i_flag; /* flags, see below */ - int i_effnlink; /* i_nlink when I/O completes */ + int32_t i_effnlink; /* i_nlink when I/O completes */ /* * Side effects; used during directory lookup. @@ -133,7 +133,7 @@ struct inode { uint32_t i_flags; /* Status flags (chflags). */ uint32_t i_uid; /* File owner. */ uint32_t i_gid; /* File group. */ - int16_t i_nlink; /* File link count. */ + int32_t i_nlink; /* File link count. */ uint16_t i_mode; /* IFMT, permissions; see below. */ }; /* @@ -244,6 +244,12 @@ I_IS_UFS2(const struct inode *ip) else \ (ip)->i_din2->d##field = (val); \ } while (0) +#define DIP_SET_NLINK(ip, val) do { \ + KASSERT(ip->i_nlink >= 0, ("%s:%d %s(): setting negative " \ + "nlink value %d for inode %jd\n", __FILE__, __LINE__, \ + __FUNCTION__, (ip)->i_nlink, (ip)->i_number)); \ + DIP_SET(ip, i_nlink, val); \ + } while (0) #define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) #define IS_UFS(vp) ((vp)->v_data != NULL) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index b1964addd65d..0beeeed32251 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1123,7 +1123,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) softdep_setup_unlink(dp, ip); } else { ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } } @@ -1139,7 +1139,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) softdep_change_linkcnt(ip); } else { ip->i_nlink++; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } } @@ -1243,7 +1243,7 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, softdep_setup_unlink(dp, oip); } else { oip->i_nlink--; - DIP_SET(oip, i_nlink, oip->i_nlink); + DIP_SET_NLINK(oip, oip->i_nlink); UFS_INODE_SET_FLAG(oip, IN_CHANGE); } @@ -1260,7 +1260,7 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, softdep_change_linkcnt(oip); } else { oip->i_nlink++; - DIP_SET(oip, i_nlink, oip->i_nlink); + DIP_SET_NLINK(oip, oip->i_nlink); UFS_INODE_SET_FLAG(oip, IN_CHANGE); } return (error); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 79cca75fc563..ff1f2af7b65b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1133,7 +1133,7 @@ ufs_link( ip->i_effnlink++; ip->i_nlink++; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(vp)) softdep_setup_link(VTOI(tdvp), ip); @@ -1146,7 +1146,7 @@ ufs_link( if (error) { ip->i_effnlink--; ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(vp)) softdep_revert_link(VTOI(tdvp), ip); @@ -1528,7 +1528,7 @@ relock: */ fip->i_effnlink++; fip->i_nlink++; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_setup_link(tdp, fip); @@ -1557,7 +1557,7 @@ relock: if (tdp->i_nlink >= UFS_LINK_MAX) { fip->i_effnlink--; fip->i_nlink--; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_revert_link(tdp, fip); @@ -1680,11 +1680,11 @@ relock: */ if (!newparent) { tdp->i_nlink--; - DIP_SET(tdp, i_nlink, tdp->i_nlink); + DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); } tip->i_nlink--; - DIP_SET(tip, i_nlink, tip->i_nlink); + DIP_SET_NLINK(tip, tip->i_nlink); UFS_INODE_SET_FLAG(tip, IN_CHANGE); } } @@ -1719,7 +1719,7 @@ relock: if (tip == NULL) { tdp->i_effnlink++; tdp->i_nlink++; - DIP_SET(tdp, i_nlink, tdp->i_nlink); + DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); if (DOINGSOFTDEP(tdvp)) softdep_setup_dotdot_link(tdp, fip); @@ -1782,7 +1782,7 @@ unlockout: bad: fip->i_effnlink--; fip->i_nlink--; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_revert_link(tdp, fip); @@ -2122,7 +2122,7 @@ ufs_mkdir( tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; ip->i_nlink = 2; - DIP_SET(ip, i_nlink, 2); + DIP_SET_NLINK(ip, 2); DIP_SET(ip, i_dirdepth, DIP(dp,i_dirdepth) + 1); if (cnp->cn_flags & ISWHITEOUT) { @@ -2137,7 +2137,7 @@ ufs_mkdir( */ dp->i_effnlink++; dp->i_nlink++; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); if (DOINGSOFTDEP(dvp)) softdep_setup_mkdir(dp, ip); @@ -2228,7 +2228,7 @@ bad: } else { dp->i_effnlink--; dp->i_nlink--; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); /* * No need to do an explicit VOP_TRUNCATE here, vrele will @@ -2236,7 +2236,7 @@ bad: */ ip->i_effnlink = 0; ip->i_nlink = 0; - DIP_SET(ip, i_nlink, 0); + DIP_SET_NLINK(ip, 0); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_mkdir(dp, ip); @@ -2333,11 +2333,11 @@ ufs_rmdir( */ if (!DOINGSOFTDEP(vp)) { dp->i_nlink--; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); error = UFS_UPDATE(dvp, 0); ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } cache_vop_rmdir(dvp, vp); @@ -2874,7 +2874,7 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 1; ip->i_nlink = 1; - DIP_SET(ip, i_nlink, 1); + DIP_SET_NLINK(ip, 1); if (DOINGSOFTDEP(tvp)) softdep_setup_create(VTOI(dvp), ip); if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && @@ -2930,7 +2930,7 @@ bad: */ ip->i_effnlink = 0; ip->i_nlink = 0; - DIP_SET(ip, i_nlink, 0); + DIP_SET_NLINK(ip, 0); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_create(VTOI(dvp), ip); From nobody Sun Dec 17 03:48:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4St87w4Yr7z53xbb; Sun, 17 Dec 2023 03:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4St87w46ldz3b9Z; Sun, 17 Dec 2023 03:48:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702784924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kPXfS9uv8NWRfGNzU0Jgl960G0msv2txfeKHri/kIC4=; b=eZwWuxYIheR1Ig6cfwRgWG3Kilc/gaa3Blo1nxWvhjFCbDsgzI6YzPqaKy1H6Dua+ERNAT OLKoP+AMjXbpdadCyvlLeFstZb+UIcVRvN75i2AzZL3u1iYg4vRylCA7Gok4sRY/u/MnRB MtNFQb8mUVU4h3VOwkZRyIUZgdGrT6+/N94CsY0IOM7GZ4QiCKnOy+XcCf1lgPhwUmiiNY UtChR6SXN4Z11mxB9V/rKmMHqOqMhlyf0zqoij7iEQmF8BxLMBQWgr1EbyhCCvVvWtM9s7 TnV86jsvQIgIewZLtfcHFCaRKaJTBofLeStA66djHUkriZpn44EvSBH7+0V/YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702784924; a=rsa-sha256; cv=none; b=I9Dyu4TUkxCy5XWwpT82NFQ2duJyoKJwAp4lI2rjeUtuQRSBR+TcbrulpsDTzr382KKGfs e00ghJcZjruWkBE5nAjxZJ9iRUUENQfnowFk4PRDla3LAk1qxtFzdkJxMdYImHLfc9Kkhp d6o5UrTY0NsKAbie4k0n9K9Um9KOABLCm0GbEz4oCqnJpAzqkovzvLg6JDI5hjcynrE0AR S66Vv+0yxCw9s8bj53PgSFBymspK6zFuR5xF4iP+hlpFawD4oAEcTPoqngkDEyG/fEDEvf iPMSjmlEQU8khgMDXNHcSXM6PO9+ChOr/Nohrz5+9TqYG5YGh+0S4lqH6cABLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702784924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kPXfS9uv8NWRfGNzU0Jgl960G0msv2txfeKHri/kIC4=; b=G1FcF1sf7ZKznEkqt24JB5Pc9kyliWC1cGYwibA3JE9wZ+P2ar1DpZMZAj4xTc3zZMtSbA 0SBQ+S88dREK2Povy/a+lNMA4TqitvAF/iokCsbq4dD6Y1LAZB7t5PXN5uFh3BH6avspf/ szgiIw/fIXiWPIY55N1i1U2zfJnuyh1Yl9S9ili1ivKwcYSs+mr4TQaBwLXW6Jku5ejmQn gYZyixJrpbExRJHkJJnbeeBWfGpAI1M9LzUJ++aEVDNFYEe46sMFF5PwhUq1FXvmG4mePp efhdetFLIOmGXYMqvUCjFBllH+9WxM1G4ZNzAdLDV9E8YgMwb2RAJSy9GSNaGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4St87w38xZz6t3; Sun, 17 Dec 2023 03:48:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BH3miKt018436; Sun, 17 Dec 2023 03:48:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BH3miAY018433; Sun, 17 Dec 2023 03:48:44 GMT (envelope-from git) Date: Sun, 17 Dec 2023 03:48:44 GMT Message-Id: <202312170348.3BH3miAY018433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 2e4ac696d8d4 - stable/13 - Increase UFS/FFS maximum link count from 32767 to 65530. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e4ac696d8d46f4818ecc91a38953ba1e3a20fc5 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=2e4ac696d8d46f4818ecc91a38953ba1e3a20fc5 commit 2e4ac696d8d46f4818ecc91a38953ba1e3a20fc5 Author: Kirk McKusick AuthorDate: 2023-12-03 20:36:42 +0000 Commit: Kirk McKusick CommitDate: 2023-12-17 03:48:38 +0000 Increase UFS/FFS maximum link count from 32767 to 65530. Differential Revision: https://reviews.freebsd.org/D42767 (cherry picked from commit 35a301555bff2ac27a727c10641b7efb3f162988) --- sys/ufs/ffs/ffs_alloc.c | 2 +- sys/ufs/ffs/ffs_softdep.c | 4 ++-- sys/ufs/ufs/dinode.h | 6 +++--- sys/ufs/ufs/inode.h | 10 ++++++++-- sys/ufs/ufs/ufs_lookup.c | 8 ++++---- sys/ufs/ufs/ufs_vnops.c | 32 ++++++++++++++++---------------- 6 files changed, 34 insertions(+), 28 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 33ad9ffc072b..09028456435e 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3332,7 +3332,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; ip = VTOI(vp); ip->i_nlink += cmd.size; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); ip->i_effnlink += cmd.size; UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_MODIFIED); error = ffs_update(vp, 1); diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index bf411b9f4322..f2df1a8e7fc3 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -10048,7 +10048,7 @@ handle_workitem_remove(struct dirrem *dirrem, int flags) KASSERT(ip->i_nlink >= 0, ("handle_workitem_remove: file ino " "%ju negative i_nlink %d", (intmax_t)ip->i_number, ip->i_nlink)); - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (ip->i_nlink < ip->i_effnlink) panic("handle_workitem_remove: bad file delta"); @@ -10071,7 +10071,7 @@ handle_workitem_remove(struct dirrem *dirrem, int flags) ip->i_nlink -= 2; KASSERT(ip->i_nlink >= 0, ("handle_workitem_remove: directory ino " "%ju negative i_nlink %d", (intmax_t)ip->i_number, ip->i_nlink)); - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (ip->i_nlink < ip->i_effnlink) panic("handle_workitem_remove: bad dir delta"); diff --git a/sys/ufs/ufs/dinode.h b/sys/ufs/ufs/dinode.h index b429562f1159..b4117a99c262 100644 --- a/sys/ufs/ufs/dinode.h +++ b/sys/ufs/ufs/dinode.h @@ -125,7 +125,7 @@ typedef int64_t ufs_time_t; struct ufs2_dinode { uint16_t di_mode; /* 0: IFMT, permissions; see below. */ - int16_t di_nlink; /* 2: File link count. */ + uint16_t di_nlink; /* 2: File link count. */ uint32_t di_uid; /* 4: File owner. */ uint32_t di_gid; /* 8: File group. */ uint32_t di_blksize; /* 12: Inode blocksize. */ @@ -180,7 +180,7 @@ struct ufs2_dinode { */ struct ufs1_dinode { uint16_t di_mode; /* 0: IFMT, permissions; see below. */ - int16_t di_nlink; /* 2: File link count. */ + uint16_t di_nlink; /* 2: File link count. */ union { uint32_t di_freelink; /* 4: SUJ: Next unlinked inode. */ uint32_t di_dirdepth; /* 4: IFDIR: depth from root dir */ @@ -210,6 +210,6 @@ struct ufs1_dinode { uint64_t di_modrev; /* 120: i_modrev for NFSv4 */ }; -#define UFS_LINK_MAX 32767 +#define UFS_LINK_MAX 65500 /* leave a few spare for special values */ #endif /* _UFS_UFS_DINODE_H_ */ diff --git a/sys/ufs/ufs/inode.h b/sys/ufs/ufs/inode.h index 898f30204b00..afe49bdba882 100644 --- a/sys/ufs/ufs/inode.h +++ b/sys/ufs/ufs/inode.h @@ -96,7 +96,7 @@ struct inode { ino_t i_number; /* The identity of the inode. */ uint32_t i_flag; /* flags, see below */ - int i_effnlink; /* i_nlink when I/O completes */ + int32_t i_effnlink; /* i_nlink when I/O completes */ /* * Side effects; used during directory lookup. @@ -130,7 +130,7 @@ struct inode { uint32_t i_flags; /* Status flags (chflags). */ uint32_t i_uid; /* File owner. */ uint32_t i_gid; /* File group. */ - int16_t i_nlink; /* File link count. */ + int32_t i_nlink; /* File link count. */ uint16_t i_mode; /* IFMT, permissions; see below. */ }; /* @@ -240,6 +240,12 @@ I_IS_UFS2(const struct inode *ip) else \ (ip)->i_din2->d##field = (val); \ } while (0) +#define DIP_SET_NLINK(ip, val) do { \ + KASSERT(ip->i_nlink >= 0, ("%s:%d %s(): setting negative " \ + "nlink value %d for inode %jd\n", __FILE__, __LINE__, \ + __FUNCTION__, (ip)->i_nlink, (ip)->i_number)); \ + DIP_SET(ip, i_nlink, val); \ + } while (0) #define IS_SNAPSHOT(ip) ((ip)->i_flags & SF_SNAPSHOT) #define IS_UFS(vp) ((vp)->v_data != NULL) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 0fb3a186b960..0c4b0d04367d 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1137,7 +1137,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) softdep_setup_unlink(dp, ip); } else { ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } } @@ -1153,7 +1153,7 @@ ufs_dirremove(struct vnode *dvp, struct inode *ip, int flags, int isrmdir) softdep_change_linkcnt(ip); } else { ip->i_nlink++; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } } @@ -1257,7 +1257,7 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, softdep_setup_unlink(dp, oip); } else { oip->i_nlink--; - DIP_SET(oip, i_nlink, oip->i_nlink); + DIP_SET_NLINK(oip, oip->i_nlink); UFS_INODE_SET_FLAG(oip, IN_CHANGE); } @@ -1274,7 +1274,7 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, softdep_change_linkcnt(oip); } else { oip->i_nlink++; - DIP_SET(oip, i_nlink, oip->i_nlink); + DIP_SET_NLINK(oip, oip->i_nlink); UFS_INODE_SET_FLAG(oip, IN_CHANGE); } return (error); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index a6ca523ae87c..949e7bcc1bec 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1137,7 +1137,7 @@ ufs_link( ip->i_effnlink++; ip->i_nlink++; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(vp)) softdep_setup_link(VTOI(tdvp), ip); @@ -1150,7 +1150,7 @@ ufs_link( if (error) { ip->i_effnlink--; ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(vp)) softdep_revert_link(VTOI(tdvp), ip); @@ -1541,7 +1541,7 @@ relock: */ fip->i_effnlink++; fip->i_nlink++; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_setup_link(tdp, fip); @@ -1570,7 +1570,7 @@ relock: if (tdp->i_nlink >= UFS_LINK_MAX) { fip->i_effnlink--; fip->i_nlink--; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_revert_link(tdp, fip); @@ -1693,11 +1693,11 @@ relock: */ if (!newparent) { tdp->i_nlink--; - DIP_SET(tdp, i_nlink, tdp->i_nlink); + DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); } tip->i_nlink--; - DIP_SET(tip, i_nlink, tip->i_nlink); + DIP_SET_NLINK(tip, tip->i_nlink); UFS_INODE_SET_FLAG(tip, IN_CHANGE); } } @@ -1732,7 +1732,7 @@ relock: if (tip == NULL) { tdp->i_effnlink++; tdp->i_nlink++; - DIP_SET(tdp, i_nlink, tdp->i_nlink); + DIP_SET_NLINK(tdp, tdp->i_nlink); UFS_INODE_SET_FLAG(tdp, IN_CHANGE); if (DOINGSOFTDEP(tdvp)) softdep_setup_dotdot_link(tdp, fip); @@ -1793,7 +1793,7 @@ unlockout: bad: fip->i_effnlink--; fip->i_nlink--; - DIP_SET(fip, i_nlink, fip->i_nlink); + DIP_SET_NLINK(fip, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_revert_link(tdp, fip); @@ -2137,7 +2137,7 @@ ufs_mkdir( tvp->v_type = VDIR; /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 2; ip->i_nlink = 2; - DIP_SET(ip, i_nlink, 2); + DIP_SET_NLINK(ip, 2); DIP_SET(ip, i_dirdepth, DIP(dp,i_dirdepth) + 1); if (cnp->cn_flags & ISWHITEOUT) { @@ -2152,7 +2152,7 @@ ufs_mkdir( */ dp->i_effnlink++; dp->i_nlink++; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); if (DOINGSOFTDEP(dvp)) softdep_setup_mkdir(dp, ip); @@ -2243,7 +2243,7 @@ bad: } else { dp->i_effnlink--; dp->i_nlink--; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); /* * No need to do an explicit VOP_TRUNCATE here, vrele will @@ -2251,7 +2251,7 @@ bad: */ ip->i_effnlink = 0; ip->i_nlink = 0; - DIP_SET(ip, i_nlink, 0); + DIP_SET_NLINK(ip, 0); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_mkdir(dp, ip); @@ -2348,11 +2348,11 @@ ufs_rmdir( */ if (!DOINGSOFTDEP(vp)) { dp->i_nlink--; - DIP_SET(dp, i_nlink, dp->i_nlink); + DIP_SET_NLINK(dp, dp->i_nlink); UFS_INODE_SET_FLAG(dp, IN_CHANGE); error = UFS_UPDATE(dvp, 0); ip->i_nlink--; - DIP_SET(ip, i_nlink, ip->i_nlink); + DIP_SET_NLINK(ip, ip->i_nlink); UFS_INODE_SET_FLAG(ip, IN_CHANGE); } cache_vop_rmdir(dvp, vp); @@ -2893,7 +2893,7 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, tvp->v_type = IFTOVT(mode); /* Rest init'd in getnewvnode(). */ ip->i_effnlink = 1; ip->i_nlink = 1; - DIP_SET(ip, i_nlink, 1); + DIP_SET_NLINK(ip, 1); if (DOINGSOFTDEP(tvp)) softdep_setup_create(VTOI(dvp), ip); if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) && @@ -2949,7 +2949,7 @@ bad: */ ip->i_effnlink = 0; ip->i_nlink = 0; - DIP_SET(ip, i_nlink, 0); + DIP_SET_NLINK(ip, 0); UFS_INODE_SET_FLAG(ip, IN_CHANGE); if (DOINGSOFTDEP(tvp)) softdep_revert_create(VTOI(dvp), ip); From nobody Sun Dec 17 10:43:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StKLV0ZnYz54Rdf; Sun, 17 Dec 2023 10: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StKLT6zhXz3WFj; Sun, 17 Dec 2023 10:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702809810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4SPK5B7g8Dpx5+ocMptQ6Fvt1JvIe5l5Jjq6p3Mojac=; b=n4VcksOgdv/DU8uM5Ik0YGmTHxPv+vFMR2AP3VrYr2DHMvChngvcHLzWi0Xgz/RXR+8E1V Mvyqg0ntSRBgd+F1royHE0npFxfUyXv3zEUeHjl2jCtRZdkYSC8MxRSiyjkXlhHtvfk81i EDJXt0stJXO7ZHkxvVSNt039pjIPP9Uw1onu66O1arjj+F7LoUAWOizgqbGZnTlLSFL0KS 1uTYFGicViYm+x7acCcntbxYCIVSVihISSfMwkcSM1kwtL/pc85HKDdGUXGR0cwcZG0kNp Q9BGcE4bZZ0CsG+SayVJUzsRp0rF6RJOjBkZfrZKjo0gYMjLmBsuDZtcJN+TgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702809810; a=rsa-sha256; cv=none; b=xD6rxFMufoIhbfVkB5CIBf0XoZ2939vrW4u2Pgc+rvyxPuR26kbDBftoLssooFLGMOVNdN 4Ogf0GOl2Iz+gnBeq2C2Bcl7qw2eLvyc+nMz6NSR9f9rIY2j5OZaxcbCXyeTVmhXIfLDZF kPsCUNPofR6TWFvsz5/Po/tmcpja9IKp4oLqzpcuyME8rp6URozchhmxF4WZ7aggA474MA 5+e30crZ4kgeu7LekpcOXM2baRiwnnKmAyRUcwjCGLcbqkTe+KfysLr742DZYMCQ1vAicF npOB5X2YJXIUYt8il+FyJ8iOp6X8r39Civ6jvvUUPAe+qmljhYEOupBAC3Cofg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702809810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4SPK5B7g8Dpx5+ocMptQ6Fvt1JvIe5l5Jjq6p3Mojac=; b=NSSQnii5xiJXeNPKmhh2TazWdSj5YMFYj7KpDF7bGUeEYFsQTif7Q1uoWOtZD7MouX9SCn yoSw8Pnz6rJ5xUaV4y6zYAIHj7uCAJ/0HRTWRMHI8I/N3Z3Snh60n7gFfv93gENUfZkwa4 fhVkgrgM3TtoPV8sFdFUsQNmvgKwbRgy/KyVCgTBFHzHKOm4PNfc7FPqMn0zYdtd6TqaTf /ypWi25W7+983qEZyfVm3vJ/6ro01X2lzkGNz80bC7TIVuJPKUyyFa4bC9+uTu3DWF6KxQ LjSmeWRC5HBPQi47Jcq/tpSJm/o/xLQe27sxCBZkxdaTOJmrmz1JOvMWKPniaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StKLT658fzZlM; Sun, 17 Dec 2023 10:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHAhTTq020079; Sun, 17 Dec 2023 10:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHAhTPW020076; Sun, 17 Dec 2023 10:43:29 GMT (envelope-from git) Date: Sun, 17 Dec 2023 10:43:29 GMT Message-Id: <202312171043.3BHAhTPW020076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: a2ee3070d80c - main - awk(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2ee3070d80ce06eefe3682f453605422cfbf5b6 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=a2ee3070d80ce06eefe3682f453605422cfbf5b6 commit a2ee3070d80ce06eefe3682f453605422cfbf5b6 Author: Yu-Hsun Chen AuthorDate: 2023-12-13 08:40:08 +0000 Commit: Li-Wen Hsu CommitDate: 2023-12-17 10:40:29 +0000 awk(1): Fix typo This is from the Advanced UNIX Programming Course (Fall’23) at NTHU. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/928 --- usr.bin/awk/awk.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/awk/awk.1 b/usr.bin/awk/awk.1 index 34fba1dce57e..65c91738966b 100644 --- a/usr.bin/awk/awk.1 +++ b/usr.bin/awk/awk.1 @@ -811,7 +811,7 @@ to it. The scope rules for variables in functions are a botch; the syntax is worse. .Sh DEPRECATED BEHAVIOR -One True Awk has accpeted +One True Awk has accepted .Fl F Ar t to mean the same as .Fl F Ar From nobody Sun Dec 17 10:43:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StKLW2Vp8z54RRx; Sun, 17 Dec 2023 10:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StKLW17djz3WJd; Sun, 17 Dec 2023 10: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=1702809811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IrRBYVL4Kf0V1bV1I9AhHaq46GJtOLkaGp71qYbmjLM=; b=dbxr8a2U18tFHZIkOSo8cl9UPhw9gHkKD3NPJdAise7g4ptslwCsWWIMfqjYa9OvkfNbp9 ccsC2qUPBTLvIzI7bdTx4sKQwQIk8JBnIVfoq1ZMPwnzWL0j0z3MkxUh3oS3HMDCCqzdAM r2XETL1HEoiEaf0ZYAWd0DA/7vBBhY1EJlrfHhZFdx4rkNYDoB4Ib+c6C9HdmWmOxWbLeS 1t4nT8R9UJxzmSihR39TNlat27DSTAUdV4jc2bpDkJD0qlOi9ihrOlzvtF7jWrGkSu+dv6 9MXpKdJtCuZEJ3pJC/MbZ5qPW3gg8krlITuf84gt0CGj3fesKPcUxeolgZwFPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702809811; a=rsa-sha256; cv=none; b=f5WLAGaeyIf5kiIlIzdfQ+X19Synbb4mSlZDFF4leONGQn+z2y+JrVkAyAxyzoSN4uiuiq QjglKzPyW9LNogITPhgMsHIl+1aH5msAQr/R40+TcR7ZSDgOx5V773Xv2UjTm2Gma2gTFm 9PoKumB1sAOuhrjreS/c9muW7nLz5VdZWUJD/zAl+VmeuI/AlAscJMmJOVd9c6O7rT3L6J 4A6R3dvYKWHhPKZr2shAEMJ0DK9uJrxkEH93Jnv3F7QXxykXPIsEd8LvdW4ARFKnj9o8j1 szoZ6+MOOOvGYpotjTIkyB98jT7NS0eZY2z9EO5RfRuS5JTFeptozaEMHWziJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702809811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IrRBYVL4Kf0V1bV1I9AhHaq46GJtOLkaGp71qYbmjLM=; b=Lw8/WAvEMyhyWC6r8JzS/lJcjjUCjP3SaPsQq+lsZXF9zj/h3o+3ffZGhzNFOVhCdHqwZf 09ki1WG8CjdZlcAE0sF27OxkpXTNBRxRgnB2fydfYiYd6TzB86bICsyUBye2WXqYKMrOBT XgyW8zgNuFKkqCfMWHfm7ZnV4e1sziHbzHo/7VMXAoyMfDfe21AerkJlzY+/p+4/jWKzuR 9HXrp/IQqGoQkaOgCmjMWUSNZCI3H4stOmyf+tLxt3b2RxTIPiZbvRcaUvbBQzfm2XFhI6 21GFeTHkxuLrIOv2is5rp2FLxoguKMvUYaHvm/OOHln7sAEKf+orprdgmA0JVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StKLV73SqzZlN; Sun, 17 Dec 2023 10:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHAhU2f020129; Sun, 17 Dec 2023 10:43:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHAhUot020126; Sun, 17 Dec 2023 10:43:30 GMT (envelope-from git) Date: Sun, 17 Dec 2023 10:43:30 GMT Message-Id: <202312171043.3BHAhUot020126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 0ba51e3b6384 - main - fstat(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ba51e3b638424597add4212958524c9b750dd7b Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=0ba51e3b638424597add4212958524c9b750dd7b commit 0ba51e3b638424597add4212958524c9b750dd7b Author: Yu-Hsun Chen AuthorDate: 2023-12-13 08:42:22 +0000 Commit: Li-Wen Hsu CommitDate: 2023-12-17 10:41:53 +0000 fstat(1): Fix typo This is from the Advanced UNIX Programming Course (Fall’23) at NTHU. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/929 --- usr.bin/fstat/fstat.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fstat/fstat.1 b/usr.bin/fstat/fstat.1 index f49e628551b8..4d6e32438a04 100644 --- a/usr.bin/fstat/fstat.1 +++ b/usr.bin/fstat/fstat.1 @@ -310,7 +310,7 @@ $ fstat . | awk 'NR > 1 {printf "%d%s(%s) ", $3, $4, $1;}' 2133wd(alice) 2132wd(alice) 1991wd(alice) .Ed .Pp -Create a list of processes sorted by number of opened files in desdencing order: +Create a list of processes sorted by number of opened files in descending order: .Bd -literal -offset indent $ fstat | awk 'NR > 1 {print $2;}' | sort | uniq -c | sort -r 728 firefox From nobody Sun Dec 17 10:50:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StKVJ0Hvlz54RsQ; Sun, 17 Dec 2023 10:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StKVH6SSRz3gqL; Sun, 17 Dec 2023 10:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702810215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8cDhmbvrTPporci1jyEivrT1kvRmC6pWphAvgSBhJHs=; b=rGspE59RyroDM7+YYjHPcQqf5279WseWDwz1Zj/3MODh0LCgDi5X7N1lgUhZqK/Kf5ac2j u/SsS/Ig7Eodq7jjj9zk3zSQzmpAJ+5G+v3M2aSAC0U8hj18uDApWA+0lvord5/bffs1qx bR8rhd80hoLyM1vsbAlnQ2QIDrUiCh/OoNKE1lfBf1qPoyCJnViL0sGfzFxh9IP3CXD2Re vLM63rXDZLNnrGB1O5T/+DW3yUFKAEE9VpvuxPA+9Kk08QnAFf5iSakSCW2h84NBxZ4h5r Al8KLoKKBIgPfolmsxDJ9ljDxdFD6An0+FtW83Lii1o6jIob/91q+rmecXSwYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702810215; a=rsa-sha256; cv=none; b=tZe7m0/3qc5M2K/LPeu5I18A9YcjlUTkYKwggeqVJfl2HAgDlgF+KEL/Hl3kkabyTzgNgT q8ds0C7dPh4noX/bE5Awa/004Qh+9aPmpcfEDMmHSM98d5jjhGZWEFeRliVAZLypMSfNuj +152B8LPVAOf8I5XOi7ZVMZQjE+5cqNp0c6FuF8206gGo9GyEavnjjMjQPvLUIDbkiGnC7 P+ZQQZzJ6f9eb3PG2p7DNLziEffhngfwxNDy8i2riQGrbqIH6yRqNLle3H3LxatBFbvIQX G/Yiz77u9bsItG+pKB20P2GbwepZmBGl8dW8BxDNdLEkyGkHu5CMGGhHCqFKLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702810215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8cDhmbvrTPporci1jyEivrT1kvRmC6pWphAvgSBhJHs=; b=kFJkUSNC4a7ZcwofrujQXjihUET0yDInHh4Cnxf6mtXEhf01sfY72zkhqDMGT30sCm5QBr 5++0RtkPPmb4Zsi6IuWexmkDnaIS61+UtRqS6D/i2W2GNnYjCLWibeiWIzG4NbmYcrHI6z /NruzMK356w5qxfvkqDDc+smdVln+dTHB9e1iSx0xJfOsSyy9WpQAAAwm76Ymdq7sk0pcA dQm2UdUxRccs8T+ESxnZA4rF8Nu55kYXpdHNmeYv1ySvpaQnl1Q5eJLhrLkBgMQkc0NV9p aWgsGWzpLL0Nb8SUBm3j6T6Ce9AsDg1NOT/YzarDy+f03XY4i4D1aRJyCctq9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StKVH5FTrzZdF; Sun, 17 Dec 2023 10:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHAoFYh028450; Sun, 17 Dec 2023 10:50:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHAoFAv028442; Sun, 17 Dec 2023 10:50:15 GMT (envelope-from git) Date: Sun, 17 Dec 2023 10:50:15 GMT Message-Id: <202312171050.3BHAoFAv028442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 1a35ead68240 - main - mkimg(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a35ead682408aaf5276ded49aa0c6daa7e10672 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=1a35ead682408aaf5276ded49aa0c6daa7e10672 commit 1a35ead682408aaf5276ded49aa0c6daa7e10672 Author: Yu-Hsun Chen AuthorDate: 2023-12-13 11:15:06 +0000 Commit: Li-Wen Hsu CommitDate: 2023-12-17 10:49:28 +0000 mkimg(1): Fix typo This is from the Advanced UNIX Programming Course (Fall’23) at NTHU. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/930 --- usr.bin/mkimg/mkimg.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1 index a073265c21ba..adf0e2707e22 100644 --- a/usr.bin/mkimg/mkimg.1 +++ b/usr.bin/mkimg/mkimg.1 @@ -223,7 +223,7 @@ The preferred file extension is ".qcow" and ".qcow2" for QCOW and QCOW2 This file format is a sector by sector representation of an actual disk. There is no extra information that describes or relates to the format itself. The size of the file is the size of the (virtual) disk. -This file format is suitable for being copyied onto a disk with utilities +This file format is suitable for being copied onto a disk with utilities like .Nm dd . To write a raw disk file, either omit the From nobody Sun Dec 17 10:50:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StKVL0Mskz54RqG; Sun, 17 Dec 2023 10:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StKVJ6wlGz3gvt; Sun, 17 Dec 2023 10:50:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702810217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wEbDFvr+Edja8ldCRX8kO8vADUq9rWmu/PU/d7GXcM=; b=IHywW10aGwJVpDqFdaGn7oKmXKA+LWjKKpLxh3AayYy1uYxBTelYygGVnmYRKbfZYEPM9Q qAzzsTEd1UTumwZnFjSkJdyiWLotZXjpkILzZjrQaueFzsu6c6ZImzuerQtuFSxTIWNhRr Cc+oj9dWFJqQcUot9f+j2YfXz7qUzBpvV8hL1Y4QPbLsOw54oOnzn5KshkhPnNJM77ge/h t7Rfs2T+Ws46ip5jMOjQBEKY0UeFpUcZ3Qbwg9HUURPWbDLtGVYXfg9lacKRuR/0Yu/OrF h4nDBGyeet5YSXcuUyE2K5A9Q8SRCcCtk8w5YubPgpUIuw2zc/csw8oYbP3C5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702810217; a=rsa-sha256; cv=none; b=HCuF7nCkoiGVwXrAMmf6o3M4Y4YNEpOUthnOg4J4JWRukrWtLoRSsl/2v5K34/XHN14hlw ERz5JGhF41oGkmvXfZld6NqvFDuDbjAUxnkIfd2nfXKZprJ6k32YwTA8FbP5B4quy6cNcl YQTDfZe4kLqLKA9CMI8pvhye8IXfEq9NojfibxpJQ0FScZMgXASE7tworErPqYTiSA29h7 WCCCfw2Qi0IK06m/AFcpn++h795Gu2lx2D31u60bSQzs4DnepnZM7uciCOs+87m6iIsHfj 0SN4aU/CDQQgTGcqb8/lEvHgh0yOf81dnn+yGvg1HaptvHQIA9XgotMNSkVofQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702810217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wEbDFvr+Edja8ldCRX8kO8vADUq9rWmu/PU/d7GXcM=; b=OULeGYnZE/s7fwn7pqUNtr6OLdk7YjKEn2PPW9556WYI6+8ohDc+hA4jT+CIwC9SiDog37 f73AxT7ryII2oW2MJ302F6k2cOMBvml352l7jV5ThBIjSe8OiFsh+TlZc64DRr1HUQRF8+ 3PRRG1Mw2a2Ubmj8LabQFmW4vdzGtYrcqFEGE+zxbmqYZUVGBdo5Nb3DsSbdOseMGSb4op k0xuKahPZ92JVfZqr2bFcyj+esaS9/6GiEuDkzjVmks8jULG+GzvhbEUF2YYvBHsXGbEP6 sGW1HWdbUODkgtjbeaDjLuVKUIh/Mmy7bCAf87lWppwr9DRnilwMKLt24BU7og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StKVJ5lNXzZrv; Sun, 17 Dec 2023 10:50:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHAoGIl029089; Sun, 17 Dec 2023 10:50:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHAoGWI029083; Sun, 17 Dec 2023 10:50:16 GMT (envelope-from git) Date: Sun, 17 Dec 2023 10:50:16 GMT Message-Id: <202312171050.3BHAoGWI029083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 452c3e9514cb - main - mt(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 452c3e9514cbaaced8997458e34bb07b51c29bc9 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=452c3e9514cbaaced8997458e34bb07b51c29bc9 commit 452c3e9514cbaaced8997458e34bb07b51c29bc9 Author: Yu-Hsun Chen AuthorDate: 2023-12-13 11:31:32 +0000 Commit: Li-Wen Hsu CommitDate: 2023-12-17 10:49:42 +0000 mt(1): Fix typo This is from the Advanced UNIX Programming Course (Fall’23) at NTHU. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/931 --- usr.bin/mt/mt.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/mt/mt.1 b/usr.bin/mt/mt.1 index a056ef1926ee..4cafdf4437c7 100644 --- a/usr.bin/mt/mt.1 +++ b/usr.bin/mt/mt.1 @@ -339,7 +339,7 @@ For example, specifying .Fl w Ar 0 will enable all settings except for LBP_W. .It Fl l -List available protection parmeters and their current settings. +List available protection parameters and their current settings. .It Fl L Ar len Set the length of the protection information in bytes. For Reed-Solomon CRC, the protection information length should be 4 bytes. From nobody Sun Dec 17 14:19:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StQ875zKkz53hVC; Sun, 17 Dec 2023 14:19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StQ875Nslz3M1B; Sun, 17 Dec 2023 14:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702822791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pysqSNPijT00+lyRR06/Fz3nGWEsSNx1jwn/utBC7WY=; b=NGO2X+CYhcpUa0ZDJdIgizpqGlTIGXjvj0zbq3r/MVLsWV2sojteHVj0V19LEQNjXaEhKN x8Ojrz5loy2VcdkJcx0NUluuVQ/3JX//Fz/GCHE56AqR5sR53cdUYUNTsehrDO0VEf6CDX 4wW+XsZYTzC+z8dvaEKHP7PBrZn0FN213uDehH2Fy2YC8nYMMRBKVu/rel8NXpIrGIYCWQ AeoHeQ7pbIgZoqb6+VA1AsaAYyNvMfb1f/LMLxjju6IYTGVXRPN0ZyRh1Z3sYrEGjNefTr 1GRSt76AQLNxS4drhNzIiJg2PuV7ZWRSSS5BDU/YRY+o6YpeGUQQLUBsDw/OcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702822791; a=rsa-sha256; cv=none; b=EATkoDqd1+ciTza0GmslHThmM6KI1PX8X5ssliGknOmf9HRot0n5/B1uGtlkuNK9jseMxg XoGPbRbFVYgmRZZ5ewgYRhDDXM1FiUtPn3jnSJE8vuGo+K8c12TTCfzvwJWsuk46A5KAX6 BVh+D41+MX5DFfLPi0FtBNLMVkrXkUJveGnnoGQYVkaBehQ+PBNfkukq+7CB+wDypPNwS8 +mu1tvvQ1PsJ1Y9x6TdLpVqZd+xkIDJCAMASc6GwF4eTGthGaZL/lVD31kqTb32VVd6yfF 298xVz2k02d36czWk2mdYwvuNq5bltyy2zMlLnC9URWLdaZFDCkZE/J33nH8RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702822791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pysqSNPijT00+lyRR06/Fz3nGWEsSNx1jwn/utBC7WY=; b=dyDph46llSCQTTDr6EufsuV0XuK4/t8KRzR9EuNIQlCACU23rjnULc1DftW79Hh+c7kWxv WgM7i65Q6wO3HTxyr7jNE5R5A251Lc3rs5sOs6S7nCPtNR52snC4ZUnlAD1Hd/fIXryFrT AEU1TygF/hXa1weESDwtKWI23FAVcYiM1kjl5jef+ObRBFKN3bhyYodpA668Bdd3UVUunl iIS5tQ6OXJC6fGsBJhGkt6ABkLVCHj1jaPLHMdkGoEAYkkHeOCHclJiat8Xe1MIIZZ2L1i gdJ1VZb5RHOnKNMglLNHkRNx3n44539K/OdHjSHoah4VBGrFWSUCT5DshX2PWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StQ8749FlzgyP; Sun, 17 Dec 2023 14:19:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHEJprs073071; Sun, 17 Dec 2023 14:19:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHEJpmi073067; Sun, 17 Dec 2023 14:19:51 GMT (envelope-from git) Date: Sun, 17 Dec 2023 14:19:51 GMT Message-Id: <202312171419.3BHEJpmi073067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: ada4cd3f7710 - main - qat: Fix two typos in source code 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: ada4cd3f7710d9759e391e84ad21b7763062bdbc Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ada4cd3f7710d9759e391e84ad21b7763062bdbc commit ada4cd3f7710d9759e391e84ad21b7763062bdbc Author: Gordon Bergling AuthorDate: 2023-12-17 14:18:57 +0000 Commit: Gordon Bergling CommitDate: 2023-12-17 14:18:57 +0000 qat: Fix two typos in source code comments - s/parmeters/parameters/ MFC after: 3 days --- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 2 +- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h index 934ad2520774..370b7e2397c4 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h @@ -1194,7 +1194,7 @@ cpaCySymSessionCtxGetSize(const CpaInstanceHandle instanceHandle, * minimum memory size needed to support all possible setup data parameter * combinations. cpaCySymSessionCtxGetDynamicSize() will return the * minimum memory size needed to support the specific session setup - * data parmeters provided. This size may be different for different setup + * data parameters provided. This size may be different for different setup * data parameters. * * @context diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h index 479cb72c2cf2..7f103ec98e51 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h @@ -559,7 +559,7 @@ cpaCySymDpSessionCtxGetSize(const CpaInstanceHandle instanceHandle, * minimum memory size needed to support all possible setup data parameter * combinations. cpaCySymDpSessionCtxGetDynamicSize() will return the * minimum memory size needed to support the specific session setup - * data parmeters provided. This size may be different for different setup + * data parameters provided. This size may be different for different setup * data parameters. * * @context From nobody Sun Dec 17 14:52:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StQsV5xxYz53kfj; Sun, 17 Dec 2023 14:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StQsV5V3Bz3FC2; Sun, 17 Dec 2023 14:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702824734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nrJZGlLuZuc+ZmeJ60JGIz0ai2pgQopL1RmMkOE5JFI=; b=LhG1/zYXYjwnW8GEvi0rw7dU/ADSPINAxiA+4pSwpPa6/4Hwizml2QGz1VD8cLg9PvDK8k H9PBre0HYK9zHIiNOeeI6aAdEQP7a82R/fmpYCxl0JhH8yPpaGDIjV80mu2hhyVlYZWKYM /iFFlA45gKun5xIMu6mFDRNKEi8I7LmAM6T1R/cVetfV/HDkAsODo28gZD7C185FDIg6gr bjDyYPytDnmc7VSfVuwnmUUOpI/RTip9h01Pi6FAT9zLLWDZNrNibWExCukl7wmbVfFtMo l4c+AFmjJ2Dul5PG1kIcpLWUjjgjooy5n9waeh6WuTUeWz8yAwe3QKOIH6vaVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702824734; a=rsa-sha256; cv=none; b=jYPhVW8Uw8kc/XLpxXwaQ4Q68M86zIwEEM3eDHS+DdvVBJWbYS6iTN8gGEJbY46UheST9C /5lFXJj+wYfWox2DPJY7OkBn+EAjn56sqZxl7O1U6KVh7Dt7n2duCX3It86sie1eBRoHvW bJeVkBCM7vUI0HZ2SsRXHfrf+k9oupnDmWYKdwpGVUCpGjwsBwu6ZvPibMc+wW1dw+Okzs /SMClc0j828ePYGvJKbWWsvzW4p+m6SgczfGdeLlRcCAxiE/qfxVD93Ri6OpOgX+LQqmcb U6ZAip8scim/6HEBuSmf5haCLXs9m1AhHBx5WAHddcjdSg8BOQpDUQKp1Ja6ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702824734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nrJZGlLuZuc+ZmeJ60JGIz0ai2pgQopL1RmMkOE5JFI=; b=GAl3V/3Tv1ruPsn9fbTGVSp+euXbHSsV9JW0RQiyN/bY50PbY2OCcWCu2svdp2hfyJvoWQ 1C26HRiXPY55NTKFdeaoLQCJ7g+C8GeEtMpnBPd4GzTwNWKvlkztKM51/gBP2RhxNjWoKt Jt0PduY26ykGbsxZG22lcZ9t9O9h6CTxcTneJZWwh7rFYFfla0L+Lh2h1ib28VCHwv2krm Em6mnNAX3m0cBq+EtxmYNq4toXfgxQz6Pt9VI614YYmHDq6ujCrf8lu2e4ZKkXftz4ufzc stAkRfx1M3eNIObdDFVjtMbWWuNtLHDACDvMF49lImnOncBuTJIvey0HpM/4Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StQsV4bn8zhgC; Sun, 17 Dec 2023 14:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHEqEQo036246; Sun, 17 Dec 2023 14:52:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHEqEpt036243; Sun, 17 Dec 2023 14:52:14 GMT (envelope-from git) Date: Sun, 17 Dec 2023 14:52:14 GMT Message-Id: <202312171452.3BHEqEpt036243@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: 9c452f50784f - stable/14 - iostat.8: Better wording for some use cases List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9c452f50784f5dddc406508d57a5ed288493f78d Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=9c452f50784f5dddc406508d57a5ed288493f78d commit 9c452f50784f5dddc406508d57a5ed288493f78d Author: Gordon Bergling AuthorDate: 2023-11-26 18:30:58 +0000 Commit: Gordon Bergling CommitDate: 2023-12-17 14:51:53 +0000 iostat.8: Better wording for some use cases The iostat(8) manual page should be more specific when using options. Also extented the BUGS section. PR: 153012 Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D42633 (cherry picked from commit 502e8f44fcc18bfc6dadca56801d66cbce4c07ec) --- usr.sbin/iostat/iostat.8 | 64 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/usr.sbin/iostat/iostat.8 b/usr.sbin/iostat/iostat.8 index 863f8ab8466c..ebeea17fa037 100644 --- a/usr.sbin/iostat/iostat.8 +++ b/usr.sbin/iostat/iostat.8 @@ -54,7 +54,7 @@ .\" .\" @(#)iostat.8 8.1 (Berkeley) 6/6/93 .\" -.Dd August 29, 2023 +.Dd November 26, 2023 .Dt IOSTAT 8 .Os .Sh NAME @@ -83,7 +83,12 @@ The utility displays kernel .Tn I/O statistics on terminal, device and cpu operations. -The first statistics that are printed are averaged over the system uptime. +The first statistics that are printed are averaged over the system uptime +(unless +.Fl I +is specified). +Any references to repetitions in this man page implicitly include the first +statistics output. To get information about the current activity, a suitable wait time should be specified, so that the subsequent sets of printed statistics will be averaged over that time. @@ -101,14 +106,11 @@ is specified. Repeat the display .Ar count times. -If no repeat -.Ar count -is specified, the default depends on whether -.Fl w -is specified. -With -.Fl w -the default repeat count is infinity, otherwise it is 1. +If +.Fl c +is not specified and a wait interval is specified, +the default repeat count is infinity. +If no wait interval is specified, the default repeat count is 1. .It Fl d Display only device statistics. If this flag is turned on, only device statistics will be displayed, unless @@ -130,8 +132,11 @@ per measurement cycle. Display total statistics for a given time period, rather than average statistics for each second during that time period. .It Fl K -In the blocks transferred display (-o), display block count in kilobytes rather -then the device native block size. +In the old-style blocks transferred display +.Po Fl I +and +.Fl o Pc , +display block count in kilobytes rather than the device native block size. .It Fl M Extract values associated with the name list from the specified core instead of the default @@ -145,7 +150,7 @@ Display up to number of devices. The .Nm -utility will display fewer devices if there are not +utility will display fewer devices if there are less than .Ar devs devices present. .It Fl o @@ -220,7 +225,7 @@ Passthrough devices The user must specify at least one device type, and may specify at most one device type from each category. Multiple device types in a single device type statement must be separated by -commas. +commas and are ANDed together. .Pp Any number of .Fl t @@ -234,14 +239,16 @@ Any device that fully matches any argument will be included in the .Nm output, up to the number of devices that can be displayed in -80 columns, or the maximum number of devices specified by the user. +80 columns, or the maximum number of devices +.Pq Fl n +specified by the user. .It Fl w Pause .Ar wait seconds between each display. -If no -.Ar wait -interval is specified, the default is 1 second. +If +.Fl w +is not specified, the default interval is 1 second. .Pp The .Nm @@ -516,3 +523,24 @@ The use of as a debugging tool for crash dumps is probably limited because there is currently no way to get statistics that only cover the time immediately before the crash. +.Pp +Each +.Ar drives +argument is passed to +.Fn isdigit . +If +.Fn isdigit +returns true, +.Nm +switches into an undocumented traditional syntax and subsequent arguments, +if any, will not be interpreted as drive names. +This behavior collides with the one documented in this man page and prevents +specifying drive names starting with a number. +E.g., the following +.Bd -literal -offset indent +iostat ada0 ada1 2 3 cd0 +.Ed +.Pp +This document's use of +.Dq device type +is misleading. From nobody Sun Dec 17 14:52:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StQsq2R0Gz53l09; Sun, 17 Dec 2023 14:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StQsq15zDz3G0g; Sun, 17 Dec 2023 14:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702824751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K9HVPCYzx+CZ3kPIY1xSc5KgClSZbqA9Co1m/KpjU08=; b=djZHoL2Zhn+ELg1Br50v5yd1TNlCGBkzmGGxhdTeW1PYl1XYm4oa5nhYzzEz9LtAkCfFRW rWOQcAsW8zZsxV/5BDDuvYAGtJnax42mTLdfkWUejOGtVvU8nX9rzXs8EZ5rtwd51t5gam kZAPyIn1rNw/z19yQju5puwEk+K3bEDQXNT+PjRtI5sa1WMB55990MRkkzv1UyhlYj++u4 BIQdpWrUFsVkfsDCmgHYL63f2X7A4kep0icyNS63AFI/gK0U5ql4fOed5yH8OqN7WpfAoV P1j6/Hxa7gMcGCqcWHksc3hJgdgniCfyuglMpl8FOIwFVqvJMzAnUibVRa/c4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702824751; a=rsa-sha256; cv=none; b=V6LX+1YuNBdwt+2JLy3meC/Qza5rnWwZXa00bdhti/YI4Whrt0bDRVvjR+LaGSQDP95RvX 7mgLq1datRhMYrO6uQBRCoBS1GI+xflg6uM/8Rll+K47evYNy3Ek+WHBG1UVaaDvJRBDzL Qc63uZ+v8N+kMq+lskWCB28Dkv56rKc3h6rklyN4NPZ7AD8uUK9CLWjF5XDf8e4bQoqz6A D0PpVKVbGbqn/eWLunQg69aeavnF+MR+wJHbJGKGOEdMLDlMhHCyX9eoc/lvW2eausZqb3 v3satmfMA7WxXTi6oTo0SqbKtNnd1aZkRbW4gXTEckYSUflle/GUJ5L8M1IG2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702824751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K9HVPCYzx+CZ3kPIY1xSc5KgClSZbqA9Co1m/KpjU08=; b=R7VEymgVob4tAASWpEz3LxDNQ06bRgP7KCDBkhoIrJg0mZSAfipi3YXZ1fiR01waMkrkyF xK4Y1WqEB/Z2aNouCY16jE99eqXgD0Ua6VpMLFxSn/ktGVIk5Ff6X3EaJJHZGOvVFSsJEn 9TgqqHfPw6IIEHwwr+SGAT0+xP+UNRI4M8W2pbNF2EKBFvTM51qqWJk0/ceXh8QBEX0O/9 mPkJ1k+PJFuyP12nI+o8+JajA6IL7gekBjjBvOSN76SI2RNyWheP6Y+//gr87ie86H8tcP L3KpVpw4QrOWGZG9jPgGccYKpXi55C58PDOiFXeXC/3IcpEChwY25i1aJUoUHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StQsq08KDzj1g; Sun, 17 Dec 2023 14:52:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHEqUSN038621; Sun, 17 Dec 2023 14:52:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHEqUkL038618; Sun, 17 Dec 2023 14:52:30 GMT (envelope-from git) Date: Sun, 17 Dec 2023 14:52:30 GMT Message-Id: <202312171452.3BHEqUkL038618@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: f5f993f6c913 - stable/13 - iostat.8: Better wording for some use cases List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: f5f993f6c9134530fbeac712589b3a6363a37286 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f5f993f6c9134530fbeac712589b3a6363a37286 commit f5f993f6c9134530fbeac712589b3a6363a37286 Author: Gordon Bergling AuthorDate: 2023-11-26 18:30:58 +0000 Commit: Gordon Bergling CommitDate: 2023-12-17 14:52:21 +0000 iostat.8: Better wording for some use cases The iostat(8) manual page should be more specific when using options. Also extented the BUGS section. PR: 153012 Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D42633 (cherry picked from commit 502e8f44fcc18bfc6dadca56801d66cbce4c07ec) --- usr.sbin/iostat/iostat.8 | 64 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/usr.sbin/iostat/iostat.8 b/usr.sbin/iostat/iostat.8 index 863f8ab8466c..ebeea17fa037 100644 --- a/usr.sbin/iostat/iostat.8 +++ b/usr.sbin/iostat/iostat.8 @@ -54,7 +54,7 @@ .\" .\" @(#)iostat.8 8.1 (Berkeley) 6/6/93 .\" -.Dd August 29, 2023 +.Dd November 26, 2023 .Dt IOSTAT 8 .Os .Sh NAME @@ -83,7 +83,12 @@ The utility displays kernel .Tn I/O statistics on terminal, device and cpu operations. -The first statistics that are printed are averaged over the system uptime. +The first statistics that are printed are averaged over the system uptime +(unless +.Fl I +is specified). +Any references to repetitions in this man page implicitly include the first +statistics output. To get information about the current activity, a suitable wait time should be specified, so that the subsequent sets of printed statistics will be averaged over that time. @@ -101,14 +106,11 @@ is specified. Repeat the display .Ar count times. -If no repeat -.Ar count -is specified, the default depends on whether -.Fl w -is specified. -With -.Fl w -the default repeat count is infinity, otherwise it is 1. +If +.Fl c +is not specified and a wait interval is specified, +the default repeat count is infinity. +If no wait interval is specified, the default repeat count is 1. .It Fl d Display only device statistics. If this flag is turned on, only device statistics will be displayed, unless @@ -130,8 +132,11 @@ per measurement cycle. Display total statistics for a given time period, rather than average statistics for each second during that time period. .It Fl K -In the blocks transferred display (-o), display block count in kilobytes rather -then the device native block size. +In the old-style blocks transferred display +.Po Fl I +and +.Fl o Pc , +display block count in kilobytes rather than the device native block size. .It Fl M Extract values associated with the name list from the specified core instead of the default @@ -145,7 +150,7 @@ Display up to number of devices. The .Nm -utility will display fewer devices if there are not +utility will display fewer devices if there are less than .Ar devs devices present. .It Fl o @@ -220,7 +225,7 @@ Passthrough devices The user must specify at least one device type, and may specify at most one device type from each category. Multiple device types in a single device type statement must be separated by -commas. +commas and are ANDed together. .Pp Any number of .Fl t @@ -234,14 +239,16 @@ Any device that fully matches any argument will be included in the .Nm output, up to the number of devices that can be displayed in -80 columns, or the maximum number of devices specified by the user. +80 columns, or the maximum number of devices +.Pq Fl n +specified by the user. .It Fl w Pause .Ar wait seconds between each display. -If no -.Ar wait -interval is specified, the default is 1 second. +If +.Fl w +is not specified, the default interval is 1 second. .Pp The .Nm @@ -516,3 +523,24 @@ The use of as a debugging tool for crash dumps is probably limited because there is currently no way to get statistics that only cover the time immediately before the crash. +.Pp +Each +.Ar drives +argument is passed to +.Fn isdigit . +If +.Fn isdigit +returns true, +.Nm +switches into an undocumented traditional syntax and subsequent arguments, +if any, will not be interpreted as drive names. +This behavior collides with the one documented in this man page and prevents +specifying drive names starting with a number. +E.g., the following +.Bd -literal -offset indent +iostat ada0 ada1 2 3 cd0 +.Ed +.Pp +This document's use of +.Dq device type +is misleading. From nobody Sun Dec 17 18:31:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StWkk2Nzgz541Mt; Sun, 17 Dec 2023 18:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StWkk1kSvz4fwM; Sun, 17 Dec 2023 18:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702837902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxdKVjRff3m03mPqJQFNbf8iiJc/0Vo5AqG0ivedgys=; b=TabbnPJWuZTWP8QAl/VNh9qUlbrpPh9HMiMLxgjeP7cCoTR9nHPdWwlYKYBFZfAuDKm4Vm hlAnZALlsop56KHV/kFj5dhy7zVq6TkzYTyC6FOI/t3zYhKmcVZRKsbeP97OfdB+fS5Na0 ibMkyb08NrkAanu/K0rQwqrmS42hhP8tMJDfHASmUXprmt5rW+n8Ldj6IjXQQ+l/QVRf2f FdrxUgntrK9IX+sR/PV+vmQClRmlplh4SBPFwiwN0Ju8bC35fgqUeHxXzBfL62ubfD4MBQ SqzW7/EupR5zfcBZ+4wOzSmsubbafnF4F8QH/TWyZLk8V1R5m0gw/0IeNM4klw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702837902; a=rsa-sha256; cv=none; b=BATeTAYAh1Xhs5+IoxwXc/jscE1D6pyC536ZH7+9H0XBM+G40+qi8sxz3iHuKWYPVTSb1p cBQaiYWN4HRt4G0Xr2rdRG4L2Hb4UkzXZ4HYrsfsIqMI+KtOC4Txk0CTxYXqUCWFiOZSPB izSu8BrYCsmdhwwdYX1hIa6LX3WZl5Gv8CiH8AUwvqJbXzoVn9k65pK7dT5R8RVU5+LrLv fiMaKYgjTLTG6VaMAnHPU+UWqyiaSSmgamFfqUr7K1BjhvuOHcp034Wb3lDshS6kWM36U4 lRDXFGPc5dpb7m6melGpT9tHfto7SmYrrbinoJsru+ph4wK/n2dva1uQNFvIgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702837902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxdKVjRff3m03mPqJQFNbf8iiJc/0Vo5AqG0ivedgys=; b=F6MnetC0iC6RnX45nAdTvSyxX/9wilB3bRDR7pnacAhS0zbfIc0oz41Iv5uCHJK27AzrQy joaiAOdGGeJHavMNcVOAjXlcElBT1CPYT3C8oZB260B0j4IznF3AcCSXw+/igJtxWk9T9F cXK7eG0AnSH2miXbiuxCvdAIyi2s6bLH7JzLX3ge7aJc9y2OjO//WMWRL6we8ppUbBEQbO 3o0OPljgCOuZ/ORjP1frD30WXiyv4hyVvmmujarmhydd0DiVJPCoo6g8oXaeaDyNmwpFjU K0iV7Vwv7APpZAW5jfX4FNUlY4BEAI5N+NqJf4ShkRhw9mGy6sK+Y7Bv4pT2Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StWkk0r8czpGF; Sun, 17 Dec 2023 18:31:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHIVg6E004380; Sun, 17 Dec 2023 18:31:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHIVgjE004377; Sun, 17 Dec 2023 18:31:42 GMT (envelope-from git) Date: Sun, 17 Dec 2023 18:31:42 GMT Message-Id: <202312171831.3BHIVgjE004377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 4fb5eda6493c - main - tcp: Remove the documented dependency of TCPHPTS for RACK and BBR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 4fb5eda6493c3dada695efbfad0a44d204b7fc5e Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=4fb5eda6493c3dada695efbfad0a44d204b7fc5e commit 4fb5eda6493c3dada695efbfad0a44d204b7fc5e Author: Gordon Bergling AuthorDate: 2023-12-17 18:31:16 +0000 Commit: Gordon Bergling CommitDate: 2023-12-17 18:31:16 +0000 tcp: Remove the documented dependency of TCPHPTS for RACK and BBR Since TCPHPTS is now included in the GENERIC kernel, remove the documented dependency of it from the tcp_rack(4) and tcp_bbr(4) manual pages. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43084 --- share/man/man4/tcp_bbr.4 | 8 +------- share/man/man4/tcp_rack.4 | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/share/man/man4/tcp_bbr.4 b/share/man/man4/tcp_bbr.4 index 9944f6127ddd..fb1023dc81c6 100644 --- a/share/man/man4/tcp_bbr.4 +++ b/share/man/man4/tcp_bbr.4 @@ -22,19 +22,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 7, 2022 +.Dd December 17, 2023 .Dt TCP_BBR 4 .Os .Sh NAME .Nm tcp_bbr .Nd TCP Bottleneck Bandwidth and Round-Trip Time Algorithm .Sh SYNOPSIS -To use this TCP stack you have to place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "options TCPHPTS" -.Ed -.Pp To load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent diff --git a/share/man/man4/tcp_rack.4 b/share/man/man4/tcp_rack.4 index cfdedb9901b8..791b48baf6f6 100644 --- a/share/man/man4/tcp_rack.4 +++ b/share/man/man4/tcp_rack.4 @@ -23,19 +23,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 19, 2023 +.Dd December 17, 2023 .Dt TCP_RACK 4 .Os .Sh NAME .Nm tcp_rack .Nd TCP RACK-TLP Loss Detection Algorithm for TCP .Sh SYNOPSIS -To use this TCP stack, place the following line in the -kernel configuration file: -.Bd -ragged -offset indent -.Cd "options TCPHPTS" -.Ed -.Pp To load the TCP stack as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent From nobody Sun Dec 17 20:31:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StZP50khvz54CHt; Sun, 17 Dec 2023 20:31: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StZP41q23z4Djj; Sun, 17 Dec 2023 20:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khKTkKm1lmMGxSYfacfiN8G4Mk2mY/APZ44KlY2o7/I=; b=orZv6gDhcMCVmBtp8iTGIQv3L3HlTQenz/n8BgQ3W3jka3ccUT0D9BxyIK8JVQxDGy2pTL I1pSRVlM8fFr59+1cy4J0cXbv+QxDROH7HrGCZp46qb6TxqBZ3E6x5oTfHB+2WaU9uX68t IhZu38xq2JsVnvz3czh194W43PTGIRzIT8jCbnijN0S4g60GxzCF2G3WDd07sAOdUhDRcL Bp0nHsUUMvQ1ppOXriyW4s/4GjeIzJnup8F+pd5QehlL6jE7TNFtlSgSBGZtLz0IDB87jG 0w3vVVTKTeQ7R5wYq8/A+PC/1tmyaC0gdDCNN4pFCnnjoi68bJgAm5CfiPXOMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702845096; a=rsa-sha256; cv=none; b=Gyvmq3Jli3yGOwb/rO4/q61xa1LpbLFlBMBWD3HY8PD24GzLHPKsipBVZDVgYThkC/mO2W UpkLsUy7rQOAmmsh/OaUXr+wK5g8GC6/L6SFfSfEj+p4Im0Dz/m/3gV836QB7/BFxZE/N7 MkD9/HU5xaG/2VMXIlLx9aaFttIHXjgO44xUVopNx+M/PtQB4rU6qbwrtDHo6MxJKv9f7h OwpBmlUMnvLCZiXTYgbOhvZtzghNodDPmus3+fb9d8IJVtZJdYlyatF8EmrwSIg154cHkP TYRmC8jACxhUi4LQiFJj0zdIIe4RAoE2OQ1/E4exq5Hx0cKd8RXP1MAqnibrIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=khKTkKm1lmMGxSYfacfiN8G4Mk2mY/APZ44KlY2o7/I=; b=aes4rSiJXZK4r41yguLM6cpBTqkaxGom4oKO1mjdgfUAQtlT6LBO/R6NAkkXykcKv01uEm vMnn7xDVfaEUqrwPFZirJUEYobLs4ljwufqY4CYyS8enOg3FEm4qOxYRN5ENDpcYVXO0Yp D+GJQIUrD35ikGkU98Ulmo7g8mRFtJiAqsBDOl3XvZsEeQf2IWrQLqkdeNnyO55iqTwops JI8m+sTMNABilSN6e0GOfnctCs8mXfJxbx7Dyj6KSIeFVJSq77CR/G/cE8d2ADdEFmJy1n hZVVMNViX/AXPQn2KnFL1gGyjXq26gxvoF6drbOX6WINgpMRnswLMo+g3wwpaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StZP40w8Zzs2j; Sun, 17 Dec 2023 20:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHKVagl004625; Sun, 17 Dec 2023 20:31:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHKVaFc004623; Sun, 17 Dec 2023 20:31:36 GMT (envelope-from git) Date: Sun, 17 Dec 2023 20:31:36 GMT Message-Id: <202312172031.3BHKVaFc004623@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: 71ccbf895655 - stable/14 - nfscl: Fix processing of a rare Rename reply case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 71ccbf8956556962e6199ca277afe16f76a9a1fc Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=71ccbf8956556962e6199ca277afe16f76a9a1fc commit 71ccbf8956556962e6199ca277afe16f76a9a1fc Author: Rick Macklem AuthorDate: 2023-12-03 23:31:01 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 20:30:18 +0000 nfscl: Fix processing of a rare Rename reply case When delegations are enabled (they are not by default in the FreeBSD NFSv4 server), rename will check for and return delegations. If the second of these DelegReturn operations were to fail (they rarely do), then the code would not retry the rename with returning delegations, as it is intended to do. The patch fixes the problem, since the DelegReturn reply status is the second iteration of the loop and not the first iteration. As noted, this bug would have rarely manifested a problem, since DelegReturn operations do not normally fail. (cherry picked from commit 6aded1e6b2e5549120031032e1c7f8b002882327) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index c986b3927f1b..42264c947f32 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3006,7 +3006,7 @@ tryagain: ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) { - if (i == 0 && ret > 1) { + if (i == 1 && ret > 1) { /* * If the Delegreturn failed, try again * without it. The server will Recall, as From nobody Sun Dec 17 20:32:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StZQd5xsYz54CTV; Sun, 17 Dec 2023 20:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StZQd5KKMz4GSV; Sun, 17 Dec 2023 20:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCT14qZGM6K3nw6/iqGQRU+yKLNSEbkQZM/jQQDxJl8=; b=xt/9JdTUPOtVZEU+RC4zuKEErmIXGb7sS5lhLu+7+RgUhlwwEgOfVS7LWHpmGH8ccf40PZ uDNgk0hFGsMiknNJ0AtXUiJkae/EHlljv8cjgV8LmA/I+MSsy9XzKJDk+eBotALUMKeRBw +gWNFAqAaC/+InjUfHoGFL7OhEL9Yu9GZfvoAxNo29s4lmyUsha6CxiPu0cBXsLDBfnCaA vjIjKkGVgdgrHOqsvJ0M+NWcfJmk5w3aIvrzRMP6UW3ttP7b8YbL9KYPb4obx9jeRQEq4t IrI17GVTEDzn9wO6Zle6uXfXB1kAjn77vB5aha7CZywbKXyczL5UDYvYjjKe8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702845177; a=rsa-sha256; cv=none; b=QJxF0ixGVL/mj4DPWBABqgmAVLPlJt05wC/8vOJi2UZNJT/g8EOwfwhCvHRVbBmceO3DMx JRJU+mrbEm1J3+N6v7I+r5wHMw3h27GLgs+mFg9zQ5DsykcDld96qattthuNNAB4JSqMkd p9hoyv4rGzmZbabRhYs6Y7hLiJ4i9B4oOlFSvWnXIJq9GxktEtL/NvLGC3cQxrUTfmCmGU 7OwBx6W4PFS4+kdCAVxNnw2H01GFUOLVR9ZvJpgx3FPuemy+uSuxJO4eKbBhdHsM8Dty2+ qAd9scCkN0PPZGa5x4cGOneTw3hV/0Mpnlne9OcRZLA1Uba6qp6r5IEW+T9GWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCT14qZGM6K3nw6/iqGQRU+yKLNSEbkQZM/jQQDxJl8=; b=frxA+2DUyqqFczJ08KIGNT+cucqqrTDXogy/x6sgR+n1PYF/NcvS5z/4lJVxOrjeSGlccK gTVYN51/eAIMDW9XaRfkEM1znU+xlsuwsJY63Px9DNU9+dkC0d5cj7x0igPLrJdvgotefg hwNh0Eku5zToAkcGr38P5EcRXkVnCa8kFxQAWsb48gSW+FGNgupcOliJi4IIG/chTEYO3p YwzOK3tebT8Umqbgy0Yauq8cPmGlRjV9STSovoxWBjx5h/yI+cCxI9P7jYfnhGXoqZRnZ6 ZrkJGUo5ftKmvybj7sAOgDyGHkdAM9GBMMEYuCPiJBQgh33/PsJojbamyXgqYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StZQd3fQmzs5P; Sun, 17 Dec 2023 20:32:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHKWv2x009299; Sun, 17 Dec 2023 20:32:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHKWvKw009296; Sun, 17 Dec 2023 20:32:57 GMT (envelope-from git) Date: Sun, 17 Dec 2023 20:32:57 GMT Message-Id: <202312172032.3BHKWvKw009296@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: 5bb8278584ad - stable/14 - nfscl: Fix comment for commit 6aded1e6b2e5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 5bb8278584ad0c19ad881f807bb1ddf202d821ab Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5bb8278584ad0c19ad881f807bb1ddf202d821ab commit 5bb8278584ad0c19ad881f807bb1ddf202d821ab Author: Rick Macklem AuthorDate: 2023-12-04 00:12:14 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 20:32:08 +0000 nfscl: Fix comment for commit 6aded1e6b2e5 Commit 6aded1e6b2e5 fixed a rare case when handling an NFSv4 Rename reply when delegations are in use. This patch fixes the associated comment. (cherry picked from commit 0a958aa16fed1978879d64e3b225f1d232cc5a98) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 42264c947f32..12ce568dbedd 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -3011,7 +3011,7 @@ tryagain: * If the Delegreturn failed, try again * without it. The server will Recall, as * required. - * If ret > 1, the first iteration of this + * If ret > 1, the second iteration of this * loop is the second DelegReturn result. */ m_freem(nd->nd_mrep); From nobody Sun Dec 17 20:42:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StZd56Wx0z54CsZ for ; Sun, 17 Dec 2023 20:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StZd55qjVz4Tj6; Sun, 17 Dec 2023 20:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ow6zWi9c0LgbpPTGqpaIaSPgxdo5VvCsEHxy3DEyX+Q=; b=dnNef/pDkKHd8qk2ht7Oogds2frqA8GBVfioCl8yck3rlRyvZdhu/CvJnLEFEuDc5N+svh mHysqvFZKi5CPUcV+yZc2FyDj6Kz9PY0ZYi+f9yUHBgqoKQbCugNSJcEZXe5+X14NXeM/A 4UoUwA74Of1Ix6/pA3Giu7Tf2O/vcfRYoKW2qLj4pwjV4YVhXB5iatS0Wqo5ugTX3NLS46 SwBCc4HOodtkOyElLg2dLp80udATxRj620QcfJn2iuyeHDkHeCfYgJrirtPP+eJzPqpGUf d/VWwbZHT541Lo+Se62L0wLiqySUrbSw7/puzCfcp6EXl6CXGgnKftWIdQKqqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702845721; a=rsa-sha256; cv=none; b=hzxI/e31W/03QJjZFtHi+8H+1r42kvffa0uDDqSiQt1RSanoT2vNOE0W8kYO81I1PIIU2u xutDMGB/CfeUP0p/Jc3aZikjCuxN8L2VuN1IHbGgl9eK4hqif13hI59fOe6wC4RaaPwUr+ QJ70ukSJ+r69JETrLeMc2s2F4bXZr1bKmp814ykCP1LAWxU9VamgCSLOzmfw/XIyU37YTc WlUOZrLOZK2Ilfte1zRATAiT7Y5ERKmUTvPy+zG+YKs6u+2QzW3Lvvjo4GGlULos8fne01 tHjtyG6uqUNTVHpwMV8VyiwXCVBl/rOcf/LbHe8+xQHbHcTjc/2iQMMF6MNlZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ow6zWi9c0LgbpPTGqpaIaSPgxdo5VvCsEHxy3DEyX+Q=; b=dhp5KdkTHU6mfao+q0jY/xu+xLxym5NL1qztezn/lOeVDTqRj/ba8EN3bZLIG3kWSzy82O 3hwotp7OKy7GOw0dh0E63k95xupAqzVNeTRJa7PGZBNyybrDKc5Oh3VP0paMPi8p9KXT0p nsKpwTD4Vo8nqLhKtK4HuJqBXx4LHLhmzFIMQJvN6Y3bVzMIZWRQSfQiyaQMhsn/F51Kwr iv1cQcKgQgASpSuBpN4fz5P1Oc07D5DF8gqDmJovw54LPuCKxUIPTwIS9qLUIVwwT/Rwb3 qOCKr4xgZketM6oYJa5bimKbfqu5bNmKoyepYhmg/Y6SPWS5WDLbuyDEVntTkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StZd54HrVzsKJ; Sun, 17 Dec 2023 20:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHKg1Bk024835; Sun, 17 Dec 2023 20:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHKg19e024834; Sun, 17 Dec 2023 20:42:01 GMT (envelope-from git) Date: Sun, 17 Dec 2023 20:42:01 GMT Message-Id: <202312172042.3BHKg19e024834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: b1c73532ee89..312c0ed19cc5 - vendor/llvm-project/main - 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 312c0ed19cc5276a17bacf2120097bec4515b0f1 X-Git-Oldrev: b1c73532ee8997fe5dfbeb7d223027bdf99758a0 X-Git-Newrev: 312c0ed19cc5276a17bacf2120097bec4515b0f1 Auto-Submitted: auto-generated The branch vendor/llvm-project/main has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=b1c73532ee89..312c0ed19cc5 312c0ed19cc5 Vendor import of llvm-project main llvmorg-18-init-15088-gd14ee76181fb. From nobody Sun Dec 17 20:42:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StZd602Ksz54D6m for ; Sun, 17 Dec 2023 20:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StZd56Wljz4TZV; Sun, 17 Dec 2023 20:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNftYLcPe0xINq5BYI6T2QoEsO09ArXhSJBokIK57OE=; b=qVRYKRL9bpMvki34eqE2ajrjIUqVw7VOcOhdLP4UPMqkce0H+HIbfuo1fj3zUbqBuVaphp Izn2RHmNYdupFnvyaZLr73HVFyhRV4JSyPHgDIq8duOMiHMX+Jz7shQYwZaJEOZ0ZTzl6q DG4SN7fmH6mI/JC4nykT7sSTZoradQRJU+S2kz2mUVag0WVzSrp51XhtMirBpYeeBQOec9 keT3WHMg0hNuJdYhqDmN2wA9KkEl4O1X9t/F4RpWwizikVYZmqFEgtPw6Mr7gj/885WaX/ rJel/xotsbpAzum0J3LiVOzWf2LInRTsI+D38vhKOoMeAFG+lfepZH+Z759I7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702845721; a=rsa-sha256; cv=none; b=vXUWQ5ipO/w6XKIF+n2W0DqqMR+HUC68EowX5JMiS5bbsIqouO+HSSj07icM0chcJWryy2 QgnuS70/Nk0D0SOJjTNwrMvvEheJ1G6ma9z0/aPy6U6pTgNtaqE7druMM9kvfhSO+xMOTe DFkzBEP59H0gmfqhifekLhBz1qt0aLrBWCL7vwAbdP3w0nTSVYI3OG3ZJbXpRwcMqq2HwC f3u873Vofdy/VsPsQOCDNakwbS4JYehdT49AxAduweuqQMdFFSLwjz9TiL0lahaTVAMi/z UgY5meJHFP2/XZMVfCK4Iur1UudGEzQAZhaCmglMOsH/RRHgKF3SJVUHmT4Yog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702845721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xNftYLcPe0xINq5BYI6T2QoEsO09ArXhSJBokIK57OE=; b=XIgcjH6y5beOs4zmfiq2MavLh63X1mVu+Ofp2PGRNvVNzQBX3YCqC+C78+lsa5guVMPEXY uUXX3Ym1H0W69vUCp0toZxfipDMPLCSOUmDxiJ9AaSLnS61kEHBtAJJf5F7ZJI8kOB47Vv FnA4YTBNooI/K7C/7CTOeHqIbJCshlbDIwXdS5S9UB0hujQh8HrmaE+zrVnXqKsjQL0Wk5 LHarSFkH8mPXE+ongZzEIKCIgaNTl5b/MIAP7BsY7dV+NhCx25Mf50Z2YQl0BHJl2tj7+a GIHc8Qnab8vXJ+tgFg0ePuv6FvbPiQQKN3eFWr1nxzF8VLiRyRzAdYYJq6l32w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StZd54ZyqzsKK; Sun, 17 Dec 2023 20:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHKg13G024854; Sun, 17 Dec 2023 20:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHKg1EZ024853; Sun, 17 Dec 2023 20:42:01 GMT (envelope-from git) Date: Sun, 17 Dec 2023 20:42:01 GMT Message-Id: <202312172042.3BHKg1EZ024853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 9b3e28b42653 - Create tag vendor/llvm-project/llvmorg-18-init-15088-gd14ee76181fb List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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-18-init-15088-gd14ee76181fb X-Git-Reftype: annotated tag X-Git-Commit: 9b3e28b426539ef7814bb26e789a0c8fe59f9986 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-18-init-15088-gd14ee76181fb has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-18-init-15088-gd14ee76181fb tag vendor/llvm-project/llvmorg-18-init-15088-gd14ee76181fb Tagger: Dimitry Andric TaggerDate: 2023-12-17 20:41:30 +0000 Tag llvm-project main llvmorg-18-init-15088-gd14ee76181fb. commit 312c0ed19cc5276a17bacf2120097bec4515b0f1 Author: Dimitry Andric AuthorDate: 2023-12-17 20:41:09 +0000 Commit: Dimitry Andric CommitDate: 2023-12-17 20:41:09 +0000 Vendor import of llvm-project main llvmorg-18-init-15088-gd14ee76181fb. From nobody Sun Dec 17 21:02:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Stb4n5Tzlz54FCs; Sun, 17 Dec 2023 21:02: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Stb4n52wGz3fdL; Sun, 17 Dec 2023 21:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702846953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8meHOMX0J6Kip8HC8Wv9VmfjBp5hBEq0oxKL2iNFL94=; b=BLokxpVdfgSBCp92Xf/n5T6mUfcEyQQI+PWKE/kevOG6POW28wRV+zloq9bPqXaA3A6qyz UigwwGM9yFEekiSdqb/yiBybqJdAvdftVg3foYnGwwNt7HX/g1+SMBh4Vf58WR99GWJgI1 vvZWIyS/g405mwvVtfE5uXlFKP4J9dlOd/2MGPNpj+69yvzUWsDpVObUnl9GSSXIead+li Xwz5H5ZY+66SIKCDcj8EmTiJkQjqrrun531DmefB7JzebpxB4Jd7vJpRMAGryfHdbIO48g LV0eWsbGSU1LMq7m3z1+MVM7FnzShouu3H2x1KH9hThWY6XoeqybruPDBoEeAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702846953; a=rsa-sha256; cv=none; b=fiBSQTNXh6E8aWfXgWsLzcPiyemlLFd7QRUOjfN+o4VsJu6gwuXwaX4OInK+TYRGxOcnBA vVXP4sIKozPoXx65jivcYWcKURYVOB9LG2Xr3Gbcr8P/mA0MjV4hlu2MqCuLsDDOgWmrL7 KuvJuYonX0Zq8PAJ30UjUaWxduYcjAmY5LHkLgJmc2mzhGWYocuUEJDwYAGw+ZpJlaEOG4 4ACH2VayRz86gDEo1a5NgYWISQwF7Bd+u2er2E3gbPcBy9F1+CNmq9CEOrbcyo2x+wVXbF GjBjzRo731Z0gUI86l3fuWC7BDP6Feo//UEUK8dtg6N9uRUkpcNtRysryWewLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702846953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8meHOMX0J6Kip8HC8Wv9VmfjBp5hBEq0oxKL2iNFL94=; b=NEpVjMQnFcLiL79wjtZ0sBu9/utklMlyYl9vhgGyWfGR/KjMntL6/c3swtMvd1hh2Bcv/O e88ka0zzoU3S/L3KEfyrM0Z9Rg3UKC+xCup0EoSiDWEgeeZfU7E0s48QEXgTnZuznR+Zzc U0/SdDz+ooc0VNBQ5Q1pg+8mz2ZJnkb412Xb5XiPhld1IVrQEGx9WV4ik4UPaOlsPasGpk Tyr4Fk0Hal24G7u9QwRzcUo257OtR5q2+pAcMpkCUAJ6LoKMdFqAYilhyzwbJd8z/gVvqW IeJiFAUGjnDnbLvCBRq1o1Vz0BFpuW92mYajgIkdK+UbC239h3GEYqbJBpRiaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Stb4n48MszshX; Sun, 17 Dec 2023 21:02:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHL2XoX060453; Sun, 17 Dec 2023 21:02:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHL2XVX060450; Sun, 17 Dec 2023 21:02:33 GMT (envelope-from git) Date: Sun, 17 Dec 2023 21:02:33 GMT Message-Id: <202312172102.3BHL2XVX060450@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: c5e3beac7b80 - stable/13 - nfscl: Fix processing of a rare Rename reply case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: c5e3beac7b80483b41492e021bbd43242528424e Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c5e3beac7b80483b41492e021bbd43242528424e commit c5e3beac7b80483b41492e021bbd43242528424e Author: Rick Macklem AuthorDate: 2023-12-03 23:31:01 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 21:01:34 +0000 nfscl: Fix processing of a rare Rename reply case When delegations are enabled (they are not by default in the FreeBSD NFSv4 server), rename will check for and return delegations. If the second of these DelegReturn operations were to fail (they rarely do), then the code would not retry the rename with returning delegations, as it is intended to do. The patch fixes the problem, since the DelegReturn reply status is the second iteration of the loop and not the first iteration. As noted, this bug would have rarely manifested a problem, since DelegReturn operations do not normally fail. (cherry picked from commit 6aded1e6b2e5549120031032e1c7f8b002882327) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 63b9f7755fd3..41c397100497 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2719,7 +2719,7 @@ tryagain: ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) { - if (i == 0 && ret > 1) { + if (i == 1 && ret > 1) { /* * If the Delegreturn failed, try again * without it. The server will Recall, as From nobody Sun Dec 17 21:04:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Stb713cr4z54FYW; Sun, 17 Dec 2023 21:04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Stb7135ggz3gdM; Sun, 17 Dec 2023 21:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702847069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiE0kSQ54AWCMAgSanWn9olEy3fVjwTmxUN6MdzPGTA=; b=ys43iQrJ5HsypVi5wIJ3PcPWAKt26OVSJx1i3cZRh00cjVmKGbl9X468gv9aigVmCzMTso +VqlIBUafXNNwOVqtMhm2BaN/KyoPFDaxTJgF+AxgcL9KBOEjW2n7g4noorAD9qisoT5qU NOIEyekl1ISwf77cypNdNirOV921n4dNcEW+meOBFAWterLafk7Crc5P6b2XeV57Ny3QpQ 7OBs2S4+bJW8cJLSHMRw3a1P+dJ3SA/nVPhAOYak5bq3UL5TVLptc+Xymhn76ehis3K0DY 66nNAZ5buWD8cwqP7OFOz81OdD9HwtteScj0BWiXCAyy613Lyp/YgSzjgL2QdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702847069; a=rsa-sha256; cv=none; b=lTwUfDySB3Japmx0H7J7ufMndcQb4QDkzLJW5r2ZYspjH50+C+qLb2Ge1SlgO8yPpHGJIE /Ghni4EzEgjSdhQAb8aXmFmINAt6FNaDocigpRxGSjealK++9TCvR/8sODQ36DQj2l8rQ+ GkSOJ6KyAcRK7CTxyU9Hl9X6QQ+RLKgiQ5qGjVkOAEcNzIXN2LGI3cbW05s3bOBDe86kql YEhQFvqFfY+A5VpFqla5tUkGVU0+YMYPJCkIB5aB8f+sD749OKvk3LD61rXFj8+DaCEuIB z4dG8AL0TFQfczDwntwcsg2es5UIsgTXabCB6U6VuhCdXrynW2PEqJ5+nbXf2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702847069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aiE0kSQ54AWCMAgSanWn9olEy3fVjwTmxUN6MdzPGTA=; b=LdWbqvSadsqsFTk38CiCPnuFukbkjTYaAWRtMbz7D9JeJMmtuD6LKuPvrJNWin2ZeMo30I KtjCRBZxiSmLcy3QJR7XxICsYS3PIiu1PUbdjX+0vmai3OMXjYFW/x5rjO9yzVaQAuHF+p JhIPNkTQFTtpQ29W6pZFE95W3tytUpFoBHgFOO3SbU2dzRlJhGk7yPf6rCVs+rRmgK07Lb 15+I386a5KeMCu4jGlirkj0vt6lv/mJA9Z+29g2kv6ROJLPuIEWPHpWpa0MGAdIFZR5Zr4 /08IY7rHSTmLFMAklzgphq8LB543xjGghX8XIQpvLD+Mv+NV8BIPtk3H7Q0ytw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Stb7129ktzshZ; Sun, 17 Dec 2023 21:04:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHL4T3N060803; Sun, 17 Dec 2023 21:04:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHL4TCJ060800; Sun, 17 Dec 2023 21:04:29 GMT (envelope-from git) Date: Sun, 17 Dec 2023 21:04:29 GMT Message-Id: <202312172104.3BHL4TCJ060800@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: 0c3c5ae0df52 - stable/13 - nfscl: Fix comment for commit 6aded1e6b2e5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 0c3c5ae0df52484129c2eca49adec71742702c19 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3c5ae0df52484129c2eca49adec71742702c19 commit 0c3c5ae0df52484129c2eca49adec71742702c19 Author: Rick Macklem AuthorDate: 2023-12-04 00:12:14 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 21:03:29 +0000 nfscl: Fix comment for commit 6aded1e6b2e5 Commit 6aded1e6b2e5 fixed a rare case when handling an NFSv4 Rename reply when delegations are in use. This patch fixes the associated comment. (cherry picked from commit 0a958aa16fed1978879d64e3b225f1d232cc5a98) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 41c397100497..899d81efcf7c 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2724,7 +2724,7 @@ tryagain: * If the Delegreturn failed, try again * without it. The server will Recall, as * required. - * If ret > 1, the first iteration of this + * If ret > 1, the second iteration of this * loop is the second DelegReturn result. */ m_freem(nd->nd_mrep); From nobody Sun Dec 17 21:13:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StbKx3C23z54GP7; Sun, 17 Dec 2023 21:13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StbKx2c3kz4SkG; Sun, 17 Dec 2023 21:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702847637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09TZuvuj76VUR0rUbz7AUl4UXy2h+OCyyoxVQr0DlAE=; b=e1YeAjZl0kl9OhqDLMTKaDKoB+yqoAXIOKoKa1508X0ODUXqn6cvs5tUZ+sL/YYrVQH41D APds6IFfgzMjMaEdc1h5VgFCdfH5EqbvZ73S9uQnW1g3ucg96+RxRYk6AmDy61aLis60m4 WGM9oh0qBgYQ2JG7Mhm+Boh5aXdxybxarP/Zx/nwnOXvOkCx7ABS58W/Khgz7gSSj/ho2a GTf+8H7VxscPiJY9pQiJM3xoX8LJqonrYtKszqQ8Qnmpwsb0rOK2P1IFeYyvzNUnwZiofZ wUHtMN2ztppth/ckh1fCs/5wirr91/D14tMcW4R123jUmFadVYhl3vsAQXO/eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702847637; a=rsa-sha256; cv=none; b=w7QX1u3n7Dnmb0lMUTJYy45Mgo9iWewOcjDXCgBpk9lLpnmZC4RNwjA/JLQGOUsuRHBhpU KPlf0KG+7fFGzdbT4LVwU7vIDVuDvuuz2uQ33QFCkXADSLWJ38ytAuvKfG9AFkvIiMc1+y 7zBmOASmWRqLDqHOiW05oh93pB5aKszN8nIz6ZvschORfwlhK8ZUOB4nzmuVq+6KcIzWx+ RnfbkuvNEpGBIewqsiyzgXkrNQAdI8WUXJ2YBZ8xNKVQX6yKeH+XwGvHqXUGNJedKsvart ZJfx+pldJ5Wot8u7spEfy4hYrCIS6/JU0k32wFYCW/2ktOwMBMHMPbZKkHzgYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702847637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=09TZuvuj76VUR0rUbz7AUl4UXy2h+OCyyoxVQr0DlAE=; b=K2mE0yUcsu9s0Rs3P7oHz1Doq5gGOV/CfPYWj42c5vdzE7cYuvVGcJ5qHGxD4bWSakYea1 Q3hMcTmyFvH9P6s5QQsK0nooibe0Lm+7YvJGaLGHZULl7qJu9pmnQdpYl5yp5OKN7FyNCb q/qoOfkYxmhE09cRCATDl1589q6/Ejce1XkdelcScTPClpoTVvKawntVvpdqzNWuCIKITf qQjm7z4CGzq0dTl0iKC+4koy1dfRwqFSrquSEW3s8GOL8sibY9EZ9Ls6x3xCXjuS+yJmWn 3nvMFVVFDzkygOP/jDm2UV10PVJ3RQ4ZM1nb7D/OdUk2Op0+Ds+4Yte3qy342w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StbKx1fs2ztJc; Sun, 17 Dec 2023 21:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHLDvaf077352; Sun, 17 Dec 2023 21:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHLDvUV077349; Sun, 17 Dec 2023 21:13:57 GMT (envelope-from git) Date: Sun, 17 Dec 2023 21:13:57 GMT Message-Id: <202312172113.3BHLDvUV077349@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: dd6bdfcd073e - stable/12 - nfscl: Fix processing of a rare Rename reply case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: dd6bdfcd073ee8461c7d5a7a8fe336831a57b685 Auto-Submitted: auto-generated The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=dd6bdfcd073ee8461c7d5a7a8fe336831a57b685 commit dd6bdfcd073ee8461c7d5a7a8fe336831a57b685 Author: Rick Macklem AuthorDate: 2023-12-03 23:31:01 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 21:13:01 +0000 nfscl: Fix processing of a rare Rename reply case When delegations are enabled (they are not by default in the FreeBSD NFSv4 server), rename will check for and return delegations. If the second of these DelegReturn operations were to fail (they rarely do), then the code would not retry the rename with returning delegations, as it is intended to do. The patch fixes the problem, since the DelegReturn reply status is the second iteration of the loop and not the first iteration. As noted, this bug would have rarely manifested a problem, since DelegReturn operations do not normally fail. (cherry picked from commit 6aded1e6b2e5549120031032e1c7f8b002882327) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 53e3ab9b03ea..0a9c54ce5e1e 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2550,7 +2550,7 @@ tryagain: ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); if (*(tl + 1)) { - if (i == 0 && ret > 1) { + if (i == 1 && ret > 1) { /* * If the Delegreturn failed, try again * without it. The server will Recall, as From nobody Sun Dec 17 21:15:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StbMW4xvQz54GYq; Sun, 17 Dec 2023 21:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StbMV6m4Sz4Vgw; Sun, 17 Dec 2023 21: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=1702847719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GO6XpaUMLtHjVBg3jDwOaYNDW5msthar5MrPXlgNpdQ=; b=AdzGVL0bgj7jJkMYq7ngzI/hK2oG/tm6jj6oBxlpNeVH4YwKu20MiZ6cTDi9Jf+vRT2KD/ OaiuwAViUNjmnRH5P666Wg0to1tR2IbTHacyqhoqA8lzEFL10E1t6XkfK3TpJqeJkxAuXl OGNNdXLMu+KqPkp1bCWO7+CDPFCXM3/ptYr8X3L8s9YcxtZbKq1cvV3fsXgUt3xD/V1b/6 i9nh/SDfc1F3RDH5Wxy+glncVmBcepHDB+8ABIrWAmQqpyrnPFtDFHuBNjQMVtaGsVU6VH vlFhvZmGFv3aeNk8hSRYfjb3j6rPwx2sWsevZVFDLFK1RNWVyGa54epwE1JGMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702847719; a=rsa-sha256; cv=none; b=d1sj6Suf4rCv72egSqybKOY7WYMtKHXQWHRNM3b6xQ50k5VvwMCBi029FbjThHyKnTpRxQ M/jWFvb254o4psNeJDznzhP43K7sJuM1w4oraYJIvEG3t4bOhghlKuYpU4vsEXA84TxWki OugA1oZMRHGB4DOfqntJHJvSvXdA8jGkhNFlqF4zD+72YiFV0vVQIjnLLH9xTFgiVs3T/p d+Axom/fhgql2T/uHperCc0mwRZKnm8lMcG7POcsqWurMYFZWfDhcEV6uq24pjghtndnHw cIH4bhAEkfv0C8j1Zp0TPvME5kzaAGn8hJRXXHYXlS9VBouoHYD/eS4p9xLj+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702847719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GO6XpaUMLtHjVBg3jDwOaYNDW5msthar5MrPXlgNpdQ=; b=m5BWk6+mYof2UP4IfqtPwhnKFdDviUtddTswnVgL0Q4XBsgvTOskzWohlDI81i8rB8+9Mf AoFAXVubAzzcPgcV649inS6+BuCdu+4NQvlsdhLMZW2MF55grO/uo93zYcBLfiBRhPcsFS /7mCVLJyWVvXxSKRCO++YECdrfDOQveQAaUiJoIXZbdkm0MqC4kZP0tPtDB0mhn/InooCj z1ET+ORanSDPjsUwZIVP9SDvmftJtL/71SuV3lyN5KBFoQhWf5Os5fC3CCo1dZWKAf225o BeLOEfEa/f1CdCsrUPIxA49WH2rfaC/YYPID9IDpT6mXNs2EW+dYHHGJT+IA8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StbMV5rSzztRk; Sun, 17 Dec 2023 21:15:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHLFIfx077684; Sun, 17 Dec 2023 21:15:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHLFIKg077681; Sun, 17 Dec 2023 21:15:18 GMT (envelope-from git) Date: Sun, 17 Dec 2023 21:15:18 GMT Message-Id: <202312172115.3BHLFIKg077681@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: 08143226d007 - stable/12 - nfscl: Fix comment for commit 6aded1e6b2e5 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: 08143226d007322fe8b463851df07a3e9d80282c Auto-Submitted: auto-generated The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=08143226d007322fe8b463851df07a3e9d80282c commit 08143226d007322fe8b463851df07a3e9d80282c Author: Rick Macklem AuthorDate: 2023-12-04 00:12:14 +0000 Commit: Rick Macklem CommitDate: 2023-12-17 21:14:30 +0000 nfscl: Fix comment for commit 6aded1e6b2e5 Commit 6aded1e6b2e5 fixed a rare case when handling an NFSv4 Rename reply when delegations are in use. This patch fixes the associated comment. (cherry picked from commit 0a958aa16fed1978879d64e3b225f1d232cc5a98) --- sys/fs/nfsclient/nfs_clrpcops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 0a9c54ce5e1e..80cc2412afd7 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -2555,7 +2555,7 @@ tryagain: * If the Delegreturn failed, try again * without it. The server will Recall, as * required. - * If ret > 1, the first iteration of this + * If ret > 1, the second iteration of this * loop is the second DelegReturn result. */ mbuf_freem(nd->nd_mrep); From nobody Sun Dec 17 21:31:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StbkV3RJDz54HrJ; Sun, 17 Dec 2023 21:31:46 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4StbkV0G44z3RgF; Sun, 17 Dec 2023 21:31:45 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id 6DC043317D; Sun, 17 Dec 2023 13:31:39 -0800 (PST) Date: Sun, 17 Dec 2023 13:31:39 -0800 From: Gleb Smirnoff To: Gordon Bergling Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4fb5eda6493c - main - tcp: Remove the documented dependency of TCPHPTS for RACK and BBR Message-ID: References: <202312171831.3BHIVgjE004377@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202312171831.3BHIVgjE004377@gitrepo.freebsd.org> 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:27348, ipnet:162.251.186.0/24, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4StbkV0G44z3RgF On Sun, Dec 17, 2023 at 06:31:42PM +0000, Gordon Bergling wrote: G> commit 4fb5eda6493c3dada695efbfad0a44d204b7fc5e G> Author: Gordon Bergling G> AuthorDate: 2023-12-17 18:31:16 +0000 G> Commit: Gordon Bergling G> CommitDate: 2023-12-17 18:31:16 +0000 G> G> tcp: Remove the documented dependency of TCPHPTS for RACK and BBR G> G> Since TCPHPTS is now included in the GENERIC kernel, remove the G> documented dependency of it from the tcp_rack(4) and tcp_bbr(4) G> manual pages. The change is correct, but commit message is wrong. The options is not included into GENERIC, neither presence of an option in GENERIC justifies removal of SYNOPSIS entry. The correct reason for SYNOPSIS entry removal is that HPTS is now a loadable module. -- Gleb Smirnoff From nobody Sun Dec 17 21:55:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StcGJ1sWvz54Kj1; Sun, 17 Dec 2023 21:55: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StcGH6kgvz4dpc; Sun, 17 Dec 2023 21:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702850151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rL02p6lSHn2r4IdlMV0m15mjpJYFSGKrLYCPscc8jMM=; b=dHILmEoo491dXsHVv8NgGL23eWdYqN9c38Pj43LUS3KEuyX6e73Fj15tlZhIDOhfUxSjQ1 2NWDiavtIvs00R0LbZv3Mt4/T3z9scuTr+MaR5iUFasiysnPcsGPzpYkMsJzK2tUoD3YW4 eeb2Qxe2AWrFq7dhabjoNpzCRfYNAU/NAd95YFvwxJ/Wd1EoIyTTX2gAZThBi24ZuM6Go9 5GljHMSsur1r6Qz5HxdEkNxwdnusT6csueFXUYbrpTe0Bi++hzKQNQjrjqEdDLR6xNkSMs 4KgASEjXJXYhP0Q+jobaa3+MKkk6AZP0ywkr7757oiUQ79vVgTqTa3THhVEVmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702850151; a=rsa-sha256; cv=none; b=P6oKM67mvHtXsj4nGtHwq0c7O6t6+c3NDwDIpDobYcP/iI+Y2/OLyZWf736fQRhKEIS3dm r1sjYCZrSZ9FKNlRV6y95k1Z2KoWh/Jkm3r17vhT4YWeU90mXlwd7DMn7uzRBtV4JnGUwB LsCuGpOP7u5Kd0+0FyYYOitbBnq9Gdvi7fbME7ersEDWT73vys2OC6DiejeMOEvzWFLHex r9lh+Z2DxGs5CG3pdd1tn2RUnOSf8V5UZHaAP/vWaSCMAsvWCvjvvFCwbuIzyd9h0WtIVr jqkmXXgWIYS5nTzSOh6FDr67Si+TcBies79iEP1/n+EcKT8D3LPByHf+78Scvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702850151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rL02p6lSHn2r4IdlMV0m15mjpJYFSGKrLYCPscc8jMM=; b=GijWanOoCYsmfwCjKKcFGRx6h9z4KBmqDFVVcRtZQIfbvZ3bRj0zUhrqaoT9revatcv2yP PmFO83dexQIFkHyn48HsddTPmMAI+t/3osCNZjeHKJAT14g6jTnVeLvvpNNlkbtqxvqwO6 adus48Z4C6cnSarhvaJqG9dr9GnNcSSdwqHka4bgrlg5R8FZJGCYKLRLgrqcjiQj27Udrf C9dmCZM7RmaUAzhC9J0tJjPmYSI3e+GXaz6IDNug5WRhs8a8DkjTqcCNDZbtDXgD4vif12 uB/Y/lp/zBiVT8ZxKCMOsK2HS05AWXSqWJEKmvGaMZVDMha9LbTUa1yB7oXkuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StcGH5pqSzv4W; Sun, 17 Dec 2023 21:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHLtpRS044692; Sun, 17 Dec 2023 21:55:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHLtpqR044689; Sun, 17 Dec 2023 21:55:51 GMT (envelope-from git) Date: Sun, 17 Dec 2023 21:55:51 GMT Message-Id: <202312172155.3BHLtpqR044689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 31cf66d7554c - main - dummynet: add simple gilbert-elliott channel model List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31cf66d7554c2fa6a5aea77f4cd54712e611cdd0 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=31cf66d7554c2fa6a5aea77f4cd54712e611cdd0 commit 31cf66d7554c2fa6a5aea77f4cd54712e611cdd0 Author: Richard Scheffenegger AuthorDate: 2023-12-17 12:19:52 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-17 12:20:45 +0000 dummynet: add simple gilbert-elliott channel model Have a simple Gilbert-Elliott channel model in dummynet to mimick correlated loss behavior of realistic environments. This allows simpler testing of burst-loss environments. Reviewed By: tuexen, kp, pauamma_gundo.com, #manpages Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D42980 --- sbin/ipfw/dummynet.c | 44 +++++++++++---- sbin/ipfw/ipfw.8 | 39 +++++++++++++- sys/netinet/ip_dummynet.h | 3 +- sys/netpfil/ipfw/ip_dn_glue.c | 51 ++++++++++-------- sys/netpfil/ipfw/ip_dn_io.c | 24 ++++++++- sys/netpfil/ipfw/ip_dn_private.h | 9 ++++ tests/sys/netpfil/common/dummynet.sh | 102 +++++++++++++++++++++++++++++++++++ 7 files changed, 235 insertions(+), 37 deletions(-) diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c index 26d535428ec3..9663e983b31a 100644 --- a/sbin/ipfw/dummynet.c +++ b/sbin/ipfw/dummynet.c @@ -471,7 +471,7 @@ print_flowset_parms(struct dn_fs *fs, char *prefix) { int l; char qs[30]; - char plr[30]; + char plr[40]; char red[200]; /* Display RED parameters */ l = fs->qsize; @@ -482,9 +482,17 @@ print_flowset_parms(struct dn_fs *fs, char *prefix) sprintf(qs, "%d B", l); } else sprintf(qs, "%3d sl.", l); - if (fs->plr) - sprintf(plr, "plr %f", 1.0 * fs->plr / (double)(0x7fffffff)); - else + if (fs->plr[0] || fs->plr[1]) { + if (fs->plr[1] == 0) + sprintf(plr, "plr %f", + 1.0 * fs->plr[0] / (double)(0x7fffffff)); + else + sprintf(plr, "plr %f,%f,%f,%f", + 1.0 * fs->plr[0] / (double)(0x7fffffff), + 1.0 * fs->plr[1] / (double)(0x7fffffff), + 1.0 * fs->plr[2] / (double)(0x7fffffff), + 1.0 * fs->plr[3] / (double)(0x7fffffff)); + } else plr[0] = '\0'; if (fs->flags & DN_IS_RED) { /* RED parameters */ @@ -1408,13 +1416,27 @@ ipfw_config_pipe(int ac, char **av) case TOK_PLR: NEED(fs, "plr is only for pipes"); - NEED1("plr needs argument 0..1\n"); - d = strtod(av[0], NULL); - if (d > 1) - d = 1; - else if (d < 0) - d = 0; - fs->plr = (int)(d*0x7fffffff); + NEED1("plr needs one or four arguments 0..1\n"); + if ((end = strsep(&av[0], ","))) { + d = strtod(end, NULL); + d = (d < 0) ? 0 : (d <= 1) ? d : 1; + fs->plr[0] = (int)(d*0x7fffffff); + } + if ((end = strsep(&av[0], ","))) { + d = strtod(end, NULL); + d = (d < 0) ? 0 : (d <= 1) ? d : 1; + fs->plr[1] = (int)(d*0x7fffffff); + } + if ((end = strsep(&av[0], ","))) { + d = strtod(end, NULL); + d = (d < 0) ? 0 : (d <= 1) ? d : 1; + fs->plr[2] = (int)(d*0x7fffffff); + } + if ((end = strsep(&av[0], ","))) { + d = strtod(end, NULL); + d = (d < 0) ? 0 : (d <= 1) ? d : 1; + fs->plr[3] = (int)(d*0x7fffffff); + } ac--; av++; break; diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index e62b8d6efc95..715d8580f1ce 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,5 +1,5 @@ .\" -.Dd September 28, 2023 +.Dd December 17, 2023 .Dt IPFW 8 .Os .Sh NAME @@ -3039,12 +3039,47 @@ needed for some experimental setups where you want to simulate loss or congestion at a remote router. .Pp .It Cm plr Ar packet-loss-rate +.It Cm plr Ar K,p,H,r Packet loss rate. Argument .Ar packet-loss-rate is a floating-point number between 0 and 1, with 0 meaning no loss, 1 meaning 100% loss. -The loss rate is internally represented on 31 bits. +.Pp +When invoked with four arguments, the simple Gilbert-Elliott +channel model with two states (Good and Bad) is used. +.Bd -literal -offset indent + r + .----------------. + v | + .------------. .------------. + | G | | B | + | drop (K) | | drop (H) | + '------------' '------------' + | ^ + '----------------' + p + +.Ed +This has the associated probabilities +.Po Ar K +and +.Ar H Pc +for the loss probability. This is different from the literature, +where this model is described with probabilities of successful +transmission k and h. However, converting from literature is +easy: +.Pp +K = 1 - k ; H = 1 - h +.Pp +This is to retain consistency within the interface and allow the +quick re-use of loss probability when giving only a single argument. +In addition the state change probabilities +.Po Ar p +and +.Ar r Pc +are given. +All of the above probabilities are internally represented on 31 bits. .Pp .It Cm queue Brq Ar slots | size Ns Cm Kbytes Queue size, in diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h index b36b93bbe96b..4e05dcca606f 100644 --- a/sys/netinet/ip_dummynet.h +++ b/sys/netinet/ip_dummynet.h @@ -145,7 +145,7 @@ struct dn_fs { uint32_t fs_nr; /* the flowset number */ uint32_t flags; /* userland flags */ int qsize; /* queue size in slots or bytes */ - int32_t plr; /* PLR, pkt loss rate (2^31-1 means 100%) */ + int32_t pl_state; /* packet loss state */ uint32_t buckets; /* buckets used for the queue hash table */ struct ipfw_flow_id flow_mask; @@ -168,6 +168,7 @@ struct dn_fs { int min_th ; /* minimum threshold for queue (scaled) */ int max_p ; /* maximum value for p_b (scaled) */ + int32_t plr[4]; /* PLR, pkt loss rate (2^31-1 means 100%) */ }; /* diff --git a/sys/netpfil/ipfw/ip_dn_glue.c b/sys/netpfil/ipfw/ip_dn_glue.c index 204b34091781..0412b730e4df 100644 --- a/sys/netpfil/ipfw/ip_dn_glue.c +++ b/sys/netpfil/ipfw/ip_dn_glue.c @@ -77,35 +77,35 @@ struct dn_heap7 { /* Common to 7.2 and 8 */ struct dn_flow_set { - SLIST_ENTRY(dn_flow_set) next; /* linked list in a hash slot */ + SLIST_ENTRY(dn_flow_set) next; /* linked list in a hash slot */ - u_short fs_nr ; /* flow_set number */ + u_short fs_nr ; /* flow_set number */ u_short flags_fs; #define DNOLD_HAVE_FLOW_MASK 0x0001 -#define DNOLD_IS_RED 0x0002 +#define DNOLD_IS_RED 0x0002 #define DNOLD_IS_GENTLE_RED 0x0004 -#define DNOLD_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */ -#define DNOLD_NOERROR 0x0010 /* do not report ENOBUFS on drops */ -#define DNOLD_HAS_PROFILE 0x0020 /* the pipe has a delay profile. */ -#define DNOLD_IS_PIPE 0x4000 -#define DNOLD_IS_QUEUE 0x8000 +#define DNOLD_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */ +#define DNOLD_NOERROR 0x0010 /* do not report ENOBUFS on drops */ +#define DNOLD_HAS_PROFILE 0x0020 /* the pipe has a delay profile. */ +#define DNOLD_IS_PIPE 0x4000 +#define DNOLD_IS_QUEUE 0x8000 - struct dn_pipe7 *pipe ; /* pointer to parent pipe */ - u_short parent_nr ; /* parent pipe#, 0 if local to a pipe */ + struct dn_pipe7 *pipe ; /* pointer to parent pipe */ + u_short parent_nr ; /* parent pipe#, 0 if local to a pipe */ - int weight ; /* WFQ queue weight */ - int qsize ; /* queue size in slots or bytes */ - int plr ; /* pkt loss rate (2^31-1 means 100%) */ + int weight ; /* WFQ queue weight */ + int qsize ; /* queue size in slots or bytes */ + int plr[4] ; /* pkt loss rate (2^31-1 means 100%) */ struct ipfw_flow_id flow_mask ; /* hash table of queues onto this flow_set */ - int rq_size ; /* number of slots */ - int rq_elements ; /* active elements */ - struct dn_flow_queue7 **rq; /* array of rq_size entries */ + int rq_size ; /* number of slots */ + int rq_elements ; /* active elements */ + struct dn_flow_queue7 **rq ; /* array of rq_size entries */ - u_int32_t last_expired ; /* do not expire too frequently */ - int backlogged ; /* #active queues for this flowset */ + u_int32_t last_expired ; /* do not expire too frequently */ + int backlogged ; /* #active queues for this flowset */ /* RED parameters */ #define SCALE_RED 16 @@ -420,7 +420,10 @@ dn_compat_config_queue(struct dn_fs *fs, void* v) fs->flow_mask = f->flow_mask; fs->buckets = f->rq_size; fs->qsize = f->qsize; - fs->plr = f->plr; + fs->plr[0] = f->plr[0]; + fs->plr[1] = f->plr[1]; + fs->plr[2] = f->plr[2]; + fs->plr[3] = f->plr[3]; fs->par[0] = f->weight; fs->flags = convertflags2new(f->flags_fs); if (fs->flags & DN_IS_GENTLE_RED || fs->flags & DN_IS_RED) { @@ -645,7 +648,10 @@ dn_c_copy_pipe(struct dn_schk *s, struct copy_args *a, int nq) fs->parent_nr = l->link_nr - DN_MAX_ID; fs->qsize = f->fs.qsize; - fs->plr = f->fs.plr; + fs->plr[0] = f->fs.plr[0]; + fs->plr[1] = f->fs.plr[1]; + fs->plr[2] = f->fs.plr[2]; + fs->plr[3] = f->fs.plr[3]; fs->w_q = f->fs.w_q; fs->max_th = f->max_th; fs->min_th = f->min_th; @@ -698,7 +704,10 @@ dn_c_copy_fs(struct dn_fsk *f, struct copy_args *a, int nq) fs->next.sle_next = (struct dn_flow_set *)DN_IS_QUEUE; fs->fs_nr = f->fs.fs_nr; fs->qsize = f->fs.qsize; - fs->plr = f->fs.plr; + fs->plr[0] = f->fs.plr[0]; + fs->plr[1] = f->fs.plr[1]; + fs->plr[2] = f->fs.plr[2]; + fs->plr[3] = f->fs.plr[3]; fs->w_q = f->fs.w_q; fs->max_th = f->max_th; fs->min_th = f->min_th; diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index 3e6bd0e229b5..03116cb0641c 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -497,8 +497,28 @@ dn_enqueue(struct dn_queue *q, struct mbuf* m, int drop) ni->tot_pkts++; if (drop) goto drop; - if (f->plr && random() < f->plr) - goto drop; + if (f->plr[0] || f->plr[1]) { + if (__predict_true(f->plr[1] == 0)) { + if (random() < f->plr[0]) + goto drop; + } else { + switch (f->pl_state) { + case PLR_STATE_B: + if (random() < f->plr[3]) + f->pl_state = PLR_STATE_G; + if (random() < f->plr[2]) + goto drop; + break; + case PLR_STATE_G: /* FALLTHROUGH */ + default: + if (random() < f->plr[1]) + f->pl_state = PLR_STATE_B; + if (random() < f->plr[0]) + goto drop; + break; + } + } + } if (m->m_pkthdr.rcvif != NULL) m_rcvif_serialize(m); #ifdef NEW_AQM diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index ea5b809d8d28..756a997b6ec3 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -392,6 +392,15 @@ enum { PROTO_IFB = 0x0c, /* layer2 + ifbridge */ }; +/* + * States for the Packet Loss Rate Gilbert-Elliott + * channel model + */ +enum { + PLR_STATE_G = 0, + PLR_STATE_B, +}; + //extern struct dn_parms V_dn_cfg; VNET_DECLARE(struct dn_parms, dn_cfg); #define V_dn_cfg VNET(dn_cfg) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 14d863d001c8..e5ffd3836dfc 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -517,6 +517,102 @@ nat_cleanup() firewall_cleanup $1 } +pls_basic_head() +{ + atf_set descr 'Basic dummynet packet loss rate test' + atf_set require.user root +} + +pls_basic_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 65432 ip from any to any" \ + "pf" \ + "pass on ${epair}b" + + # Sanity check + atf_check -s exit:0 -o match:'100 packets transmitted, 100 packets received' ping -i .1 -c 100 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config plr 0.1 + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip from 192.0.2.1 to 192.0.2.2" \ + "pf" \ + "pass on ${epair}b dnpipe 1" + + # check if the expected number of pings + # are dropped (84 - 96 responses). + # repeat up to 6 times if the initial + # checks fail + atf_check -s exit:0 -o match:'100 packets transmitted, (8[4-9]|9[0-6]) packets received' -r 6:10 ping -i 0.010 -c 100 192.0.2.2 +} + +pls_basic_cleanup() +{ + firewall_cleanup $1 +} + +pls_gilbert_head() +{ + atf_set descr 'dummynet Gilbert-Elliott packet loss model test' + atf_set require.user root +} + +pls_gilbert_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 65432 ip from any to any" \ + "pf" \ + "pass on ${epair}b" + + # Sanity check + atf_check -s exit:0 -o match:'100 packets transmitted, 100 packets received' ping -i .1 -c 100 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config plr 0.01,0.1,0.8,0.2 + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip from 192.0.2.1 to 192.0.2.2" \ + "pf" \ + "pass on ${epair}b dnpipe 1" + + # check if the expected number of pings + # are dropped (70 - 85 responses). + # repeat up to 6 times if the initial + # checks fail + atf_check -s exit:0 -o match:'100 packets transmitted, (7[0-9]|8[0-5]) packets received' -r 6:10 ping -i 0.010 -c 100 192.0.2.2 +} + +pls_gilbert_cleanup() +{ + firewall_cleanup $1 +} + + + setup_tests \ interface_removal \ ipfw \ @@ -539,4 +635,10 @@ setup_tests \ ipfw \ pf \ nat \ + pf \ + pls_basic \ + ipfw \ + pf \ + pls_gilbert \ + ipfw \ pf From nobody Sun Dec 17 22:06:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StcVP4ZLXz54LTr; Sun, 17 Dec 2023 22:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StcVP2vx8z4qxF; Sun, 17 Dec 2023 22:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702850781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eNLtMlErPwJCSTYOCh0KY7gpSm8NVROVOj6291UPBCw=; b=F+v06bqGZDRqHU9zrdGj8A7demHNtqHI7bYAY0kGV6JOCA7r6Jn0xmq92zdPH8Ixym6Y23 5Pver2RMB2xl2fz/lW3fbWCGJ7wLKOC+NmX0LHKTYA/AMA1LZJUtdi00o6sFOhAqeV+pHU ZvOaRdgcqZoCykETM1Et58Ce/TXEoyhT+xgLzoAgo8vGBWn0vFDYJD4hXOtaTVmMGyIwOR YrZGj7DriubMxFB+AIzDCLHGQKAogRarhNI1+/7Op3AxuI/HvIaeTXyOUl78wrBeKRcCea 7anpphitXx0KJPT9GKPsNcyE4hh4Lv9WQrErBWbzXmyxOJL8RWBGzYTDVojLrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702850781; a=rsa-sha256; cv=none; b=XfV+KsPpKOFpowdLK5Ut5SNYlt208cxaW17hY41cy+dWQbUEvespyKdknu4bUNWShVxx+8 bMrxLTRrTDTLgo2NaEYOGu+XdmCwaNMBED0i8LjvJkvEvEfaN/IX9wOMIETaJ96Sql9xAm Je6JtZRBZwJkO4UyCStE+8sRSzahG8UbLU5UHb/YNMnikV8iRnIsdrH3CFCRuvuzEJl7vH n0qWKbKI/S86XG2OqAfButcDRq1WBIjODC7FYljLq1zQKys5gUHZrs+rPj0ebLmvknM7ct mmI2QgWvEa1ES3b2Gl3L1QoG4JjzRlSxmx4UsgzTwpabirj4R0eYw06Q7OQXoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702850781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eNLtMlErPwJCSTYOCh0KY7gpSm8NVROVOj6291UPBCw=; b=H00jeY0iXAUmpT8qhZMj4HKHWi+/TeYsZBaIMmW5Pie145tWZUmDnDtpWrtoZZfmtF+FJ1 7cOCu9wpO0Mmxvr0MCWWX3r8ffyAzdfqdLMe+jgC5L4x3p6RVRL4+P3ezIpouyOY0GyoT3 EnEnZ3MAiLdz8m6sBIxTChhZXSDOMx8weI/DpufUdH6UrnTGhn2FCQ2yYaMr+OcRqmJ27Y 5olwVhvWQN3zmvYo/pTJ0K7k8YK/X5tUyKN5ir5HnFblG7jaMQhtwzi2Pwki6+EUy4wSu+ aNmVI1UaVGOuZX5Ynjiu5/w61fbBJpKJj6SESoQwmXsXEbUux9+fJcfrA8thpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StcVP1wGJzvqD; Sun, 17 Dec 2023 22:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BHM6LUR062916; Sun, 17 Dec 2023 22:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BHM6LDI062913; Sun, 17 Dec 2023 22:06:21 GMT (envelope-from git) Date: Sun, 17 Dec 2023 22:06:21 GMT Message-Id: <202312172206.3BHM6LDI062913@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: 7aa375dcc61e - main - libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 7aa375dcc61e48cc56da45c9d5a11371693c8043 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7aa375dcc61e48cc56da45c9d5a11371693c8043 commit 7aa375dcc61e48cc56da45c9d5a11371693c8043 Author: Peter Eriksson AuthorDate: 2023-12-17 22:03:13 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-17 22:06:03 +0000 libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3) PR: 275232 MFC after: 1 week --- lib/libc/posix1e/acl_to_text_nfs4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/posix1e/acl_to_text_nfs4.c b/lib/libc/posix1e/acl_to_text_nfs4.c index d901b1cf6b88..157215c9dd52 100644 --- a/lib/libc/posix1e/acl_to_text_nfs4.c +++ b/lib/libc/posix1e/acl_to_text_nfs4.c @@ -72,6 +72,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "user:%d", (unsigned int)*id); else snprintf(str, size, "user:%s", pwd->pw_name); + acl_free(id); break; case ACL_GROUP_OBJ: @@ -91,6 +92,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "group:%d", (unsigned int)*id); else snprintf(str, size, "group:%s", grp->gr_name); + acl_free(id); break; case ACL_EVERYONE: @@ -157,6 +159,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry) if (id == NULL) return (-1); snprintf(str, size, ":%d", (unsigned int)*id); + acl_free(id); } return (0); From nobody Mon Dec 18 02:11:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StjxT2ftGz54dWJ; Mon, 18 Dec 2023 02:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StjxT234qz3Kdt; Mon, 18 Dec 2023 02:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSgnXo+5tFLJ9Yq3Oo3elhbP+d0XMPdeqb0DWsObbSs=; b=mk2L8zmcrRbWvkuzR3YP3FXCNrgULlBFE9VJ3gh+/yBWQP9zhTywGVjlHX1xRGBNTYtkLg y4taOT7QZkyGp/IU8oZKT8LZJIFgH6UjPDNY9Co9EEZY1WlknnR2m+om1mamIBBEVBvvYX sDUof+TG2Y/OHaIIa4nYwHm/nzG/+agP8NUEFHO2gZhD1uL5vUroOjNEAP7ltTOCBZpsJf GWcVuQJTIaLWC1mSSxj+CX4eML/py364zbcqO8eygCiWE76rQwgTr+jOGPmodlfzDx2mHY yckFPMk1SnmR4vZVThlK7KHjq+iVveDEyREd2XKsqhJVsdnpDAr+7uDRJsUewA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702865501; a=rsa-sha256; cv=none; b=elJSsRKCJEdODwsKKe+Vc4Ns/G+fCUMHH4fudSAtEOeAdH7m6he18CQqB4JNUYQrLus1Ag 9GCiyAtqKqgTZ6ypImd48RVrfr8nNyIfusNcujYXpzVX5pfEk6b29n7z7GroH4iishqqeN JZipUxwtMLUgzXCfqtQ+BoFOu8ZzZjfWGzewNFEXPtHFAAZ8Ljt4hVm8Jbx6oIWxRwpO27 d8Rkxusz/EgTMMzz7AbHWZ2rh8PXqpRSjR1s3+LOEzjxnKQvrMq9wEgxqlq5tIGDe/uRYL QFGzGpPy//lxGuy6jqWag8uA8I3KYLKAvrpQc9d88ofzKSQDaT+F30NTuTna+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSgnXo+5tFLJ9Yq3Oo3elhbP+d0XMPdeqb0DWsObbSs=; b=gbAqvIrNUtfUaOxF3YurO5GLRLYDzXPuvdrhoMq6neUTIpXz8eM6Sc7KyEw3Cm/bPd42uh FtbVAfvRm7lW6gPPNbsuEGzkbiJDvqrHQj9h+kly6E8LV9bn24Hozqe3quLXhmKPPp0rlv kUMLMaA4xS0sbe47DVIywvyXBu5qxgte+3POZpvHvEA4qAXVdbvgZE/bpUj43n+W+g2FOo 8B0admRIg7erG9CiJ/YytIKEJ8CNIdSakng5d+01cOVAdFFsT9jcFxrwYeQgaLruiWxJZn Yn5EjhReH+2CYzJmWCJsUa0wSgL5zphss9xhJD2KZyRGbQqYTb1+cJjLod1FJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StjxT13Vwz12q2; Mon, 18 Dec 2023 02:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2Bf32074540; Mon, 18 Dec 2023 02:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2BfUk074537; Mon, 18 Dec 2023 02:11:41 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:11:41 GMT Message-Id: <202312180211.3BI2BfUk074537@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: c976896db7a1 - stable/14 - arm: Compile vfp.c conditionally rather than using an ifdef List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c976896db7a11cd6c6682a8e5613979a717f8487 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c976896db7a11cd6c6682a8e5613979a717f8487 commit c976896db7a11cd6c6682a8e5613979a717f8487 Author: Mark Johnston AuthorDate: 2023-12-11 14:07:40 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:07:45 +0000 arm: Compile vfp.c conditionally rather than using an ifdef No functional change intended. MFC after: 1 week (cherry picked from commit 96465c789a5ff2619c5d49305517b35db9754ffb) --- sys/arm/arm/vfp.c | 4 ---- sys/conf/files.arm | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index 40a3491c1cf9..a4be235e1e01 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -28,8 +28,6 @@ * SUCH DAMAGE. */ -#include -#ifdef VFP #include #include #include @@ -524,5 +522,3 @@ is_fpu_kern_thread(u_int flags __unused) curpcb = curthread->td_pcb; return ((curpcb->pcb_fpflags & PCB_FP_KERN) != 0); } - -#endif diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 344dada420c9..94a8755fd315 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -75,7 +75,7 @@ arm/arm/uio_machdep.c standard arm/arm/undefined.c standard arm/arm/unwind.c optional ddb | kdtrace_hooks | stack arm/arm/vm_machdep.c standard -arm/arm/vfp.c standard +arm/arm/vfp.c optional vfp cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" From nobody Mon Dec 18 02:11:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StjxV4vXVz54dZR; Mon, 18 Dec 2023 02:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StjxV2tr0z3Krm; Mon, 18 Dec 2023 02:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AtR2su/R3xyoBLGP8o0vTPKWB2OJAp1GJw820v/sl8w=; b=CiHdnUDO1XO4Tsjpd9y4EVZgswpU9b2dtCfW1JZQSdqx+llbkB7cn4VNazeC6IGmyuinT+ soU0dxg6GTrw8r+8J6EOmiZs+Sed93ScbmOQCjM7wWmI5yK+CEMCJMdM6NwR/hvNXZEQAc +g0PR4LmfSddnpUfdUQYKTFrhITlNY7oORqiJ4DDrkkv98Xm9/kSHjUCqQnW3Hn4ELPkT0 +YnpOxHeQg6kU4/tbLiWuBqVmsli57zvrTGMtPyOoNcx8ThnTFus0d91RF5Y0x1O34uyb0 Qd748yO3/ic5uBFTuZCTG75M/LO8KQEDzFA8nYi8B46dy/6XxVHmRMKXUY3+eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702865502; a=rsa-sha256; cv=none; b=vsQoILQ02v6yfbEYYXjOpQnjBeSgLRSR9gsXP7rMlT9O9ShS/ex8CMWJCsagM3cYo0KBJl HMIC1BDrmNVzSEkQ2Z1X9FyidOHOMi8q1VRlJrHZgei8gDSBSK7BnC/EUnFlAD9amiGREw 99532fcONnkQaOTCl2kZgd/7gKCnssvVWdW4Jav6z8F4OdrLtaRF+Etr5bzP7hBhFXoalN D5aZUH39qi7E6Pv+SCsuiaYB3CF1Aeka7qNMNicL6xkWUU7EC14kPQtkKLY36/CgY5ngui sVTxxL7cza9qAEXDUaJ1YOfkYSH1+RUtHY9mwn62J3diNnGwTrbmEwKUAWpAWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AtR2su/R3xyoBLGP8o0vTPKWB2OJAp1GJw820v/sl8w=; b=T8bNw3MCvgADRyLDONuwBMrfBXuEv8rXHpvOmaVZULslC/pALz2PJCnDiGtR20qcCpHOR7 Zfv8M16VNgbqVriVLPC2G2C3/ENLpjGBvBMyZ3RX3LHOBNZ7D67dPc5dAIvgIaJlMUAV86 WzYP4O+iSzXkNt4cl3G3yACzn6kY9IYyVrJ+xi+wlTUyOWisV0/TGrsLKhu8l5xopHIx1a PW/3eoETQh0PLe+lcDfe2gEXpOHrFvahr8Z2wrKhDfrHG/R9ylfeZpyODSjChK8YmapVhr U7kXq52KH5q+uxdC7wLca7qo8mmhk6zSIVQ9cAh3Jf4wQeqFGb6UcHPdD4YBIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StjxV1hXlz11wC; Mon, 18 Dec 2023 02:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2BgAs074576; Mon, 18 Dec 2023 02:11:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2Bgi3074573; Mon, 18 Dec 2023 02:11:42 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:11:42 GMT Message-Id: <202312180211.3BI2Bgi3074573@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: 1126dcdf4055 - stable/14 - arm: Add fpu_kern_alloc_ctx() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 1126dcdf40555464faddddd67e827637c21bac89 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1126dcdf40555464faddddd67e827637c21bac89 commit 1126dcdf40555464faddddd67e827637c21bac89 Author: Mark Johnston AuthorDate: 2023-12-11 14:07:55 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:07:47 +0000 arm: Add fpu_kern_alloc_ctx() This enables the use of some out-of-tree crypto libraries on arm. No functional change intended, there are no callers of this function in the tree currently. Reviewed by: andrew MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D42969 (cherry picked from commit a6a481eaa2e0f02e24b874f1a08bb494a68972c0) --- sys/arm/arm/vfp.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index a4be235e1e01..f2979d4a2b27 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -30,10 +30,10 @@ #include #include +#include #include +#include #include -#include -#include #include #include @@ -52,6 +52,9 @@ static struct undefined_handler vfp10_uh, vfp11_uh; /* If true the VFP unit has 32 double registers, otherwise it has 16 */ static int is_d32; +static MALLOC_DEFINE(M_FPUKERN_CTX, "fpukern_ctx", + "Kernel contexts for VFP state"); + struct fpu_kern_ctx { struct vfp_state *prev; #define FPU_KERN_CTX_DUMMY 0x01 /* avoided save for the kern thread */ @@ -407,6 +410,21 @@ vfp_save_state(struct thread *td, struct pcb *pcb) critical_exit(); } +struct fpu_kern_ctx * +fpu_kern_alloc_ctx(u_int flags) +{ + return (malloc(sizeof(struct fpu_kern_ctx), M_FPUKERN_CTX, + ((flags & FPU_KERN_NOWAIT) ? M_NOWAIT : M_WAITOK) | M_ZERO)); +} + +void +fpu_kern_free_ctx(struct fpu_kern_ctx *ctx) +{ + KASSERT((ctx->flags & FPU_KERN_CTX_INUSE) == 0, ("freeing in-use ctx")); + + free(ctx, M_FPUKERN_CTX); +} + void fpu_kern_enter(struct thread *td, struct fpu_kern_ctx *ctx, u_int flags) { From nobody Mon Dec 18 02:11:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StjxX1qtQz54djm; Mon, 18 Dec 2023 02:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StjxW4dk7z3Kvq; Mon, 18 Dec 2023 02:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oLQgYdZ9i2k8aU6slQjzN4TGnxIv/BC214aQwb/pQM=; b=TynpmDZKTLWHEb0j0kHnN8hS5YZw15nGLPQ5cQ89mVb/m+9eryEISumDSMqgBNMwaB5g72 GfCDtqzZKTkfoliockPyE2KEmdT+hIrmCqxxCy86DSyNNV+9W0XmwrpXfuSFV+VRIW0bYZ +iPIgy6lAH4DI26DDQB0hrCLJoOTlb6afn8DU5YJV/Q+D29U1im+Ld1fgjYr1VeIceEWyk QR83xk7GoHOjfgcBG65EhTzcci14gQsOQYtSSMdMJDbwE7fAipkU+nRQL6F4idVJCm0kQ1 4S+R20/pW5tt2h4pEg8+ervfeIoxsFt/69zmxQQ1Q8D6dIu/4H59HpDSYvZrOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702865503; a=rsa-sha256; cv=none; b=u/JIFOp8nf3tIyNGDLPUVNW551gni6nsMJMK1ts6DhNgaGdIELtYXgqT5bGIGyG+boMjEa emGA7UQS4lY2jPsixl+nTLTbFGqN6nmd61qb/+bbZx4Yt+RnLVUmhFdc5OxoA+qahKPXmY 0rwAqvgcU2wkkw1MlBwWoiGM2i5lTkHw+dG916qCR4TfSyUl4o2hBeSWSwbGVMZgrDSVRY kkQFwgy26JLyFLEXQfbQOUZZst1PhyTFlSYHX/5DGbwbTyieM0jIXxnQaCknG9JTFkCBBy BJpfLsHaZ9L5VJ0Vqwb2TRz482AJ9wE9W7ZE/mmTgxrywfT6JjQh4ShybW4xuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8oLQgYdZ9i2k8aU6slQjzN4TGnxIv/BC214aQwb/pQM=; b=r6rKTXItMvXrkK49wwblgKvMcWYXso/PcQraFChSrbR/N2kT0FLukXWeqhLecmXJcZwU+i NNDeMnN0L1EQlMgXdk2HRDh/z248NL1crtkYOWuODGHhDoVks5XIzZcTtln33Lg0fklxyT LSHqngndgppWvLsiVUoLwXAZkdNKCKmgIDp70oH0i+lnD9YnT2WdpO9eQIuvokLvh6R+lh LTNRA1pJVueBBS+b6xgcvpH4Um71+OEDypJJzfhmpXd4/6cjNMMwmb2T3kSd27/y2YRltn PkgM1anO5bXSpbVHtLnY1vp8YBjUXbG2NJxoSJkP3ZJE6I7/45cyez0dVlQkKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StjxW2nG4z12PD; Mon, 18 Dec 2023 02:11:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2Bh64074637; Mon, 18 Dec 2023 02:11:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2BhOX074634; Mon, 18 Dec 2023 02:11:43 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:11:43 GMT Message-Id: <202312180211.3BI2BhOX074634@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: bc394ad824f5 - stable/14 - arm: Fix handling of undefined instructions in kernel mode List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: bc394ad824f5f09b9ab659c445ed83ef36e7c313 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bc394ad824f5f09b9ab659c445ed83ef36e7c313 commit bc394ad824f5f09b9ab659c445ed83ef36e7c313 Author: Mark Johnston AuthorDate: 2023-12-11 14:08:08 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:07:47 +0000 arm: Fix handling of undefined instructions in kernel mode Only panic if no undefined instruction handler matched the exception. This can arise in practice if the VFP is enabled lazily. While here, fix the panic string to not include a newline. Reviewed by: andrew Obtained from: Stormshield Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D42970 (cherry picked from commit ecc2e6deae71b69a30bf3b7e3354aba002a37d69) --- sys/arm/arm/undefined.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c index 2ebe8797c503..7f93cc231fe7 100644 --- a/sys/arm/arm/undefined.c +++ b/sys/arm/arm/undefined.c @@ -343,11 +343,11 @@ undefinedinstruction(struct trapframe *frame) #else printf("No debugger in kernel.\n"); #endif - return; - } - else - panic("Undefined instruction in kernel (0x%08x).\n", + } else if (uh == NULL) { + panic("Undefined instruction in kernel (0x%08x)", fault_instruction); + } + return; } userret(td, frame); From nobody Mon Dec 18 02:11:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StjxY29DYz54djn; Mon, 18 Dec 2023 02:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StjxX5M71z3L1Q; Mon, 18 Dec 2023 02:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Vnn6S/uxA0usKMjebYAfenc/qLYz4WMP2N5IjNGY0o=; b=lPozLB8q4qx+RxYqgQs4zPB5V/rdrA8c1mXbZHrYSmENZOHNlJmTzChNOt6rWmVF68MV46 lXaxqb/uvXE+rOpgJKnfdQW2NIv9o4iDWE5eVsGkf6LcoicVg1pjaUr+HytfZnsd3Xyibu yrEfTsJ/7T8WHd1H6zu1I7fUZS9oHJAysZJFrcFJZpHQssXgRMK6MQ+pdKIiDSazDGgmqJ zsxBmhkhjmbzQ1189lC84+EqkmgRP77v395F6GZsyFOsxbzK3ZtY20EMN12P2ub+IZXAUx /zSYypqXXf2jSA471qovbc6lfjuquXlM4XU6LhnLWyOeo6Jao/QnzjKdKmSRcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702865504; a=rsa-sha256; cv=none; b=ogU/z9yxP/FUEqm6ZVZH88RmSSDvxkL8MrmQ9YhERzhD3rtkxY2io0f94FGIdSigWnK906 GuC98U+rAs/LmKOKAuwliifdDhgB2tIkwoEvxOanXnZ/7B8EId5o4LIxnni+NXpR1XOYGT JcBKzECtQvd9LPiyjsKvSjgv9T2B1p5fWTD9kne8IrEu+jj4uGLE38DBFibhd2mQ8wmU7L 3AuX+dlhsGh5Guovm2IjXP9QYTY2onsPuQAv5adG41vONvpica3YLt2HvZ/U+30XnMiRo9 jCnqjLs8jy22bn4XYhwYgogAGPEFbu4flhatJPmkauISJqUux58idGWRcHeDPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Vnn6S/uxA0usKMjebYAfenc/qLYz4WMP2N5IjNGY0o=; b=mDz7JZjRj3EP+WCrNK0MVq7a8FMfI4g13HLcJwXhkm6P9SX8S4zKH0S4bWOW2lsGUF5Vil D7sQOWFhXlhhbZXesA5i5AkPDJ/QOSTPD+iFVmu3f2lhQl5DmD0WBxKo4LWAqPT5XLw8J+ H39KZUvF3mnuwsm0Tn0OKnvGg2ulsZi+8hNcwl9q6Bfaap7kjLrBCeRKHy7gLDgolANC/p 7ybtPkqw9470K/+GXEOkeg4WWOp0sqtZOhRJlzfMnlLlVomPiIGpr0ZzaRGdmtKe1ET8Hw G/wI50xQuYfsuRmuM4IG+bl38c7wPijM7YiFUWqeDDK64kfKM8S1UsqPzugD0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StjxX43LVz12q3; Mon, 18 Dec 2023 02:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2BiBT074687; Mon, 18 Dec 2023 02:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2BigI074684; Mon, 18 Dec 2023 02:11:44 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:11:44 GMT Message-Id: <202312180211.3BI2BigI074684@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: 42d1aa88628e - stable/14 - arm: Handle VFP exceptions from the kernel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 42d1aa88628eb1652da648ef6b274155424541ec Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=42d1aa88628eb1652da648ef6b274155424541ec commit 42d1aa88628eb1652da648ef6b274155424541ec Author: Mark Johnston AuthorDate: 2023-12-11 14:08:34 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:07:48 +0000 arm: Handle VFP exceptions from the kernel vfp_bounce() is called when handling an undefined instruction exception, to see if we need to enable the VFP. Previously it would unconditionally panic if the exception came from the kernel, which was simply wrong, and it did not permit lazy initialization of VFP state in the kernel. However, this functionality can be useful and is supported by arm's fpu_kern_enter() implementation. Thus, relax assertions and consume the exception if the thread was in an FPU section. Based on a patch from Stormshield. Reviewed by: andrew MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D42971 (cherry picked from commit 03a07de0d5ee7d58069152070c42d55f7ec32b7c) --- sys/arm/arm/vfp.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index f2979d4a2b27..bbcb468391b6 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -196,8 +196,9 @@ vfp_init(void) SYSINIT(vfp, SI_SUB_CPU, SI_ORDER_ANY, vfp_init, NULL); -/* start VFP unit, restore the vfp registers from the PCB and retry - * the instruction +/* + * Start the VFP unit, restore the VFP registers from the PCB and retry + * the instruction. */ static int vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) @@ -206,9 +207,6 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) struct pcb *curpcb; ksiginfo_t ksi; - if ((code & FAULT_USER) == 0) - panic("undefined floating point instruction in supervisor mode"); - critical_enter(); /* @@ -242,13 +240,19 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) return 1; } + curpcb = curthread->td_pcb; + if ((code & FAULT_USER) == 0 && + (curpcb->pcb_fpflags & PCB_FP_KERN) == 0) { + critical_exit(); + return (1); + } + /* * If the last time this thread used the VFP it was on this core, and * the last thread to use the VFP on this core was this thread, then the * VFP state is valid, otherwise restore this thread's state to the VFP. */ fmxr(fpexc, fpexc | VFPEXC_EN); - curpcb = curthread->td_pcb; cpu = PCPU_GET(cpuid); if (curpcb->pcb_vfpcpu != cpu || curthread != PCPU_GET(fpcurthread)) { vfp_restore(curpcb->pcb_vfpsaved); @@ -258,7 +262,8 @@ vfp_bounce(u_int addr, u_int insn, struct trapframe *frame, int code) critical_exit(); - KASSERT(curpcb->pcb_vfpsaved == &curpcb->pcb_vfpstate, + KASSERT((code & FAULT_USER) == 0 || + curpcb->pcb_vfpsaved == &curpcb->pcb_vfpstate, ("Kernel VFP state in use when entering userspace")); return (0); From nobody Mon Dec 18 02:11:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StjxZ2cXrz54dSm; Mon, 18 Dec 2023 02:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StjxY6BKcz3L3K; Mon, 18 Dec 2023 02:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xnPeFzOdoO+uBbVWSA00J1f5LTi4RNnqlyif+I2wPUM=; b=ImgR5xvSDkG4K/xQufq1ivWAmUetU73oiwMucfwlmSfoDgwIXxYPjKlcirsPvxELDOG3ux AES4Jw0/7yXnG5sUA46kvfhycA1p0Z9guQK9QZ8GBfhSoy7r8SFLKnxHAinMI81EvO7/bO tAT3+97SlGDTDogWnRayzPdvHpfF90kwi/uwfcGQRtDfVnzi+oexf166uHPwf6DN8jvegn UUznTG5UCb09+Dm9WQFMUkxztJa/l8u8f7FC7R/kJvYemaDGW/4ObG39oj2gDjqutoIo5E hp1shI1VWgPmU2D8FmWMdW2uA9Ic+dxhqLUOI4jEuAG76g1p+4lWjbAd+sLe/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702865506; a=rsa-sha256; cv=none; b=xhfaddVnMljqqWSi9AJUq9/Omi3sX41SzjOZIHrZ493hCQHjM0rP7xWRsCMBe9AiC7uI7G AevP0+Ccb9ETMvjoNqn9I+j6p94MMZK4EZP4zyux+r7VD9r/bAo6KXlhz6UxqJrusaJkZd bqo23RcOQWfEsKi7e+QecpD4Ptu9Py5RxS1I6pdElYdDrCfW6IOiO7UylUdsiSEOzt5rqB zErWAPA/6D0gUrLId+q3v/4Vgq3VAUfS6N8HquvEDifTJ6kGg8BD6TpUDRrTJWanfMLNm3 Ad6vGGu6e4YFY9iyZl9XK3PDGWu3HLQh06i16IFxUQzV7lxBxFDpEMlxnxzd3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702865506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xnPeFzOdoO+uBbVWSA00J1f5LTi4RNnqlyif+I2wPUM=; b=m+7RXWe30Y+2KDTaVqHKDPWrorm/87gKbZXNrqUU3uPKLaNUer+ksOy/5XrTwFq1AkSRgS AcdbFpFB4v3kRaRP79ahkqDImNJTP8khw2jt2j5g+J+V/M1JUXWm70SxO5zbTjWtLqrArm +Y4AHfzyJe57SVOUB3sab7Z94KirD8hBXOp6/TfbIbXJUc55qy6DhSJRbdeW52PKzkXBZU rV7+57iI0E12a25DHQriAejb2u5GECCr6NFTfAvnM5Z0wV8BBydPxTXeKuJPC4sid0qz9K I6sUZb3qSWQCNfSIeNKoGZzeHDzQRmKQlHUO2gAuLKvjFDWyc2MaqGgWDAXLlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StjxY4YSwz12vq; Mon, 18 Dec 2023 02:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2Bj0r074732; Mon, 18 Dec 2023 02:11:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2BjLo074730; Mon, 18 Dec 2023 02:11:45 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:11:45 GMT Message-Id: <202312180211.3BI2BjLo074730@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: f5ae760cfe26 - stable/14 - arm: Disable the VFP during boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f5ae760cfe2658d79f12c1b7ac9dc577379e5d1c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f5ae760cfe2658d79f12c1b7ac9dc577379e5d1c commit f5ae760cfe2658d79f12c1b7ac9dc577379e5d1c Author: Mark Johnston AuthorDate: 2023-12-11 14:08:49 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:07:49 +0000 arm: Disable the VFP during boot The VFP code expects the kernel to boot with VFP disabled, but some boards will boot with it enabled. Make sure that vfp_init() disables the VFP on each CPU during boot. PR: 273752 Reviewed by: andrew Diagnosed by: Thomas Skibo MFC after: 1 week (cherry picked from commit ce2f34ade8b787b068085fa8a8ddd295b06c2737) --- sys/arm/arm/vfp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm/arm/vfp.c b/sys/arm/arm/vfp.c index bbcb468391b6..6c398a7a3eaa 100644 --- a/sys/arm/arm/vfp.c +++ b/sys/arm/arm/vfp.c @@ -181,6 +181,8 @@ vfp_init(void) elf_hwcap |= HWCAP_VFPv4; } + vfp_disable(); + /* initialize the coprocess 10 and 11 calls * These are called to restore the registers and enable * the VFP hardware. From nobody Mon Dec 18 02:20:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Stk7T4SDDz54f0x; Mon, 18 Dec 2023 02:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Stk7T41kRz3Y4v; Mon, 18 Dec 2023 02:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702866021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqFQMsczplXI+UJaets/dXcwN5rfBNW6Coh/wNUUYAQ=; b=YvnooAVNxVvS0qI74zPEc1LyXTvcmkHkwPN1Tpz5Ah3FBf0ivhw5tER6xozCia+X1MrIFr 5qzMBCYE4BQeXJjiP6LJ5ypdf/slD/zND2AzcK5Lic4pwdSbTD/zWjv1fbboXu13zI81tG HdCefB4/NrUKnAUp2/yrZnw2JyehCMR9Ph9yKejSi7fQOEpjCkPRnTARMUOxHp9esyNKmF F1SSok7dYRTgOZHQ8V3D5CZUkBbWpxNKOUvILeTU9t7aFZK0TqFcas42xdfU/xUpwcUm0e yjI1We7ms63otB61F5GCSqMhd52Zf2aO4C2JfVkdytDgtJPz7mkg+CaGknUrbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702866021; a=rsa-sha256; cv=none; b=lomD0ZlUq6tGIp7spZ53bjZPVcDjWQ+1mFg6Pi0NMh+Q5Rh0W4JTdSFSWIyJdhVVcJMweB Zx4MwmSSBEt8llqtiBV3gQVJadss9dcaN4TAmzlm2YB7/t5UYGo4BfBRpaaYo8EjgW2c8G GjVeO3UzNkXQQ+fEox+VzPwj26qr6SgyuBfPKvyvIUmYx0oDmqSoCMpYKKWbNQIihRobP8 fSEL1AOq98MUQMvRlujLgw3K18z58Choiptby0BDn/26kwrW/9cg3TViC2szro0V/iEmxx aQ/SKl9z6z2ceT6uM+CWv7FZfJABUkhHU5BqGUCGY69RVZ4zcE2I0JGWnnznyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702866021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqFQMsczplXI+UJaets/dXcwN5rfBNW6Coh/wNUUYAQ=; b=c9ugLii2vgjEGfpy5fWoUJOPY56HyIPsuXj/0lkul5lelHXLq6IQRAJvYvjrDN/0KEK8Sa mCQkFWLjGP6lZwON1phkyNQaiTvJBRJrJZwz7tOURUBXwFhN+NfB8+yJ4oqf7v6+ehgHZ7 fGK9VygG9sK3erGy/lmaB0EA/xZdBSKYAi+FoHSlzfLZ15Vz7Zhcg4iRiM6mibCSGszJy1 OnNH+fnwo/rr3ovglzTkWHOmffdFHwZh43VuFdgjYG4eafB5J8i7U/ymdw9m8ldGHD6eIA jRTVHUnTRJjE4c0Hn0R0spNtrQl3ZkZKNRRdmX2BMDm9wyLHIyGk72AO4k0Qog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Stk7T346Gz12w4; Mon, 18 Dec 2023 02:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI2KLRH089325; Mon, 18 Dec 2023 02:20:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI2KLAh089322; Mon, 18 Dec 2023 02:20:21 GMT (envelope-from git) Date: Mon, 18 Dec 2023 02:20:21 GMT Message-Id: <202312180220.3BI2KLAh089322@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: a9184e99afe8 - stable/14 - kthread: Set *newtdp earlier in kthread_add1() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: a9184e99afe8e8ca7945fc1618d9b0c65bbdc6de Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a9184e99afe8e8ca7945fc1618d9b0c65bbdc6de commit a9184e99afe8e8ca7945fc1618d9b0c65bbdc6de Author: Mark Johnston AuthorDate: 2023-12-09 15:22:06 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 02:20:13 +0000 kthread: Set *newtdp earlier in kthread_add1() syzbot reported a single boot-time crash in g_event_procbody(), a page fault when dereferencing g_event_td. g_event_td is initialized by the kproc_kthread_add() call which creates the GEOM event thread: kproc_kthread_add(g_event_procbody, NULL, &g_proc, &g_event_td, RFHIGHPID, 0, "geom", "g_event"); I believe that the caller of kproc_kthread_add() was preempted after adding the new thread to the scheduler, and before setting *newtdp, which is equal to g_event_td. Thus, since the first action of the GEOM event thread is to lock itself, it ended up dereferencing a NULL pointer. Fix the problem simply by initializing *newtdp earlier. I see no harm in that, and it matches kproc_create1(). The scheduler provides sufficient synchronization to ensure that the store is visible to the new thread, wherever it happens to run. Reported by: syzbot+5397f4d39219b85a9409@syzkaller.appspotmail.com Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42986 (cherry picked from commit ae77041e0714627f9ec8045ca9ee2b6ea563138e) --- sys/kern/kern_kthread.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 6f7fd8b3d555..9cbc74658432 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -287,6 +287,13 @@ kthread_add1(void (*func)(void *), void *arg, struct proc *p, } oldtd = FIRST_THREAD_IN_PROC(p); + /* + * Set the new thread pointer before the thread starts running: *newtdp + * could be a pointer that is referenced by "func". + */ + if (newtdp != NULL) + *newtdp = newtd; + bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&oldtd->td_startcopy, &newtd->td_startcopy, @@ -331,8 +338,6 @@ kthread_add1(void (*func)(void *), void *arg, struct proc *p, thread_lock(newtd); sched_add(newtd, SRQ_BORING); } - if (newtdp) - *newtdp = newtd; return (0); } From nobody Mon Dec 18 05:54:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StptV6R5Bz53vyw; Mon, 18 Dec 2023 05:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StptV629Vz4CwR; Mon, 18 Dec 2023 05:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702878866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DGWKpBKqKk44wNnjPy5Wm/1r53BTZJ+P+UmWC5lRQxk=; b=UPGUxZoOkpg2Et9eqDNWMhy8f8t7v+7YOpBv1k7MMWNIMeTckMRRkcKDT3Zj4V18s/OAHJ F6/G/1+1fJTQ+xxZxSY7GYFcyRt2jsPPUZA7WfrOw8hC8byCWbUZLKFrxHLGLFw53JCiSy kN2Em/QtzR1H2zS/P5W6XjdPaMZuvWkM27cFsWBP31yBmslHzKbBpxRNTQDxW2UreaReum xyuwRAysyP5b50cF5GQl2qhJ4zBM1rb4ZfthZVT5YH/2IRVdmV0KGYhu9z5HgxWBTDI/ex YkWw9qJ1T3tplqw3LaDOTnnxbszqBsAFLsT0DANFfd/9pojgh86xzh5TE6ZuWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702878866; a=rsa-sha256; cv=none; b=Bt3fJU0BaF0Hp6FByG9IOlib57ZaZ+nrD3Nste4MZsETFBb5QHlgdZ822YHlPWKcB17NR+ R4xfGUrbaQVFlIC0TOrZvba1y61qBrYfnLuTDaoTGbnY5xm3iSzTz6sQiVN0XgqqfTu9fi eGF3YPXYyMavazQXuMJr0XRjyBSsHX1vsWxc8raj5R5aUqtv922naunZve1TVcjYtTa2N8 Xe31TiONT7rLG6FLaclFjDQhIpNnUpvUxF8fpgQ3aEBx9XGJEfj1m5Sy1AdzG9IOyVXn55 lyP87kFe4w/ziv1t+j+1ZKzTiqwsuUST8utppSM6N4JuG9GxXJhjaFtXrLqzEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702878866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DGWKpBKqKk44wNnjPy5Wm/1r53BTZJ+P+UmWC5lRQxk=; b=rcltzNG2PZWkMvwEk5v4C/nXrznZTWcHiDdlR8BvCxVMF0oIREFzNwl+rYVqS4+oZALIHP L83zirRqd2Qm5KwdnCY1Xzhh6TULbep6T05+mf0zphlPrl1g8QAEGI6UPJ3obsf//87klX 8jugAdp6PuehCvC1lhPtiMqVpthU4gQ9BGIKH3QXLXtFN+501vYOii1PzmrFBemNLsdSSj xqBvnXX1FKG670YFTEbnR+COEN5MCx9fUuC1iIWVDXAMyx8WUj7YehyGQOSmd3T6bY4NWq Jm5O+hwFDjJDXpkwoc2fPWfjtGHi0VP5DNlVCK1OxT29oFiKkJqhmKiLRTjytg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StptV51Htz1840; Mon, 18 Dec 2023 05:54:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI5sQss047972; Mon, 18 Dec 2023 05:54:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI5sQkX047969; Mon, 18 Dec 2023 05:54:26 GMT (envelope-from git) Date: Mon, 18 Dec 2023 05:54:26 GMT Message-Id: <202312180554.3BI5sQkX047969@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: 0a82cd4f101c - main - calendar: correct the search order for 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0a82cd4f101c5eb8533a0049aaa3f06f005cf8af Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=0a82cd4f101c5eb8533a0049aaa3f06f005cf8af commit 0a82cd4f101c5eb8533a0049aaa3f06f005cf8af Author: Kyle Evans AuthorDate: 2023-12-18 05:53:03 +0000 Commit: Kyle Evans CommitDate: 2023-12-18 05:53:51 +0000 calendar: correct the search order for files Include files that don't begin with a '/' are documented to search the current directory, then /usr/share/calendar. This hasn't been accurate for years, since e061f95e7b9b ("Rework calendar(1) parser") rewrote a lot of this. Stash off the cwd before we do any chdir()ing around and use that to honor the same order we'll follow for the -f flag. This may result in an extra lookup that will fail for the initial calendar file, but I don't think it's worth the complexity to avoid it. While we're here, fix the documentation to just reference the order described in FILES so that we only need to keep it up to date in one place. Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D42278 --- usr.bin/calendar/calendar.1 | 7 +++---- usr.bin/calendar/io.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/usr.bin/calendar/calendar.1 b/usr.bin/calendar/calendar.1 index af368475e4d5..edb3aca48c92 100644 --- a/usr.bin/calendar/calendar.1 +++ b/usr.bin/calendar/calendar.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 31, 2022 +.Dd December 17, 2023 .Dt CALENDAR 1 .Os .Sh NAME @@ -213,9 +213,8 @@ succeeding lines. .Pp If the shared file is not referenced by a full pathname, .Nm -searches in the current (or home) directory first, and then in the -directory -.Pa /usr/share/calendar . +searches in the same order of precedence described in +.Sx FILES . .Pp Blank lines and text protected by the C comment syntax .Ql /* ... */ diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 978027895dfe..17cd5b852c09 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -102,9 +103,11 @@ trimlr(char **buf) static FILE * cal_fopen(const char *file) { + static int cwdfd = -1; FILE *fp; char *home = getenv("HOME"); unsigned int i; + int fd; struct stat sb; static bool warned = false; static char calendarhome[MAXPATHLEN]; @@ -114,6 +117,34 @@ cal_fopen(const char *file) return (NULL); } + /* + * On -a runs, we would have done a chdir() earlier on, but we also + * shouldn't have used the initial cwd anyways lest we bring + * unpredictable behavior upon us. + */ + if (!doall && cwdfd == -1) { + cwdfd = open(".", O_DIRECTORY | O_PATH); + if (cwdfd == -1) + err(1, "open(cwd)"); + } + + /* + * Check $PWD first as documented. + */ + if (cwdfd != -1) { + if ((fd = openat(cwdfd, file, O_RDONLY)) != -1) { + if ((fp = fdopen(fd, "r")) == NULL) + err(1, "fdopen(%s)", file); + + cal_home = NULL; + cal_dir = NULL; + cal_file = file; + return (fp); + } else if (errno != ENOENT && errno != ENAMETOOLONG) { + err(1, "open(%s)", file); + } + } + if (chdir(home) != 0) { warnx("Cannot enter home directory \"%s\"", home); return (NULL); From nobody Mon Dec 18 09:09:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StvCy1Z81z54C8D; Mon, 18 Dec 2023 09:09: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StvCx6pfRz4Vx6; Mon, 18 Dec 2023 09:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702890590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axeb2NwD4LJsBCtvNJP36jLj395Oi7gBxAhf5/49mJY=; b=exReLMCWmwxnTxEwlFiwJym34Fxo/wjA1Qb9+Bf5cUthSBBOgtwLdHuQA5Dnuoq+7RQAtW xIgPY3UWgBo6a4YX64g822tM3n/7V7iDzZh4DU6Xb4ryJ2d4MeEfLJvn6VvxEMFZgPGfqI NpckkGAYPt51p6Uh/puW+yBNLNFKoGC+I3gQzWMOM6+u+v35mG3q8UDOZf8p4WyxzgYDxA 8+Kn6aSSwlf3XdtNUdv/FYcZpl/1ZAUchTfWBpbUkjqdiRDK+EdcwgXDzzwuHd/Vl4dxME Cq3Uf09/xonhqXZt3e1Dxkpzt9rSQtVjSejw0gGi59IgM26mDylWSJhsiVW+6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702890590; a=rsa-sha256; cv=none; b=VCe/27Il+KPFR35bSxDERAM11dNO7vHGVeQZmPsGego8+9lPeajF53QeUbr1zvP3LHTYMu +m8/SkPXhtsQNGJ3qlgnYm5zPymWZlOs9bfnabsvRJnk6H7KA0j5+OHioZbXAXF5+v4pHR WeDkIwcvz21axNxwP6O82YkEuX2dUlySvGskZkRukoPxnD8u1Ubv/bUFaZ2zDt9q8PzmLM W7f8aCnwwf37xFv8Cb1nFcoIT5qQk2D3NuaI88R518d3tSzJ63TwAXNB2dlEeChsHaSMLz IWnb3lGD5i3HSRorIPQncimBGQLNwzsj+jtFmYIzUT4crwuwvJw9BkJvM65BgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702890590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axeb2NwD4LJsBCtvNJP36jLj395Oi7gBxAhf5/49mJY=; b=t+osmQLio+RxMl33h2WEK1EUbz2+dlwAFG23lsxvfhawKm8mLvlAC3LsDZk8JnM7dt/Cc+ aRmfGIY4YysA6Iqm1TdeS6t3h71zvdd5qf+/5srKb99ky13TL0duC/fOuZNJKgjvyF2tKp yNdN6m2Q/DswoTELSFlCeET2hUf6rN6dT6qlrLIx7H/3TlKaEApeYGgLo0CnIlz2CZBP3Q lj5DH5rp9C/AdG/Jy+dDvJ9fyD3egFGdwKRJqEpeVv50bzWkF8TIr64ADZiTe2KeN3h4h7 ZJvvc7wOcMpCfPgwFxmnEoPgf4zAXHYO7VJkBiC/Kgepz8iKeBPj7rb6aj0zsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StvCx4yRtzYm; Mon, 18 Dec 2023 09:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BI99nd2068519; Mon, 18 Dec 2023 09:09:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BI99nDJ068516; Mon, 18 Dec 2023 09:09:49 GMT (envelope-from git) Date: Mon, 18 Dec 2023 09:09:49 GMT Message-Id: <202312180909.3BI99nDJ068516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ram Kishore Vegesna Subject: git: a9504d76ccda - main - ocs_fc: Use xpt_path_sbuf() to copy the path to sbuf. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9504d76ccdad240b7d5761f4208e252f57042dd Auto-Submitted: auto-generated The branch main has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=a9504d76ccdad240b7d5761f4208e252f57042dd commit a9504d76ccdad240b7d5761f4208e252f57042dd Author: Ram Kishore Vegesna AuthorDate: 2023-12-13 07:56:40 +0000 Commit: Ram Kishore Vegesna CommitDate: 2023-12-18 08:52:06 +0000 ocs_fc: Use xpt_path_sbuf() to copy the path to sbuf. Reported by: imp MFC after: 1 week --- sys/dev/ocs_fc/ocs_cam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index 0fa94083e898..a944c7628d85 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1540,15 +1540,13 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, } } else if (scsi_status != OCS_SCSI_STATUS_GOOD) { const char *err_desc = NULL; - char path_str[64]; char err_str[224]; struct sbuf sb; size_t i; sbuf_new(&sb, err_str, sizeof(err_str), 0); - xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str)); - sbuf_cat(&sb, path_str); + xpt_path_sbuf(ccb->ccb_h.path, &sb); for (i = 0; i < (sizeof(ocs_status_desc) / sizeof(ocs_status_desc[0])); i++) { From nobody Mon Dec 18 12:08:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StzBL5Jspz54Pxx; Mon, 18 Dec 2023 12:08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StzBL2C3Fz3Cj5; Mon, 18 Dec 2023 12:08:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702901322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84UIWoGAMU1lGJ3xiFWROZG4Scx4evGnlB4EXYBkIwU=; b=So8zwWZsXP0VR88jWcdDeurcERs4I2+j97CbnNvqNQZdvK1/xUIbFS/eJzHuaqZzOrrTe2 b7+eAVXwx+D537BRHKOsPTWkdE8AIq3ahicY+JClQsT/aZLw4b+f3m5P/EHz3sM75qJP1X QMikdwQAAObPXSWu/0+aNowCoekqxtyOGasyNdtSDjQmc7QRAz5ICo/Cm1+F52CjUCM9tQ VB4gUT2G098ydO7MAyUZB7/QpfQJZvpTwBTsWHcy0AtwUr6qF6iz2o7GF/cVXYXLRD3F8w SnF1V5lRukKb9YCmaquhz7+mQY1uTVkOrfw/GzPVCctYflweS7zv+Wch/22J5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702901322; a=rsa-sha256; cv=none; b=BW/VAMUA435mblnp438c6ZcjJN4lzFr1d16YvQE5RPa9+UxocqsmxoFLRLKQxDRIO9b15s kVrW7x7+BJB93G9r6FjgoO/nT6PFadC7hHqKQjTQulf3qA+Nv3oA6A4CADDNZ3aBPMYwMa 1K1qcub0Yfk9ZZuUKk70EtSpw1DnUzvUlnDzl6827cObyvucmB8rikZn3sNzaXvG+PPwOg hXpOPnjv3PX1E5SNNCmbyy7be1+RLTPDIZVigizfHKI9C4sfu4VW2kNnmNXbaHZ0h0jMvC EajZmJSLwermLNWweoHLLDVgyMIeEU/o80x+FHjPOyaza9ox0qkuLixkHLgz9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702901322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=84UIWoGAMU1lGJ3xiFWROZG4Scx4evGnlB4EXYBkIwU=; b=RmcIlWdF/oBHVd2nEyboB2rNqq6M6HwfUgOxLLqIGURRgotUfF0k7N/1OA9N7fn6n8+Ior bchIQccE8c64a5LA6TjsuBj42hfrSZDww60DoWlRmbWMQvnvKQz60174VYg2uLWo4VcNPZ TLvJcc8m1+yPmH1lf3Vso5VaRuTTUWRmsSY9Wqy8BUl3zGj3sZoyN7bGe150WHo/SuQ8q2 uFrF7MtlaH7dMFPaGrq+JFQLlMXXl+mvh2AEeLanm3J/tn1ndHNS+lSSKaB16kC4I1ejdS d+dxmPtBG7qtj5TSLguDlau+t9uTEB7rAJPnxLTMc+1naIQLo+1xzKkYIqyt+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4StzBL1HJBz5QD; Mon, 18 Dec 2023 12:08:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIC8gSM070298; Mon, 18 Dec 2023 12:08:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIC8gUI070295; Mon, 18 Dec 2023 12:08:42 GMT (envelope-from git) Date: Mon, 18 Dec 2023 12:08:42 GMT Message-Id: <202312181208.3BIC8gUI070295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: e3b9058e5cd0 - main - tcp: properly unroll sack transmission on tx error with LRD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3b9058e5cd0f541da596624a366e14cabcf2e2a Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=e3b9058e5cd0f541da596624a366e14cabcf2e2a commit e3b9058e5cd0f541da596624a366e14cabcf2e2a Author: Richard Scheffenegger AuthorDate: 2023-12-18 12:01:28 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-18 12:02:22 +0000 tcp: properly unroll sack transmission on tx error with LRD Reviewed By: tuexen, #transport MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43085 --- sys/netinet/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index f5b3ff1f03b4..6016aa3b6ddc 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1652,7 +1652,7 @@ timer: ((flags & TH_SYN) == 0) && (error != EPERM)) { if (sack_rxmit) { - p->rxmit -= len; + p->rxmit = SEQ_MIN(p->end, p->rxmit) - len; tp->sackhint.sack_bytes_rexmit -= len; KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, ("sackhint bytes rtx >= 0")); From nobody Mon Dec 18 13:35:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv16Y2lsZz54W2D; Mon, 18 Dec 2023 13:35: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv16Y0k6sz4ckM; Mon, 18 Dec 2023 13:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702906533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPOCTdk8S303PqQ0oBArJB11eXSzfM53UTaN6tryqUc=; b=cixzVZMO0EQNf5x5evi1fBwadN0rRv0KNV3X+F3MsZJDEY8FnUE6GUM3CevS7U0bOEl2Dc fEJy+YJCgA90yeDdZHkkdOt68qbfuGBjUkaLUhcndX68cpFd5V/SKNsia/K/KnYYqPpxbO /18AIVzmnkfElIwxS3766BbwaMxsy51zXSxTy1+us8SwDhDN9qNFyhI/7bSvaDNDUHYGTn FCc5iJHHyUvAeATe2vPomEhpH7BF30EZ/PEr8WQWGs3Q1Rc9q8HCXmkCbMi75iTC0iWbt9 EaXSadsLpnz0ICLHK6bt7Y8dFC3xnbQZx8zXYmvRZFkS3j1KmD/Q2LrD/xRHnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702906533; a=rsa-sha256; cv=none; b=ByMgs5+/QgVAK1pVp6PvFtv6DR++9TyuQJIkmmvanIpcCI/w/vnTOO4w7q9J62cnJETMp8 uWPBAvkOmldhYNKh7fQtmt9THdhfhYp7bgU0bF4e0nU/xpcCX9dgqfjWCnxoqGG5/Y/Q8r cTEYPpshYd0VT3t+EHr032sDfxfNZJRQpsdkrd8thtl7+X9kHpxVkT7L32psCn2HJuJzv4 HNOPh7hNAqzi05S2fZIrj4eERW6J0KYApJZzn/hu8l+mUUZz/eGiK065AZ7Hry2ey5HJBQ /n91zoE/7EPp6LAsqMHWJJGCKOZ9nF+QFgxWSyRR3XfNizMa7TA8x5gMr5pAYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702906533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPOCTdk8S303PqQ0oBArJB11eXSzfM53UTaN6tryqUc=; b=jo9aRYclUJr1uw5qw4hX+BvCLnSr9cBSEv5BSgze/Cyg3ZTwWl/eNswwAWtrMXhiJh84IC uxvli/zgeWLnYBUx/qaTLbnMSkQAksFeYAhl4FY5oS3ICYANhguWst7Ck0hgeByF9mlP97 AK16WsN6wZsA4C3eHVIV9gAFYQ6dvfkqNrJH1HOZcr+hZsAR/Z3s/DxHTQ94G6enWN7NfK cloAAvVpsJL3Pjn60qkAw8ybzwzhkQJqszlogI8V0NKqz3qlpG0GrpNzUENV6xfeHDatZK xNX7YcCatDAhgaG9e651p/lt1z4EBb4cOTZzHvNOUahSUAEdwSotiPIbp1DCmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv16X6xpPz7bS; Mon, 18 Dec 2023 13:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIDZWqT019522; Mon, 18 Dec 2023 13:35:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIDZWsH019519; Mon, 18 Dec 2023 13:35:32 GMT (envelope-from git) Date: Mon, 18 Dec 2023 13:35:32 GMT Message-Id: <202312181335.3BIDZWsH019519@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: 66d77e0f73b2 - main - netlink: fix debug text typo in message parser List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 66d77e0f73b2b0bb2f4f5aa5699bfab82f0c2f5f Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=66d77e0f73b2b0bb2f4f5aa5699bfab82f0c2f5f commit 66d77e0f73b2b0bb2f4f5aa5699bfab82f0c2f5f Author: Igor Ostapenko AuthorDate: 2023-12-18 12:37:36 +0000 Commit: Ed Maste CommitDate: 2023-12-18 13:34:55 +0000 netlink: fix debug text typo in message parser Signed-off-by: Igor Ostapenko Pull-request: https://github.com/freebsd/freebsd-src/pull/942 --- sys/netlink/netlink_message_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netlink/netlink_message_parser.c b/sys/netlink/netlink_message_parser.c index 48d712211a98..4440f8df2df2 100644 --- a/sys/netlink/netlink_message_parser.c +++ b/sys/netlink/netlink_message_parser.c @@ -148,7 +148,7 @@ nl_parse_attrs_raw(struct nlattr *nla_head, int len, const struct nlattr_parser if (error != 0) { uint32_t off = (char *)nla - (char *)npt->hdr; nlmsg_report_err_offset(npt, off); - NL_LOG(LOG_DEBUG3, "parse failed att offset %u", off); + NL_LOG(LOG_DEBUG3, "parse failed at offset %u", off); return (error); } } else { From nobody Mon Dec 18 15:07:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv38Z6qyhz54cZW; Mon, 18 Dec 2023 15:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv38Z6NHXz3bRg; Mon, 18 Dec 2023 15:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702912046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZFmvhc/dm3AFM+CNP5Cu2tZwBVlqhz+t2tVH2k6KsbE=; b=MeUm9H3vB7jet9zt+KA/D/W41aLR3wWjFHOOs+heeU7Cg50D0IFiffhRt8X3+1Pz2w0Hho vHMMfmlWRnz7MmAzpfUjla33RlVM6dSXK9E1suDYvcMM3LMzZJCm+OmmmM6Ma5fdks7/QH 262KchGdY0vSFZlTXv1H/440mcKLJb/leHrcj4IYyw728DUVLiSbJaU0j7XF/ztyS4OxbB lAma94jwOfLscwED+LRlwsEwAUskYN91eycRxqQR1iNoA91rELWQWuP74boMdmXpwXf5UK UsTtXRPft5kWaB697gbdHUWO9GMKFzWjnZ6+meCENscRnODWDUc6yI4C5ytYTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702912046; a=rsa-sha256; cv=none; b=nHexm06le1Z3icbvucM/ab3pSDxqxxI5QxSPJTIaqeEPgNR89UTg4pn96IFDoxXNGW/qmo 90hMhNmDuyglnTL7n83Fpyr0A7fyiB7XvVr44VxroY5zm3knan1/fJC2E2XV1S7GzK7Jod 9keevnytQQFq1SEFlI1OfHLkHxkNON20RQT2YLV5GONa/7HR9S0Xh0RsEsHuVZnUEubC3t He/cY3dFa0LK3eCWoPCWyMRw8lTVHpcVtRT1Gn2GqWI41KpiyY+uxYme4lXe9Bu/DE9vp6 LQEShIazS8lcMKoI+uFizisL6woVrpc2qBo2+i5TOHijB8FNTpggpkHHSRfNfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702912046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZFmvhc/dm3AFM+CNP5Cu2tZwBVlqhz+t2tVH2k6KsbE=; b=imSP5xN19s3omg34LTilulCFEDlVMa/kcQNi+FforCwH4oOsGnAOJqo/a2FgfbgOm7sRCP 2zb+orhvSfEREH3dDH5cvT6jInbNMF6+FoZQEq0kcI+qZoQmKB6yUTRwXQqiqWQ7LeMwW0 wfkVe1veu74OsjeK+K9A8uTKg/vpcJIbzLMe0CrcbqaOgffjHsKTT6nHZNGRWWDOUtM7IX cUOHnPxWD0PN28lh6q6RoSWHJet8zx2bmbRXCsrMYyg74pd2EYGreh8emrhEKEGvpVF+fE oDgxNDy01LKg93dsyO9AewI4CH+UzMtejYYNPm3eztxLB+mtacabGRDOxBrs3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv38Z51x5zBBJ; Mon, 18 Dec 2023 15:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIF7QDx070672; Mon, 18 Dec 2023 15:07:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIF7Qsa070669; Mon, 18 Dec 2023 15:07:26 GMT (envelope-from git) Date: Mon, 18 Dec 2023 15:07:26 GMT Message-Id: <202312181507.3BIF7Qsa070669@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: 18e2c4175f78 - main - Remove _POSIX_PRIORITIZED_IO references from man pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 18e2c4175f78f1aaa648dd7fb7530220aed23671 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=18e2c4175f78f1aaa648dd7fb7530220aed23671 commit 18e2c4175f78f1aaa648dd7fb7530220aed23671 Author: Alan Somers AuthorDate: 2023-11-15 17:56:05 +0000 Commit: Alan Somers CommitDate: 2023-12-18 15:06:55 +0000 Remove _POSIX_PRIORITIZED_IO references from man pages We don't support it, so there's no need to tell readers what would happen if we did. Also, don't remind the user that a certain field is ignored by aio_read. Mentioning every ignored field would make the man pages too verbose. MFC after: 1 week Sponsored by: Axcient Reviewed by: Pau Amma Differential Revision: https://reviews.freebsd.org/D42622 --- lib/libc/sys/aio_fsync.2 | 7 +------ lib/libc/sys/aio_read.2 | 14 -------------- lib/libc/sys/aio_write.2 | 9 +-------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/lib/libc/sys/aio_fsync.2 b/lib/libc/sys/aio_fsync.2 index f386e0653b21..46fc5d95bcfd 100644 --- a/lib/libc/sys/aio_fsync.2 +++ b/lib/libc/sys/aio_fsync.2 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 6, 2021 +.Dd November 15, 2023 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -57,11 +57,6 @@ or for the behavior of .Xr fdatasync 2 . .Pp -If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it, -then the enqueued operation is submitted at a priority equal to that -of the calling process minus -.Fa iocb->aio_reqprio . -.Pp The .Fa iocb pointer may be subsequently used as an argument to diff --git a/lib/libc/sys/aio_read.2 b/lib/libc/sys/aio_read.2 index c6f062fa406d..092315e70c91 100644 --- a/lib/libc/sys/aio_read.2 +++ b/lib/libc/sys/aio_read.2 @@ -71,20 +71,6 @@ the structure is defined in .Xr readv 2 . .Pp -If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it, -then the enqueued operation is submitted at a priority equal to that -of the calling process minus -.Fa iocb->aio_reqprio . -.Pp -The -.Fa iocb->aio_lio_opcode -argument -is ignored by the -.Fn aio_read -and -.Fn aio_readv -system calls. -.Pp The .Fa iocb pointer may be subsequently used as an argument to diff --git a/lib/libc/sys/aio_write.2 b/lib/libc/sys/aio_write.2 index efc0938a5cf9..32ad53019ed2 100644 --- a/lib/libc/sys/aio_write.2 +++ b/lib/libc/sys/aio_write.2 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 2, 2021 +.Dd November 15, 2023 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -84,13 +84,6 @@ is not set for the file descriptor, the write operation will occur at the absolute position from the beginning of the file plus .Fa iocb->aio_offset . .Pp -If -.Dv _POSIX_PRIORITIZED_IO -is defined, and the descriptor supports it, then the enqueued -operation is submitted at a priority equal to that of the calling -process minus -.Fa iocb->aio_reqprio . -.Pp The .Fa iocb pointer may be subsequently used as an argument to From nobody Mon Dec 18 16:03:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv4Nj3Dzpz54gdS for ; Mon, 18 Dec 2023 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv4Nj2m02z4Cx5; Mon, 18 Dec 2023 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702915381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tT1I4DHcmo1wfpPuXysVniYE0uPjHOiOjAxxN9rgG1c=; b=T3Gel/fj5hqyFZ+PsDkb/9G2S+ZAFLuq/Pg0pEBdhVDbhdxVAKpVspkfbOs+8LYaw0Xipq 4TvvDTuB66+sMIGlPONPSD2AUKYlIoKSSPXFF0vzCa2aop6N2WDfxe3MzI3DxJHTzBjkK5 RdgDw0ePA6ctvPobwOwNuv+RLS49h7xTF+k6yM2ueP7b5kcYcjsbJPbw8wl/WyvBSyMgkk LZIb4ED4rsen1uAST2wr0eZtBJ4EYUF5zXKWILnh8MBS8WnCYbR0AIhQ43ZnOtb0yfPhPT YF1R09cCCJXkv4e/z57Rr7Qe5DWrV0elVNA0a3/3NCbV9yFGz886IB1qppThcw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702915381; a=rsa-sha256; cv=none; b=mqzAw2YpchMUiQ2XiX1ZKDa5LUx71K9E6BVnuWn2hyy4xmatrmHh1EQQoYdWBB1QJy9lGZ vMGRhuuk+wvwHSZ43qiVDeUOiLYeKZVfiuq36NPKV75oop82YAUKt/Es/qF8NsHQtkWX+i H9fOt2GQCEsxxoeTlugdrJNW5Qx76MPdbjcpN0Q3lLPbN2xXaPsdfmzBWcl5SV07tNBMUs K3K354NzRNXM9FD3Ns1jwjulLYlAoz/sXuZ2ZRW+D0ZnCRSLQkIbFVe6XkRc5p4tL+PS26 1UIT3GIRLifp4BLEC1nr1EEtv8FkYTOju3RfewOkbUwst7izxSlBwvFGePKJKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702915381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tT1I4DHcmo1wfpPuXysVniYE0uPjHOiOjAxxN9rgG1c=; b=eO3NYdHF++z9noXDafBSlYuDzJzlHic6LG2BEIqt8hH4ND0xOmLWafQQhtj2gwzfpi+Sb2 0kjedjMVwQZBu/PwBcXV9ty/fiHcQHH+xntEOo7Duye7hdufqbaHAwomX37NuBgFxj/eN3 sd5xLeVGeLhkGLo6XiNNJo9WIu33Asb4oEuvILJort1EfmJvGq6f03cEv1D1NFdj/oOTEU OTMPXyeExRLf5RR/v8GncnvM0AZqLxVbZF9lilfo7iUfX0GrAWQs6EvVaY2Zq0qiT54I2n NerIU2TcesBESbg3QZPSLz4yQfv0gnmQpcgYsZi7c2WcGe6C3XPMPepYLR4MTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv4Nj1Y9bzCVf; Mon, 18 Dec 2023 16:03:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIG31Cs071116; Mon, 18 Dec 2023 16:03:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIG31B1071115; Mon, 18 Dec 2023 16:03:01 GMT (envelope-from git) Date: Mon, 18 Dec 2023 16:03:01 GMT Message-Id: <202312181603.3BIG31B1071115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: b3ced7f26826..38f55691cb1b - vendor/openssh - 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssh X-Git-Reftype: branch X-Git-Commit: 38f55691cb1b1029d9daac42fc5b6b1850eb19c3 X-Git-Oldrev: b3ced7f26826767e378a5970a65d875fc1cad61e X-Git-Newrev: 38f55691cb1b1029d9daac42fc5b6b1850eb19c3 Auto-Submitted: auto-generated The branch vendor/openssh has been updated by gordon: URL: https://cgit.FreeBSD.org/src/log/?id=b3ced7f26826..38f55691cb1b 38f55691cb1b Vendor import of OpenSSH 9.6p1 From nobody Mon Dec 18 16:03:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv4P06XTgz54h1J for ; Mon, 18 Dec 2023 16:03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv4P065jDz4DZj; Mon, 18 Dec 2023 16:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702915396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdi4WN1oCxlYbuJoTu/ikrfSsWFawUd9MwyoFaGYxe8=; b=Zo1ZlJf0VTcSJKvCXDKvKbnJPH5aUwjib9ceyAW1dg8I7ipzYDNzQpbHCH4mrIFVCi/JDv bX+nAzw1GpEJ5OtGlOE2WJa8JA5HSJ4KGdQxDOexyuKaqhjqJn/yoz7tZC3rCLtJdKjyZ7 lcoI+ulM+8LcyjBBWQ/dHTk0aA0HMXTZKWY8mdB8JgPLIVON6J5Lyls74Hkc3w4Ap0JFOd F03AA/zxluQ49Cf6qC9Yl9HGpNoqZeRYGEiDPk8ay5I1TG/0UtshmA6DimnViBZiYA1o+A h1zn5KnhwzkSqW5pYZ7txaLvaYvj0juQpgtTXEurAIyZREdsLKQu/UufPX4G3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702915396; a=rsa-sha256; cv=none; b=EqrOtdvWO0X0u2Y7h6XA5vCJQjWWn8fHJfKa0RnKVdQJjyAj9qDX2ZO3P7hN087WF+Brzo 4JnJZElVREyi+GIb9Pd0iFYzggkxE/S0aUKeLQjK01eBVS8VqyDyoFwbxPL3tWLWlltG9Y 20+p+fFc4GNp2gEqazhJitXcIvmhnnM8Iq1OhKQDkkr09/4ct7QWvbRkoVHX+NTJQ8QZdj I5HFohiq6EdN7rYcxPJyZXuoY+3xnK9y8D2eWf41FGiVzs0BXdK0elfWvcS6v7QtCWhcsF NXHY/6jNw7hqpmtOCk1dym6mwVogS6zsub3J2EOADMNX5H1NR6NyaUJarmxxng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702915396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zdi4WN1oCxlYbuJoTu/ikrfSsWFawUd9MwyoFaGYxe8=; b=ffb26COYmpQr3bwNnKsry8WC8Jp8AgkevEOFeEj15AkjVQFSCiy0bk1Dmnnqr/XUPcCgCf vRsrV8smsRd6A4DLBTKqO6S0zdQZP5lg5qlqmCLQqzsTgh2LrnJHxTffnS3U3qAfKQlJ/J bRjxactVVaT9KyodkNPxDRyFbWvtFzUfeeTgV0lMeGADC/QKe+qMGuY0/3/uCQlvw0sc9j uAxzLDc3S1KzzDdj59hcXEHc8OaIvXtCZhqporU4aQJMc768y2z9ziPn+sG4pO4kp/BLKV kQJO0hX58bUgkS9aeQR60wDovf01QxWtLOhB9YF/pW4PMnnc2N0PxC1kKp3qrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv4P0593NzCnM; Mon, 18 Dec 2023 16:03:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIG3G9J071244; Mon, 18 Dec 2023 16:03:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIG3G9H071243; Mon, 18 Dec 2023 16:03:16 GMT (envelope-from git) Date: Mon, 18 Dec 2023 16:03:16 GMT Message-Id: <202312181603.3BIG3G9H071243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Gordon Tetlow Subject: git: af9afaf55ffb - Create tag vendor/openssh/9.6p1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssh/9.6p1 X-Git-Reftype: annotated tag X-Git-Commit: af9afaf55ffb98683e0ef1b8d8d4819fd2312ecc Auto-Submitted: auto-generated The annotated tag vendor/openssh/9.6p1 has been created by gordon: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssh/9.6p1 tag vendor/openssh/9.6p1 Tagger: Gordon Tetlow TaggerDate: 2023-12-18 16:02:13 +0000 Tag OpenSSH 9.6p1 -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEuyjUCzYO7pNq7RVv5fe8y6O93fgFAmWAbQUACgkQ5fe8y6O9 3fgvIwgAjmND1dCJ6XDhUMdaZz61eRpzbLMvlIoxOfkT1yL7uSlB7r46d37TAZCh +uKnKKk4FgpK7S/CUtLy2wqwhHydiM1yBs54esr2vfVKtHHYeSon2IzbXnOgN6qX ZIRUoVprqSzJmefzIiM8kfFvQ6ApQzYeWVtz4osteEnaiaisIZi+rIeEhxrWZhOG 25fVRVpsLQhngnICH5m2dLOWXoz45mA9hi6aWSJHlI+n2siKi271lY+9pGHq8PbF 40sIWmR4/qlJRJAAvi2yTZvU0zQ4llU3Z6kJq6094EPKJwxuGmANfEYCadzYdhKy NIwv8GEng0NDaI2a5p4dHyxFqB9bzA== =es8D -----END PGP SIGNATURE----- commit 38f55691cb1b1029d9daac42fc5b6b1850eb19c3 Author: Gordon Tetlow AuthorDate: 2023-12-18 15:59:40 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-18 15:59:40 +0000 Vendor import of OpenSSH 9.6p1 From nobody Mon Dec 18 16:23:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv4rK3238z54jFB; Mon, 18 Dec 2023 16:23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv4rK2KtDz4cpw; Mon, 18 Dec 2023 16:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702916609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CgFQmJl4QNwNHZcSkZYWvO3YF7IqV9+/4M5QzGFDsCw=; b=fKOROFwcfvH9oUENJIZHdrOI7gTIW84zK7Axh201WO0QHIG0EoVMQf7Ur3vfN3Bgl7zKh1 UP1DPUgHpdU+ZKDy5bbo/YmtzWGGEZ0rFCYSy0rGPgt5Uf4X8wyZxl9o5nO4aAP35cxcgy gS0Jw0E2S5uUQJMye4JcVI+Hr26az9UlatYrhaqRum2bt5W+ZDyPhXPZhriYkcYNgTfxBZ 7jK2LFjTSlx4Dh1ZA3yym58vcpQd0bMvcGMlZOGYDBiDYS5WTjCPzx/1BsAeOBwyHVBvf6 bXVl1FozFYmKIZQuBWNemOPhUMTmOGO3oLcWPHxWrO5fpoNH/ISst4LV7rgT9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702916609; a=rsa-sha256; cv=none; b=x6vUzgtj6d1MW65DjPMX+UMtFLtoG79aU3rldUyDk+9JXvTNwxH9huO7UjlXemOhAjJNHm +kSzzGuEtx0jCUKOaShV+biHfPdpG5meEkEEdP+T2X/HiqhAywZ5N6EZVN8bUTrsT6CGDk mE4M8Mi9aTw83bfjI0XnRvBC4rJ00TXiJ85dJXMBXCnhuEDcQtpUaWlox8gGXJWL72UvHm kv55sgRTjSBHTwQyrnUTrm4Vw/DzrS80Nhqoe2DzlIWt7JXvM6Q8sbokY87tnNIAqTTavU jswKvr3Fi71NWTVOo9314F/GRbA9uzXWwF0pzs7HuWmShTQHEPVKArehfiVaTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702916609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CgFQmJl4QNwNHZcSkZYWvO3YF7IqV9+/4M5QzGFDsCw=; b=WlGKzfmR6Mv8jgS6xoU6iM5TR5hsk0qdjNF5yjBP6H/WTZjXuuiJ4uDVkH8xfS8oWKPxPL F5ssEM9PwSTjvnB1bIrXe0giXVaYi6Gw2c0gto3HePzC960NJh5iXFs78nYy/qLxYD8MkQ sziCRy/hVWU12xeKiFsxVvwKPC7oGl5Gzj/wIddmB6RCwdu+aqEwh/2oG8Rb6Od4RMpuv7 MVUy8BQBEwdfJsFWsnUYwxEtrOYdAfqxsI7r499oAAJefHJ1oWLOhRt4Ykd14HBkAMqfmz SZKwm9AfOQ0rD/BenDFtoTxnOi/F+eHPXLe5ebg8OWBdI5y60YBo9W4Ff3i/zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv4rK0H9PzCmJ; Mon, 18 Dec 2023 16:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIGNSVF003703; Mon, 18 Dec 2023 16:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIGNSHr003700; Mon, 18 Dec 2023 16:23:28 GMT (envelope-from git) Date: Mon, 18 Dec 2023 16:23:28 GMT Message-Id: <202312181623.3BIGNSHr003700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Tetlow Subject: git: 92f58c69a14c - main - Implement "strict key exchange" in ssh and sshd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92f58c69a14c0afe910145f177c0e8aeaf9c7da4 Auto-Submitted: auto-generated The branch main has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=92f58c69a14c0afe910145f177c0e8aeaf9c7da4 commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4 Author: Gordon Tetlow AuthorDate: 2023-12-18 16:22:22 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-18 16:22:22 +0000 Implement "strict key exchange" in ssh and sshd. This adds a protocol extension to improve the integrity of the SSH transport protocol, particular in and around the initial key exchange (KEX) phase. Full details of the extension are in the PROTOCOL file. OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 Approved by: so (implicit) Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Security: CVE-2023-48795 --- crypto/openssh/PROTOCOL | 28 +++++++++++- crypto/openssh/kex.c | 82 ++++++++++++++++++++++------------ crypto/openssh/kex.h | 3 +- crypto/openssh/packet.c | 103 +++++++++++++++++++++++++------------------ crypto/openssh/packet.h | 3 +- crypto/openssh/sshconnect2.c | 10 +---- 6 files changed, 146 insertions(+), 83 deletions(-) diff --git a/crypto/openssh/PROTOCOL b/crypto/openssh/PROTOCOL index d453c779be92..ded935eb6752 100644 --- a/crypto/openssh/PROTOCOL +++ b/crypto/openssh/PROTOCOL @@ -137,6 +137,32 @@ than as a named global or channel request to allow pings with very short packet lengths, which would not be possible with other approaches. +1.9 transport: strict key exchange extension + +OpenSSH supports a number of transport-layer hardening measures under +a "strict KEX" feature. This feature is signalled similarly to the +RFC8308 ext-info feature: by including a additional algorithm in the +initiial SSH2_MSG_KEXINIT kex_algorithms field. The client may append +"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server +may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms +are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored +if they are present in subsequent SSH2_MSG_KEXINIT packets. + +When an endpoint that supports this extension observes this algorithm +name in a peer's KEXINIT packet, it MUST make the following changes to +the the protocol: + +a) During initial KEX, terminate the connection if any unexpected or + out-of-sequence packet is received. This includes terminating the + connection if the first packet received is not SSH2_MSG_KEXINIT. + Unexpected packets for the purpose of strict KEX include messages + that are otherwise valid at any time during the connection such as + SSH2_MSG_DEBUG and SSH2_MSG_IGNORE. +b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the + packet sequence number to zero. This behaviour persists for the + duration of the connection (i.e. not just the first + SSH2_MSG_NEWKEYS). + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" @@ -745,4 +771,4 @@ master instance and later clients. OpenSSH extends the usual agent protocol. These changes are documented in the PROTOCOL.agent file. -$OpenBSD: PROTOCOL,v 1.49 2023/08/28 03:28:43 djm Exp $ +$OpenBSD: PROTOCOL,v 1.50 2023/12/18 14:45:17 djm Exp $ diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index 8ff92f2a2d5e..2cb5ab3cf07c 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -65,7 +65,7 @@ #include "xmalloc.h" /* prototype */ -static int kex_choose_conf(struct ssh *); +static int kex_choose_conf(struct ssh *, uint32_t seq); static int kex_input_newkeys(int, u_int32_t, struct ssh *); static const char * const proposal_names[PROPOSAL_MAX] = { @@ -177,6 +177,18 @@ kex_names_valid(const char *names) return 1; } +/* returns non-zero if proposal contains any algorithm from algs */ +static int +has_any_alg(const char *proposal, const char *algs) +{ + char *cp; + + if ((cp = match_list(proposal, algs, NULL)) == NULL) + return 0; + free(cp); + return 1; +} + /* * Concatenate algorithm names, avoiding duplicates in the process. * Caller must free returned string. @@ -184,7 +196,7 @@ kex_names_valid(const char *names) char * kex_names_cat(const char *a, const char *b) { - char *ret = NULL, *tmp = NULL, *cp, *p, *m; + char *ret = NULL, *tmp = NULL, *cp, *p; size_t len; if (a == NULL || *a == '\0') @@ -201,10 +213,8 @@ kex_names_cat(const char *a, const char *b) } strlcpy(ret, a, len); for ((p = strsep(&cp, ",")); p && *p != '\0'; (p = strsep(&cp, ","))) { - if ((m = match_list(ret, p, NULL)) != NULL) { - free(m); + if (has_any_alg(ret, p)) continue; /* Algorithm already present */ - } if (strlcat(ret, ",", len) >= len || strlcat(ret, p, len) >= len) { free(tmp); @@ -334,15 +344,23 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], const char *defpropclient[PROPOSAL_MAX] = { KEX_CLIENT }; const char **defprop = ssh->kex->server ? defpropserver : defpropclient; u_int i; + char *cp; if (prop == NULL) fatal_f("proposal missing"); + /* Append EXT_INFO signalling to KexAlgorithms */ + if (kexalgos == NULL) + kexalgos = defprop[PROPOSAL_KEX_ALGS]; + if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? + "kex-strict-s-v00@openssh.com" : + "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL) + fatal_f("kex_names_cat"); + for (i = 0; i < PROPOSAL_MAX; i++) { switch(i) { case PROPOSAL_KEX_ALGS: - prop[i] = compat_kex_proposal(ssh, - kexalgos ? kexalgos : defprop[i]); + prop[i] = compat_kex_proposal(ssh, cp); break; case PROPOSAL_ENC_ALGS_CTOS: case PROPOSAL_ENC_ALGS_STOC: @@ -363,6 +381,7 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], prop[i] = xstrdup(defprop[i]); } } + free(cp); } void @@ -466,7 +485,12 @@ kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) { int r; - error("kex protocol error: type %d seq %u", type, seq); + /* If in strict mode, any unexpected message is an error */ + if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { + ssh_packet_disconnect(ssh, "strict KEX violation: " + "unexpected packet type %u (seqnr %u)", type, seq); + } + error_f("type %u seq %u", type, seq); if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -563,7 +587,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) if (ninfo >= 1024) { error("SSH2_MSG_EXT_INFO with too many entries, expected " "<=1024, received %u", ninfo); - return SSH_ERR_INVALID_FORMAT; + return dispatch_protocol_error(type, seq, ssh); } for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0) @@ -681,7 +705,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) error_f("no kex"); return SSH_ERR_INTERNAL_ERROR; } - ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); + ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_protocol_error); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; @@ -717,7 +741,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) if (!(kex->flags & KEX_INIT_SENT)) if ((r = kex_send_kexinit(ssh)) != 0) return r; - if ((r = kex_choose_conf(ssh)) != 0) + if ((r = kex_choose_conf(ssh, seq)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL) @@ -981,20 +1005,14 @@ proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX]) return (1); } -/* returns non-zero if proposal contains any algorithm from algs */ static int -has_any_alg(const char *proposal, const char *algs) +kexalgs_contains(char **peer, const char *ext) { - char *cp; - - if ((cp = match_list(proposal, algs, NULL)) == NULL) - return 0; - free(cp); - return 1; + return has_any_alg(peer[PROPOSAL_KEX_ALGS], ext); } static int -kex_choose_conf(struct ssh *ssh) +kex_choose_conf(struct ssh *ssh, uint32_t seq) { struct kex *kex = ssh->kex; struct newkeys *newkeys; @@ -1019,13 +1037,23 @@ kex_choose_conf(struct ssh *ssh) sprop=peer; } - /* Check whether client supports ext_info_c */ - if (kex->server && (kex->flags & KEX_INITIAL)) { - char *ext; - - ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); - kex->ext_info_c = (ext != NULL); - free(ext); + /* Check whether peer supports ext_info/kex_strict */ + if ((kex->flags & KEX_INITIAL) != 0) { + if (kex->server) { + kex->ext_info_c = kexalgs_contains(peer, "ext-info-c"); + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-c-v00@openssh.com"); + } else { + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-s-v00@openssh.com"); + } + if (kex->kex_strict) { + debug3_f("will use strict KEX ordering"); + if (seq != 0) + ssh_packet_disconnect(ssh, + "strict KEX violation: " + "KEXINIT was not the first packet"); + } } /* Check whether client supports rsa-sha2 algorithms */ diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h index 5f7ef784eec9..272ebb43d79d 100644 --- a/crypto/openssh/kex.h +++ b/crypto/openssh/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.119 2023/08/28 03:28:43 djm Exp $ */ +/* $OpenBSD: kex.h,v 1.120 2023/12/18 14:45:17 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -149,6 +149,7 @@ struct kex { u_int kex_type; char *server_sig_algs; int ext_info_c; + int kex_strict; struct sshbuf *my; struct sshbuf *peer; struct sshbuf *client_version; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index d69b903c844c..2d1401e7c9f5 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.312 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.313 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1208,8 +1208,13 @@ ssh_packet_send2_wrapped(struct ssh *ssh) sshbuf_dump(state->output, stderr); #endif /* increment sequence number for outgoing packets */ - if (++state->p_send.seqnr == 0) + if (++state->p_send.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "outgoing sequence number " + "wrapped during initial key exchange"); + } logit("outgoing seqnr wraps around"); + } if (++state->p_send.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1217,6 +1222,11 @@ ssh_packet_send2_wrapped(struct ssh *ssh) state->p_send.bytes += len; sshbuf_reset(state->outgoing_packet); + if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting send seqnr %u", state->p_send.seqnr); + state->p_send.seqnr = 0; + } + if (type == SSH2_MSG_NEWKEYS) r = ssh_set_newkeys(ssh, MODE_OUT); else if (type == SSH2_MSG_USERAUTH_SUCCESS && state->server_side) @@ -1345,8 +1355,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) /* Stay in the loop until we have received a complete packet. */ for (;;) { /* Try to read a packet from the buffer. */ - r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p); - if (r != 0) + if ((r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p)) != 0) break; /* If we got a packet, return it. */ if (*typep != SSH_MSG_NONE) @@ -1417,29 +1426,6 @@ ssh_packet_read(struct ssh *ssh) return type; } -/* - * Waits until a packet has been received, verifies that its type matches - * that given, and gives a fatal error and exits if there is a mismatch. - */ - -int -ssh_packet_read_expect(struct ssh *ssh, u_int expected_type) -{ - int r; - u_char type; - - if ((r = ssh_packet_read_seqnr(ssh, &type, NULL)) != 0) - return r; - if (type != expected_type) { - if ((r = sshpkt_disconnect(ssh, - "Protocol error: expected packet type %d, got %d", - expected_type, type)) != 0) - return r; - return SSH_ERR_PROTOCOL_ERROR; - } - return 0; -} - static int ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { @@ -1630,10 +1616,16 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshbuf_consume(state->input, mac->mac_len)) != 0) goto out; } + if (seqnr_p != NULL) *seqnr_p = state->p_read.seqnr; - if (++state->p_read.seqnr == 0) + if (++state->p_read.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "incoming sequence number " + "wrapped during initial key exchange"); + } logit("incoming seqnr wraps around"); + } if (++state->p_read.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1699,6 +1691,10 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) #endif /* reset for next packet */ state->packlen = 0; + if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting read seqnr %u", state->p_read.seqnr); + state->p_read.seqnr = 0; + } if ((r = ssh_packet_check_rekey(ssh)) != 0) return r; @@ -1721,10 +1717,39 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; - if (*typep) { - state->keep_alive_timeouts = 0; - DBG(debug("received packet type %d", *typep)); + if (*typep == 0) { + /* no message ready */ + return 0; } + state->keep_alive_timeouts = 0; + DBG(debug("received packet type %d", *typep)); + + /* Always process disconnect messages */ + if (*typep == SSH2_MSG_DISCONNECT) { + if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || + (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) + return r; + /* Ignore normal client exit notifications */ + do_log2(ssh->state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s port %d:" + "%u: %.400s", ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), reason, msg); + free(msg); + return SSH_ERR_DISCONNECTED; + } + + /* + * Do not implicitly handle any messages here during initial + * KEX when in strict mode. They will be need to be allowed + * explicitly by the KEX dispatch table or they will generate + * protocol errors. + */ + if (ssh->kex != NULL && + (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) + return 0; + /* Implicitly handle transport-level messages */ switch (*typep) { case SSH2_MSG_IGNORE: debug3("Received SSH2_MSG_IGNORE"); @@ -1739,19 +1764,6 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) debug("Remote: %.900s", msg); free(msg); break; - case SSH2_MSG_DISCONNECT: - if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || - (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) - return r; - /* Ignore normal client exit notifications */ - do_log2(ssh->state->server_side && - reason == SSH2_DISCONNECT_BY_APPLICATION ? - SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, - "Received disconnect from %s port %d:" - "%u: %.400s", ssh_remote_ipaddr(ssh), - ssh_remote_port(ssh), reason, msg); - free(msg); - return SSH_ERR_DISCONNECTED; case SSH2_MSG_UNIMPLEMENTED: if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0) return r; @@ -2244,6 +2256,7 @@ kex_to_blob(struct sshbuf *m, struct kex *kex) (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || + (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || @@ -2406,6 +2419,7 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp) (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || + (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 || (r = sshbuf_get_stringb(m, kex->my)) != 0 || (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || @@ -2734,6 +2748,7 @@ sshpkt_disconnect(struct ssh *ssh, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); + debug2_f("sending SSH2_MSG_DISCONNECT: %s", buf); if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 || (r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h index 11925a27d438..b2bc3215ddbc 100644 --- a/crypto/openssh/packet.h +++ b/crypto/openssh/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.95 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.h,v 1.96 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen @@ -124,7 +124,6 @@ int ssh_packet_send2_wrapped(struct ssh *); int ssh_packet_send2(struct ssh *); int ssh_packet_read(struct ssh *); -int ssh_packet_read_expect(struct ssh *, u_int type); int ssh_packet_read_poll(struct ssh *); int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p); int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len); diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index 90cbba6821e9..6401e304a977 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -358,7 +358,6 @@ struct cauthmethod { }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); -static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -472,7 +471,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -523,12 +522,6 @@ input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) return r; } -static int -input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) -{ - return kex_input_ext_info(type, seqnr, ssh); -} - void userauth(struct ssh *ssh, char *authlist) { @@ -607,6 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } From nobody Mon Dec 18 16:54:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv5X80F34z54klV; Mon, 18 Dec 2023 16:54: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv5X76rzWz4RbV; Mon, 18 Dec 2023 16:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702918471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OQkxiRLcCrEuhhpOsgBo4nloQ7vccJavFkzo3byCHpk=; b=hbSSfUx8lsVBoXVOHEEBRTyBK26nlwxJS7/WbtXKa+Muxn8MEzxoAWi49KgkRgIn12kON3 pLm5mcm2Q6D3IsvhTknP7F+Jttmv0XuT4AkxC5JePRtnHWe5jXfURCkLlhLW2+J0iej32p h1QWaXbdegj/knAdmSW3DqeazbyQS+0T/m24B+HdellDxqcgg453tftJ9+tNIGrRW9Fuhy 6WxgQRP9v6tchlHbfzH54jsHHJt4MfY23AwGJ0+MApMPoPfJg1jGDWIOiHO3lXTSDDwqhk KiUIVov3mpNIJkRqqLXyRTwq6yQxTyJOkgtc5cWvKY4UVEs6qEzcyM5knBeQjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702918471; a=rsa-sha256; cv=none; b=sRD3xAKPRTa9f8nbHjwd3DhV7aaTQafMEKXl0702nxN7RMevGIT+iccfIXbFCjm1vIXCVD l2LnbSzk60IQjQZxLA+uAB2SF9VKU4k/axS59kPWp5ujuU/skHf37EaC3o8FgPO1d6PNFc Gy4odA9XoXCOSjT+8I9hsPvG6o0h4HYbU6zzESuav3q+Zsj9pvcQEYYBi/RsPSSsX/GdlX u5Vb9YzwVDKAYZGm2ekWEip96r9UNoMfaIcpKjF23jx78cWADdmnXK0uJ88BaU8UICyk27 lI5w39qDXCqDGrbS1QwS//kP5Bma2KCUL7PEN4EN8dvmV5r3jq0pk4WeW6/9aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702918471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OQkxiRLcCrEuhhpOsgBo4nloQ7vccJavFkzo3byCHpk=; b=JFApZ+Cf66SaVztIeqG/GilEMhTFnWvkuxpcD1baEGiaMBxo2qzMLha3sEyRCUnIGsUiur oaHkBMNqvwmSH8DruLncwBPwmyWIlJkHHGFK5N+iMtUlI2kZExHohB9FJyhSg8xNeNGYxR 84xL2LgDNXKR6JmF2zFrH7pZ1sOapxSBgFJfsUMuv4mBje6w9FE7t3ltc90yMC79oc1J2Z UmPXipn1MXwWMjiiSCZQkYD+4l4X9/h8JlC4MfMw6iuWAxgrMXo8/lVyANRX1rmWSOrpn0 6bqxUBQ1aNYOg1CJBqTCaaZLiDPMkKVgzMMz8H82X9HgvnaFxUuFVUW5RSDItQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv5X75rTFzTq6; Mon, 18 Dec 2023 16:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIGsVGZ054063; Mon, 18 Dec 2023 16:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIGsV5w054060; Mon, 18 Dec 2023 16:54:31 GMT (envelope-from git) Date: Mon, 18 Dec 2023 16:54:31 GMT Message-Id: <202312181654.3BIGsV5w054060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 673d1ead65c9 - stable/14 - Implement "strict key exchange" in ssh and sshd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 673d1ead65c912ee3b52e507421d499b8104a810 Auto-Submitted: auto-generated The branch stable/14 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=673d1ead65c912ee3b52e507421d499b8104a810 commit 673d1ead65c912ee3b52e507421d499b8104a810 Author: Gordon Tetlow AuthorDate: 2023-12-18 16:22:22 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-18 16:24:39 +0000 Implement "strict key exchange" in ssh and sshd. This adds a protocol extension to improve the integrity of the SSH transport protocol, particular in and around the initial key exchange (KEX) phase. Full details of the extension are in the PROTOCOL file. OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 Approved by: so (implicit) Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Security: CVE-2023-48795 (cherry picked from commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4) --- crypto/openssh/PROTOCOL | 28 +++++++++++- crypto/openssh/kex.c | 82 ++++++++++++++++++++++------------ crypto/openssh/kex.h | 3 +- crypto/openssh/packet.c | 103 +++++++++++++++++++++++++------------------ crypto/openssh/packet.h | 3 +- crypto/openssh/sshconnect2.c | 10 +---- 6 files changed, 146 insertions(+), 83 deletions(-) diff --git a/crypto/openssh/PROTOCOL b/crypto/openssh/PROTOCOL index d453c779be92..ded935eb6752 100644 --- a/crypto/openssh/PROTOCOL +++ b/crypto/openssh/PROTOCOL @@ -137,6 +137,32 @@ than as a named global or channel request to allow pings with very short packet lengths, which would not be possible with other approaches. +1.9 transport: strict key exchange extension + +OpenSSH supports a number of transport-layer hardening measures under +a "strict KEX" feature. This feature is signalled similarly to the +RFC8308 ext-info feature: by including a additional algorithm in the +initiial SSH2_MSG_KEXINIT kex_algorithms field. The client may append +"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server +may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms +are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored +if they are present in subsequent SSH2_MSG_KEXINIT packets. + +When an endpoint that supports this extension observes this algorithm +name in a peer's KEXINIT packet, it MUST make the following changes to +the the protocol: + +a) During initial KEX, terminate the connection if any unexpected or + out-of-sequence packet is received. This includes terminating the + connection if the first packet received is not SSH2_MSG_KEXINIT. + Unexpected packets for the purpose of strict KEX include messages + that are otherwise valid at any time during the connection such as + SSH2_MSG_DEBUG and SSH2_MSG_IGNORE. +b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the + packet sequence number to zero. This behaviour persists for the + duration of the connection (i.e. not just the first + SSH2_MSG_NEWKEYS). + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" @@ -745,4 +771,4 @@ master instance and later clients. OpenSSH extends the usual agent protocol. These changes are documented in the PROTOCOL.agent file. -$OpenBSD: PROTOCOL,v 1.49 2023/08/28 03:28:43 djm Exp $ +$OpenBSD: PROTOCOL,v 1.50 2023/12/18 14:45:17 djm Exp $ diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index 8ff92f2a2d5e..2cb5ab3cf07c 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -65,7 +65,7 @@ #include "xmalloc.h" /* prototype */ -static int kex_choose_conf(struct ssh *); +static int kex_choose_conf(struct ssh *, uint32_t seq); static int kex_input_newkeys(int, u_int32_t, struct ssh *); static const char * const proposal_names[PROPOSAL_MAX] = { @@ -177,6 +177,18 @@ kex_names_valid(const char *names) return 1; } +/* returns non-zero if proposal contains any algorithm from algs */ +static int +has_any_alg(const char *proposal, const char *algs) +{ + char *cp; + + if ((cp = match_list(proposal, algs, NULL)) == NULL) + return 0; + free(cp); + return 1; +} + /* * Concatenate algorithm names, avoiding duplicates in the process. * Caller must free returned string. @@ -184,7 +196,7 @@ kex_names_valid(const char *names) char * kex_names_cat(const char *a, const char *b) { - char *ret = NULL, *tmp = NULL, *cp, *p, *m; + char *ret = NULL, *tmp = NULL, *cp, *p; size_t len; if (a == NULL || *a == '\0') @@ -201,10 +213,8 @@ kex_names_cat(const char *a, const char *b) } strlcpy(ret, a, len); for ((p = strsep(&cp, ",")); p && *p != '\0'; (p = strsep(&cp, ","))) { - if ((m = match_list(ret, p, NULL)) != NULL) { - free(m); + if (has_any_alg(ret, p)) continue; /* Algorithm already present */ - } if (strlcat(ret, ",", len) >= len || strlcat(ret, p, len) >= len) { free(tmp); @@ -334,15 +344,23 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], const char *defpropclient[PROPOSAL_MAX] = { KEX_CLIENT }; const char **defprop = ssh->kex->server ? defpropserver : defpropclient; u_int i; + char *cp; if (prop == NULL) fatal_f("proposal missing"); + /* Append EXT_INFO signalling to KexAlgorithms */ + if (kexalgos == NULL) + kexalgos = defprop[PROPOSAL_KEX_ALGS]; + if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? + "kex-strict-s-v00@openssh.com" : + "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL) + fatal_f("kex_names_cat"); + for (i = 0; i < PROPOSAL_MAX; i++) { switch(i) { case PROPOSAL_KEX_ALGS: - prop[i] = compat_kex_proposal(ssh, - kexalgos ? kexalgos : defprop[i]); + prop[i] = compat_kex_proposal(ssh, cp); break; case PROPOSAL_ENC_ALGS_CTOS: case PROPOSAL_ENC_ALGS_STOC: @@ -363,6 +381,7 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], prop[i] = xstrdup(defprop[i]); } } + free(cp); } void @@ -466,7 +485,12 @@ kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) { int r; - error("kex protocol error: type %d seq %u", type, seq); + /* If in strict mode, any unexpected message is an error */ + if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { + ssh_packet_disconnect(ssh, "strict KEX violation: " + "unexpected packet type %u (seqnr %u)", type, seq); + } + error_f("type %u seq %u", type, seq); if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -563,7 +587,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) if (ninfo >= 1024) { error("SSH2_MSG_EXT_INFO with too many entries, expected " "<=1024, received %u", ninfo); - return SSH_ERR_INVALID_FORMAT; + return dispatch_protocol_error(type, seq, ssh); } for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0) @@ -681,7 +705,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) error_f("no kex"); return SSH_ERR_INTERNAL_ERROR; } - ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); + ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_protocol_error); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; @@ -717,7 +741,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) if (!(kex->flags & KEX_INIT_SENT)) if ((r = kex_send_kexinit(ssh)) != 0) return r; - if ((r = kex_choose_conf(ssh)) != 0) + if ((r = kex_choose_conf(ssh, seq)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL) @@ -981,20 +1005,14 @@ proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX]) return (1); } -/* returns non-zero if proposal contains any algorithm from algs */ static int -has_any_alg(const char *proposal, const char *algs) +kexalgs_contains(char **peer, const char *ext) { - char *cp; - - if ((cp = match_list(proposal, algs, NULL)) == NULL) - return 0; - free(cp); - return 1; + return has_any_alg(peer[PROPOSAL_KEX_ALGS], ext); } static int -kex_choose_conf(struct ssh *ssh) +kex_choose_conf(struct ssh *ssh, uint32_t seq) { struct kex *kex = ssh->kex; struct newkeys *newkeys; @@ -1019,13 +1037,23 @@ kex_choose_conf(struct ssh *ssh) sprop=peer; } - /* Check whether client supports ext_info_c */ - if (kex->server && (kex->flags & KEX_INITIAL)) { - char *ext; - - ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); - kex->ext_info_c = (ext != NULL); - free(ext); + /* Check whether peer supports ext_info/kex_strict */ + if ((kex->flags & KEX_INITIAL) != 0) { + if (kex->server) { + kex->ext_info_c = kexalgs_contains(peer, "ext-info-c"); + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-c-v00@openssh.com"); + } else { + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-s-v00@openssh.com"); + } + if (kex->kex_strict) { + debug3_f("will use strict KEX ordering"); + if (seq != 0) + ssh_packet_disconnect(ssh, + "strict KEX violation: " + "KEXINIT was not the first packet"); + } } /* Check whether client supports rsa-sha2 algorithms */ diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h index 5f7ef784eec9..272ebb43d79d 100644 --- a/crypto/openssh/kex.h +++ b/crypto/openssh/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.119 2023/08/28 03:28:43 djm Exp $ */ +/* $OpenBSD: kex.h,v 1.120 2023/12/18 14:45:17 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -149,6 +149,7 @@ struct kex { u_int kex_type; char *server_sig_algs; int ext_info_c; + int kex_strict; struct sshbuf *my; struct sshbuf *peer; struct sshbuf *client_version; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index d69b903c844c..2d1401e7c9f5 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.312 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.313 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1208,8 +1208,13 @@ ssh_packet_send2_wrapped(struct ssh *ssh) sshbuf_dump(state->output, stderr); #endif /* increment sequence number for outgoing packets */ - if (++state->p_send.seqnr == 0) + if (++state->p_send.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "outgoing sequence number " + "wrapped during initial key exchange"); + } logit("outgoing seqnr wraps around"); + } if (++state->p_send.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1217,6 +1222,11 @@ ssh_packet_send2_wrapped(struct ssh *ssh) state->p_send.bytes += len; sshbuf_reset(state->outgoing_packet); + if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting send seqnr %u", state->p_send.seqnr); + state->p_send.seqnr = 0; + } + if (type == SSH2_MSG_NEWKEYS) r = ssh_set_newkeys(ssh, MODE_OUT); else if (type == SSH2_MSG_USERAUTH_SUCCESS && state->server_side) @@ -1345,8 +1355,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) /* Stay in the loop until we have received a complete packet. */ for (;;) { /* Try to read a packet from the buffer. */ - r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p); - if (r != 0) + if ((r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p)) != 0) break; /* If we got a packet, return it. */ if (*typep != SSH_MSG_NONE) @@ -1417,29 +1426,6 @@ ssh_packet_read(struct ssh *ssh) return type; } -/* - * Waits until a packet has been received, verifies that its type matches - * that given, and gives a fatal error and exits if there is a mismatch. - */ - -int -ssh_packet_read_expect(struct ssh *ssh, u_int expected_type) -{ - int r; - u_char type; - - if ((r = ssh_packet_read_seqnr(ssh, &type, NULL)) != 0) - return r; - if (type != expected_type) { - if ((r = sshpkt_disconnect(ssh, - "Protocol error: expected packet type %d, got %d", - expected_type, type)) != 0) - return r; - return SSH_ERR_PROTOCOL_ERROR; - } - return 0; -} - static int ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { @@ -1630,10 +1616,16 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshbuf_consume(state->input, mac->mac_len)) != 0) goto out; } + if (seqnr_p != NULL) *seqnr_p = state->p_read.seqnr; - if (++state->p_read.seqnr == 0) + if (++state->p_read.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "incoming sequence number " + "wrapped during initial key exchange"); + } logit("incoming seqnr wraps around"); + } if (++state->p_read.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1699,6 +1691,10 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) #endif /* reset for next packet */ state->packlen = 0; + if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting read seqnr %u", state->p_read.seqnr); + state->p_read.seqnr = 0; + } if ((r = ssh_packet_check_rekey(ssh)) != 0) return r; @@ -1721,10 +1717,39 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; - if (*typep) { - state->keep_alive_timeouts = 0; - DBG(debug("received packet type %d", *typep)); + if (*typep == 0) { + /* no message ready */ + return 0; } + state->keep_alive_timeouts = 0; + DBG(debug("received packet type %d", *typep)); + + /* Always process disconnect messages */ + if (*typep == SSH2_MSG_DISCONNECT) { + if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || + (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) + return r; + /* Ignore normal client exit notifications */ + do_log2(ssh->state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s port %d:" + "%u: %.400s", ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), reason, msg); + free(msg); + return SSH_ERR_DISCONNECTED; + } + + /* + * Do not implicitly handle any messages here during initial + * KEX when in strict mode. They will be need to be allowed + * explicitly by the KEX dispatch table or they will generate + * protocol errors. + */ + if (ssh->kex != NULL && + (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) + return 0; + /* Implicitly handle transport-level messages */ switch (*typep) { case SSH2_MSG_IGNORE: debug3("Received SSH2_MSG_IGNORE"); @@ -1739,19 +1764,6 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) debug("Remote: %.900s", msg); free(msg); break; - case SSH2_MSG_DISCONNECT: - if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || - (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) - return r; - /* Ignore normal client exit notifications */ - do_log2(ssh->state->server_side && - reason == SSH2_DISCONNECT_BY_APPLICATION ? - SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, - "Received disconnect from %s port %d:" - "%u: %.400s", ssh_remote_ipaddr(ssh), - ssh_remote_port(ssh), reason, msg); - free(msg); - return SSH_ERR_DISCONNECTED; case SSH2_MSG_UNIMPLEMENTED: if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0) return r; @@ -2244,6 +2256,7 @@ kex_to_blob(struct sshbuf *m, struct kex *kex) (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || + (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || @@ -2406,6 +2419,7 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp) (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || + (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 || (r = sshbuf_get_stringb(m, kex->my)) != 0 || (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || @@ -2734,6 +2748,7 @@ sshpkt_disconnect(struct ssh *ssh, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); + debug2_f("sending SSH2_MSG_DISCONNECT: %s", buf); if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 || (r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h index 11925a27d438..b2bc3215ddbc 100644 --- a/crypto/openssh/packet.h +++ b/crypto/openssh/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.95 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.h,v 1.96 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen @@ -124,7 +124,6 @@ int ssh_packet_send2_wrapped(struct ssh *); int ssh_packet_send2(struct ssh *); int ssh_packet_read(struct ssh *); -int ssh_packet_read_expect(struct ssh *, u_int type); int ssh_packet_read_poll(struct ssh *); int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p); int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len); diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index 90cbba6821e9..6401e304a977 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -358,7 +358,6 @@ struct cauthmethod { }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); -static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -472,7 +471,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -523,12 +522,6 @@ input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) return r; } -static int -input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) -{ - return kex_input_ext_info(type, seqnr, ssh); -} - void userauth(struct ssh *ssh, char *authlist) { @@ -607,6 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } From nobody Mon Dec 18 17:10:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv5tH2rgGz54lnx; Mon, 18 Dec 2023 17:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv5tH1m12z3HQr; Mon, 18 Dec 2023 17:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702919415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgAbTsRsm+ZFj7oGOP0qzzlm01B8lRAfnu74iJf2aCo=; b=I/JvPoDU6Hak8xi62kG3OeBDCo9YegVD4YYIbCm7sZwNQ8MyMOKVDHfMkPIAKoCjiqELEv J8OBoAiULh3jdRfQLiGFvh5BxVw/WCQYZCgxndhhpvAFW4aLzbDuJ8T8D/bDSoRiCIutki bavnCJvO2c7lO7QGUolo9spz9pMWFg8dx2KQu/m5QVwArtOdbSXrLd/AKkMyYvOqzqD3TZ JoWQu4XLzRLYXOTV7MBfhmyIDH99eA+RBysnSaLBIXZf4nFcutlyqXxc6OxWl9BSUQ22Xe OUA4VYnif8QZmQxFCHS3A8hog9u8Fkkoq2IBWozgJJgVp4meBuKvVZJeHBlGxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702919415; a=rsa-sha256; cv=none; b=V5pm/pqVJw9xbBtF+pyEIAZa3Ec+S0TswW6DU3jLXvWdSovAtLtfAOEuEBJlw+Ych0JR5B FwMv4lc7wOrONdPFye/phmVLqMrcj10aBM3MQTJCcaoYcDutVUhqwPIgBJTMkNzgyxA6AD icQYToygbWunjJbb8pcmrXWBHhxSQh4eEuCGiQj9PoF2c9ULZOBhMpUWKdyuHRJM0tbpFJ goUK1IOFdDdMR64XwhzZs9XHitgn36twIj8GAUo/dXvAvJi4YLJf7lLRzgDBZGlB5xBkAD K6ivvFTpMIIBZtcteMGDp+Yqnt6N19eD2hXU/t48hI4yOsUQsligEolZXqJYGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702919415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgAbTsRsm+ZFj7oGOP0qzzlm01B8lRAfnu74iJf2aCo=; b=CCKElXOrW67282dF0ujsZmMJhgOHh4EviBP/ROV43KtYQO7rrVyTVRAhzSHcI9y3er2x+x a44d7KaJJhlhZuuX7NBDGPrvcC84ieUtWSglx72Z0BZ54In/FnCX3a/uFIUFYytz2wITIg ieSxJ1kMxxJuNNUXiYE5/3zNuwrR8ITZNx6fQvYDQb3zzvEcblp89Xvva2JZ3lReSUV5vc IJBzMbPEwOkDC+kqw0WS3jNI+aBbqhRcCagTU4XaLC32Fep3jVXN8Q3e698XoaJdGJsVPC BcsXwssU8L67+2tgOV4q8iPR4hgyiT8iKaY0L/4jFbZkq/GAR7rdQ2nZ0nkSeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv5tH0pNFzTyg; Mon, 18 Dec 2023 17:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIHAFgk079493; Mon, 18 Dec 2023 17:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIHAFBw079480; Mon, 18 Dec 2023 17:10:15 GMT (envelope-from git) Date: Mon, 18 Dec 2023 17:10:15 GMT Message-Id: <202312181710.3BIHAFBw079480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 3bafcb9744c9 - stable/13 - Implement "strict key exchange" in ssh and sshd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3bafcb9744c966ff7750357b24fc7942f2d928d4 Auto-Submitted: auto-generated The branch stable/13 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=3bafcb9744c966ff7750357b24fc7942f2d928d4 commit 3bafcb9744c966ff7750357b24fc7942f2d928d4 Author: Gordon Tetlow AuthorDate: 2023-12-18 16:22:22 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-18 17:09:18 +0000 Implement "strict key exchange" in ssh and sshd. This adds a protocol extension to improve the integrity of the SSH transport protocol, particular in and around the initial key exchange (KEX) phase. Full details of the extension are in the PROTOCOL file. OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 Approved by: so (implicit) Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Security: CVE-2023-48795 (cherry picked from commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4) --- crypto/openssh/PROTOCOL | 26 +++++++++++ crypto/openssh/kex.c | 82 +++++++++++++++++++++++------------ crypto/openssh/kex.h | 1 + crypto/openssh/packet.c | 101 +++++++++++++++++++++++++------------------ crypto/openssh/packet.h | 1 - crypto/openssh/sshconnect2.c | 10 +---- 6 files changed, 142 insertions(+), 79 deletions(-) diff --git a/crypto/openssh/PROTOCOL b/crypto/openssh/PROTOCOL index 27804d0cadbd..ad611a01a200 100644 --- a/crypto/openssh/PROTOCOL +++ b/crypto/openssh/PROTOCOL @@ -104,6 +104,32 @@ http://git.libssh.org/users/aris/libssh.git/plain/doc/curve25519-sha256@libssh.o This is identical to curve25519-sha256 as later published in RFC8731. +1.9 transport: strict key exchange extension + +OpenSSH supports a number of transport-layer hardening measures under +a "strict KEX" feature. This feature is signalled similarly to the +RFC8308 ext-info feature: by including a additional algorithm in the +initiial SSH2_MSG_KEXINIT kex_algorithms field. The client may append +"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server +may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms +are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored +if they are present in subsequent SSH2_MSG_KEXINIT packets. + +When an endpoint that supports this extension observes this algorithm +name in a peer's KEXINIT packet, it MUST make the following changes to +the the protocol: + +a) During initial KEX, terminate the connection if any unexpected or + out-of-sequence packet is received. This includes terminating the + connection if the first packet received is not SSH2_MSG_KEXINIT. + Unexpected packets for the purpose of strict KEX include messages + that are otherwise valid at any time during the connection such as + SSH2_MSG_DEBUG and SSH2_MSG_IGNORE. +b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the + packet sequence number to zero. This behaviour persists for the + duration of the connection (i.e. not just the first + SSH2_MSG_NEWKEYS). + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index b4e2ab75f541..251cff7af530 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -65,7 +65,7 @@ #include "xmalloc.h" /* prototype */ -static int kex_choose_conf(struct ssh *); +static int kex_choose_conf(struct ssh *, uint32_t seq); static int kex_input_newkeys(int, u_int32_t, struct ssh *); static const char * const proposal_names[PROPOSAL_MAX] = { @@ -177,6 +177,18 @@ kex_names_valid(const char *names) return 1; } +/* returns non-zero if proposal contains any algorithm from algs */ +static int +has_any_alg(const char *proposal, const char *algs) +{ + char *cp; + + if ((cp = match_list(proposal, algs, NULL)) == NULL) + return 0; + free(cp); + return 1; +} + /* * Concatenate algorithm names, avoiding duplicates in the process. * Caller must free returned string. @@ -184,7 +196,7 @@ kex_names_valid(const char *names) char * kex_names_cat(const char *a, const char *b) { - char *ret = NULL, *tmp = NULL, *cp, *p, *m; + char *ret = NULL, *tmp = NULL, *cp, *p; size_t len; if (a == NULL || *a == '\0') @@ -201,10 +213,8 @@ kex_names_cat(const char *a, const char *b) } strlcpy(ret, a, len); for ((p = strsep(&cp, ",")); p && *p != '\0'; (p = strsep(&cp, ","))) { - if ((m = match_list(ret, p, NULL)) != NULL) { - free(m); + if (has_any_alg(ret, p)) continue; /* Algorithm already present */ - } if (strlcat(ret, ",", len) >= len || strlcat(ret, p, len) >= len) { free(tmp); @@ -334,15 +344,23 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], const char *defpropclient[PROPOSAL_MAX] = { KEX_CLIENT }; const char **defprop = ssh->kex->server ? defpropserver : defpropclient; u_int i; + char *cp; if (prop == NULL) fatal_f("proposal missing"); + /* Append EXT_INFO signalling to KexAlgorithms */ + if (kexalgos == NULL) + kexalgos = defprop[PROPOSAL_KEX_ALGS]; + if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? + "kex-strict-s-v00@openssh.com" : + "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL) + fatal_f("kex_names_cat"); + for (i = 0; i < PROPOSAL_MAX; i++) { switch(i) { case PROPOSAL_KEX_ALGS: - prop[i] = compat_kex_proposal(ssh, - kexalgos ? kexalgos : defprop[i]); + prop[i] = compat_kex_proposal(ssh, cp); break; case PROPOSAL_ENC_ALGS_CTOS: case PROPOSAL_ENC_ALGS_STOC: @@ -363,6 +381,7 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], prop[i] = xstrdup(defprop[i]); } } + free(cp); } void @@ -466,7 +485,12 @@ kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) { int r; - error("kex protocol error: type %d seq %u", type, seq); + /* If in strict mode, any unexpected message is an error */ + if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { + ssh_packet_disconnect(ssh, "strict KEX violation: " + "unexpected packet type %u (seqnr %u)", type, seq); + } + error_f("type %u seq %u", type, seq); if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -544,7 +568,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) if (ninfo >= 1024) { error("SSH2_MSG_EXT_INFO with too many entries, expected " "<=1024, received %u", ninfo); - return SSH_ERR_INVALID_FORMAT; + return dispatch_protocol_error(type, seq, ssh); } for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0) @@ -660,7 +684,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) error_f("no kex"); return SSH_ERR_INTERNAL_ERROR; } - ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); + ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_protocol_error); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; @@ -696,7 +720,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) if (!(kex->flags & KEX_INIT_SENT)) if ((r = kex_send_kexinit(ssh)) != 0) return r; - if ((r = kex_choose_conf(ssh)) != 0) + if ((r = kex_choose_conf(ssh, seq)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL) @@ -960,20 +984,14 @@ proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX]) return (1); } -/* returns non-zero if proposal contains any algorithm from algs */ static int -has_any_alg(const char *proposal, const char *algs) +kexalgs_contains(char **peer, const char *ext) { - char *cp; - - if ((cp = match_list(proposal, algs, NULL)) == NULL) - return 0; - free(cp); - return 1; + return has_any_alg(peer[PROPOSAL_KEX_ALGS], ext); } static int -kex_choose_conf(struct ssh *ssh) +kex_choose_conf(struct ssh *ssh, uint32_t seq) { struct kex *kex = ssh->kex; struct newkeys *newkeys; @@ -998,13 +1016,23 @@ kex_choose_conf(struct ssh *ssh) sprop=peer; } - /* Check whether client supports ext_info_c */ - if (kex->server && (kex->flags & KEX_INITIAL)) { - char *ext; - - ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); - kex->ext_info_c = (ext != NULL); - free(ext); + /* Check whether peer supports ext_info/kex_strict */ + if ((kex->flags & KEX_INITIAL) != 0) { + if (kex->server) { + kex->ext_info_c = kexalgs_contains(peer, "ext-info-c"); + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-c-v00@openssh.com"); + } else { + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-s-v00@openssh.com"); + } + if (kex->kex_strict) { + debug3_f("will use strict KEX ordering"); + if (seq != 0) + ssh_packet_disconnect(ssh, + "strict KEX violation: " + "KEXINIT was not the first packet"); + } } /* Check whether client supports rsa-sha2 algorithms */ diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h index 8b54e3f4b912..a7ae59bf7869 100644 --- a/crypto/openssh/kex.h +++ b/crypto/openssh/kex.h @@ -148,6 +148,7 @@ struct kex { u_int kex_type; char *server_sig_algs; int ext_info_c; + int kex_strict; struct sshbuf *my; struct sshbuf *peer; struct sshbuf *client_version; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index 3f885c3d01d1..cc492476f675 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1206,8 +1206,13 @@ ssh_packet_send2_wrapped(struct ssh *ssh) sshbuf_dump(state->output, stderr); #endif /* increment sequence number for outgoing packets */ - if (++state->p_send.seqnr == 0) + if (++state->p_send.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "outgoing sequence number " + "wrapped during initial key exchange"); + } logit("outgoing seqnr wraps around"); + } if (++state->p_send.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1215,6 +1220,11 @@ ssh_packet_send2_wrapped(struct ssh *ssh) state->p_send.bytes += len; sshbuf_reset(state->outgoing_packet); + if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting send seqnr %u", state->p_send.seqnr); + state->p_send.seqnr = 0; + } + if (type == SSH2_MSG_NEWKEYS) r = ssh_set_newkeys(ssh, MODE_OUT); else if (type == SSH2_MSG_USERAUTH_SUCCESS && state->server_side) @@ -1343,8 +1353,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) /* Stay in the loop until we have received a complete packet. */ for (;;) { /* Try to read a packet from the buffer. */ - r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p); - if (r != 0) + if ((r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p)) != 0) break; /* If we got a packet, return it. */ if (*typep != SSH_MSG_NONE) @@ -1415,29 +1424,6 @@ ssh_packet_read(struct ssh *ssh) return type; } -/* - * Waits until a packet has been received, verifies that its type matches - * that given, and gives a fatal error and exits if there is a mismatch. - */ - -int -ssh_packet_read_expect(struct ssh *ssh, u_int expected_type) -{ - int r; - u_char type; - - if ((r = ssh_packet_read_seqnr(ssh, &type, NULL)) != 0) - return r; - if (type != expected_type) { - if ((r = sshpkt_disconnect(ssh, - "Protocol error: expected packet type %d, got %d", - expected_type, type)) != 0) - return r; - return SSH_ERR_PROTOCOL_ERROR; - } - return 0; -} - static int ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { @@ -1628,10 +1614,16 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshbuf_consume(state->input, mac->mac_len)) != 0) goto out; } + if (seqnr_p != NULL) *seqnr_p = state->p_read.seqnr; - if (++state->p_read.seqnr == 0) + if (++state->p_read.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "incoming sequence number " + "wrapped during initial key exchange"); + } logit("incoming seqnr wraps around"); + } if (++state->p_read.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1697,6 +1689,10 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) #endif /* reset for next packet */ state->packlen = 0; + if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting read seqnr %u", state->p_read.seqnr); + state->p_read.seqnr = 0; + } if ((r = ssh_packet_check_rekey(ssh)) != 0) return r; @@ -1717,10 +1713,39 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; - if (*typep) { - state->keep_alive_timeouts = 0; - DBG(debug("received packet type %d", *typep)); + if (*typep == 0) { + /* no message ready */ + return 0; } + state->keep_alive_timeouts = 0; + DBG(debug("received packet type %d", *typep)); + + /* Always process disconnect messages */ + if (*typep == SSH2_MSG_DISCONNECT) { + if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || + (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) + return r; + /* Ignore normal client exit notifications */ + do_log2(ssh->state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s port %d:" + "%u: %.400s", ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), reason, msg); + free(msg); + return SSH_ERR_DISCONNECTED; + } + + /* + * Do not implicitly handle any messages here during initial + * KEX when in strict mode. They will be need to be allowed + * explicitly by the KEX dispatch table or they will generate + * protocol errors. + */ + if (ssh->kex != NULL && + (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) + return 0; + /* Implicitly handle transport-level messages */ switch (*typep) { case SSH2_MSG_IGNORE: debug3("Received SSH2_MSG_IGNORE"); @@ -1735,19 +1760,6 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) debug("Remote: %.900s", msg); free(msg); break; - case SSH2_MSG_DISCONNECT: - if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || - (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) - return r; - /* Ignore normal client exit notifications */ - do_log2(ssh->state->server_side && - reason == SSH2_DISCONNECT_BY_APPLICATION ? - SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, - "Received disconnect from %s port %d:" - "%u: %.400s", ssh_remote_ipaddr(ssh), - ssh_remote_port(ssh), reason, msg); - free(msg); - return SSH_ERR_DISCONNECTED; case SSH2_MSG_UNIMPLEMENTED: if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0) return r; @@ -2213,6 +2225,7 @@ kex_to_blob(struct sshbuf *m, struct kex *kex) (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || + (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || @@ -2375,6 +2388,7 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp) (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || + (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 || (r = sshbuf_get_stringb(m, kex->my)) != 0 || (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || @@ -2703,6 +2717,7 @@ sshpkt_disconnect(struct ssh *ssh, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); + debug2_f("sending SSH2_MSG_DISCONNECT: %s", buf); if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 || (r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h index 176488b1e5d2..9fc035b5e04f 100644 --- a/crypto/openssh/packet.h +++ b/crypto/openssh/packet.h @@ -124,7 +124,6 @@ int ssh_packet_send2_wrapped(struct ssh *); int ssh_packet_send2(struct ssh *); int ssh_packet_read(struct ssh *); -int ssh_packet_read_expect(struct ssh *, u_int type); int ssh_packet_read_poll(struct ssh *); int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p); int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len); diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index bc05f02142fd..d30b7364313f 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -358,7 +358,6 @@ struct cauthmethod { }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); -static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -472,7 +471,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -523,12 +522,6 @@ input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) return r; } -static int -input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) -{ - return kex_input_ext_info(type, seqnr, ssh); -} - void userauth(struct ssh *ssh, char *authlist) { @@ -607,6 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } From nobody Mon Dec 18 17:10:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv5th5391z54lcc; Mon, 18 Dec 2023 17:10: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv5th3xd2z3HyY; Mon, 18 Dec 2023 17:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702919436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GrMHpOc5AD9m/EVrTYW5M/xwZ6JT7E5iVrfR709dAVE=; b=waUVpzZ7hWKUCxJMG9M9hN4rp8nhn5x2PS8Yo5du5p4RvxUZDqOY4XLT/fyAvppozvaTOD Ui26Ya5kw8gamc8e94gZlwU0YVZNaH43SKYFflS3vF3kJiQT4GziKKmI4e9gSRk8k3mhPt 1XOUN8EoAWfiaYDUXLlNGcvbO78s3QT2x44mvvrmTMHgq/ypXjJ1TIFR/lQIrMcuekqtXi uhDaUWqWbgCkU0t951g2uwn/0XoxjKNxGZ1gLnSpAV/W6di4/F3pBOGE/4pLPqdW0hvzJj Rb4sAylRuN0kmC/nDrh/zYFwWBJTs84W+1YtphNUpZG5AMVgR6tBVh0Ny3xcnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702919436; a=rsa-sha256; cv=none; b=XtobnZm22LJJOE29oS7lb0kk7Q1QUbilHxS3yAMI1vAJ3aN3y4ESxe+gCjm+sC7axfTpHe qLIpUh3Y4KYEE32oge2l1+/fxPv9671RowWYCPo4pRBoQkMubqg01xyKqXc/NVnPgYnZRn i8xJhjCIW6NeNkpcKEr4YJrxjiFY2b8Sb4qjgo3nrDcFw28DfrnvgicbUtTaaTqVXHaY/L B8NarGlTx7hPeodDulfiIi23Og5z154T19BqS+Tohqzk1aXql8y7qPNiFVqpL5hKe1SKCL Kdho4TQd0QM5RIq8U3UzCQhm33S8uHxIt0bO9c+Ujppud7SWsZnFJ4RsdpHTxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702919436; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GrMHpOc5AD9m/EVrTYW5M/xwZ6JT7E5iVrfR709dAVE=; b=Kj1SHPAyb67NuRw/blqLXEa8xtlFC5zWNdm29rpY3XQzZncj52Y1KIxgeRYWUfpPJEn30h 8L35DD3MI1dWqDK7xdpbd/G1yeTN4v5y/QfgDN/c37QrsH1ISvyUTQkhBWMg66dXnPd7ce c5T7v1AmSeiQhetRsN9VXIwYR2r+ve6S/okwNi/9pgDBimpEfYT32ZgA4CqtaY/9s4sydd JA04QIDdPTcU9/c2iiycIR83P0tC4p8vh+KeUV6ozbtLQSfhxpb23+zMn+xn6cs1708HBC PsqNcfqloyRNC9Ebt4WIzCRjM4w73ooUtqvMP+qj3GCCCrC6qi/z98NhdA2AtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv5th2nMqzTcr; Mon, 18 Dec 2023 17:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIHAaQ0081381; Mon, 18 Dec 2023 17:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIHAaQs081378; Mon, 18 Dec 2023 17:10:36 GMT (envelope-from git) Date: Mon, 18 Dec 2023 17:10:36 GMT Message-Id: <202312181710.3BIHAaQs081378@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: 6aa1b4332f6c - main - efibootmgr: Document -e command line switch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6aa1b4332f6c0b1d97599996beab32e45d0d0de4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6aa1b4332f6c0b1d97599996beab32e45d0d0de4 commit 6aa1b4332f6c0b1d97599996beab32e45d0d0de4 Author: Warner Losh AuthorDate: 2023-12-18 04:32:15 +0000 Commit: Warner Losh CommitDate: 2023-12-18 17:01:38 +0000 efibootmgr: Document -e command line switch -e env will include `env` in the boot loader. Document that the boot loader appends the `env` to the BootXXXX variable, and will parse it as a series of a=b values to set in the boot loader's environment. These assignments are separated by spaces. The env arg needs to be quoted if more than one env var is to be set (we parse only the next argument on the command line). Sponsored by: Netflix --- usr.sbin/efibootmgr/efibootmgr.8 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.8 b/usr.sbin/efibootmgr/efibootmgr.8 index 5805b797ff5c..f74ee8a2e634 100644 --- a/usr.sbin/efibootmgr/efibootmgr.8 +++ b/usr.sbin/efibootmgr/efibootmgr.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 26, 2023 +.Dd December 17, 2023 .Dt EFIBOOTMGR 8 .Os .Sh NAME @@ -130,6 +130,21 @@ Create a new variable (aka method or entry). .It Fl D -dry-run Process but do not change any variables. +.It Fl e -env +When creating a +.Cm Boot +variable, include a set of environment variables for the loader to set after +parsing the command line. +Variables are of the form +.Dq a=b +and separated by spaces. +The argument should be quoted. +.Nm appends these to the end of the +.Cm Boot +environment variable. +Before processing anything else, +.Xr loader.efi 8 +will parse this area and set all variables found there. .It Fl E -esp Print the .Fx @@ -216,16 +231,16 @@ the EFI partition mounted under .Pa /boot/efi , mark the method active, using the given loader and label the method -.Qq FreeBSD-11 : +.Qq FreeBSD-15 : .Pp -.Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-11 +.Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15 .Pp This will result in the next available bootnum being assigned to a new UEFI boot variable, and given the label -.Qq FreeBSD-11 +.Qq FreeBSD-15 such as: .Pp -.Dl Boot0009 FreeBSD-11 +.Dl Boot0009 FreeBSD-15 .Pp Note newly created boot entries are, by default, created inactive, hence the reason From nobody Mon Dec 18 17:10:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv5tj5Bmjz54ljP; Mon, 18 Dec 2023 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv5tj4MXGz3JMs; Mon, 18 Dec 2023 17: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=1702919437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wnXX5eLx8Zh8sX7zdu6jlBwc53FCLbDesfMI/p6h1oI=; b=XEJwszZJiYHXRTfDauyb4cBDByU+lxQYqUv+MBkBdkLVfpbbLEjGG5i809agbYF4qsBzsM vOM5gpo3RFU1kd1+a7EvHlIdX8iITatXQI40tHvTYMz0TN5vcelWqVZhV210zBu39++DEL Hh9sFdBKEld3J3h4EjFVsfhPOZOxsmdjiCPZOtnwAqt0p0mZW/znJkWQM5XiEFohWR0zXD nE5W3sritLMrJ/Y1gHp0SCaa7fpcswV2jSxj69Dp4Pw5uQh14jD7HJtTNH09c91ehlpUzz rzlSvA5pl9IlJ5pGtfP7nDNNFS2Eanu+cADSNgPVyr+FkyFl4pnVQfCtVOemYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702919437; a=rsa-sha256; cv=none; b=ksTlQxs9vZ6H68n5J7dRv+NB4FpocW0cCl+Lt9Mzq5ejVqKfXsYMzgt0R5CuzVv//pXCQG PefKhBmOjySvb+KsHvCbMYpvwS7miKmse/aukN/bqghyaD2LxauWb21B0VZNf0/rDhfJzm 88u1w5hd0MNoxrBLQEvaK9w6glkNhCv+FL5Gdvh9C07Np1Uxiiop6ABXku25XdiH8V8BIy 0VvsNW1wGsHy79Gc6Io05KEUDDSgCHpx/16k9+XI6A9mLhV6gofZmUFUdzSDImwrgmhVP5 Jsk0TgeiokOlGXQALobctYLHOgBsud1JrhxtuTPccm6e92xQDpARPGWcy7qonQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702919437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wnXX5eLx8Zh8sX7zdu6jlBwc53FCLbDesfMI/p6h1oI=; b=hQAzZrh29oBXsm3kCvOC/Oee2odfJWoR9bZZ4mWu6JGfBE5WR8m6rZ3ExVNOQq7K9hpG4k DGT6IKm3m6SUzD1+/8HrR+Qj7WL3MF2FZp8hQvE92RmndBMnsvxUPDkyfhdbdGjjRdTkup n0fAtFlTLiKxPGp9I3dnQ90WCqWft/ABXIMZOtIaJ2CCPyh2Cs4iuobXJ52gHRB9T5hPSg tsA8z23nRuTh5zgToKSFpolM8zVKkjG6fqCZzsyYWFgn6MFpY4p12KJl+8QL4uut1Mmk5d MbYaOVOLQ/vm8141KSPjynXxs02BZzsHhtNiUtOyigxEX31SWLJpXO3SVnTCjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv5tj3SlqzTyj; Mon, 18 Dec 2023 17:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIHAb81081435; Mon, 18 Dec 2023 17:10:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIHAbLc081432; Mon, 18 Dec 2023 17:10:37 GMT (envelope-from git) Date: Mon, 18 Dec 2023 17:10:37 GMT Message-Id: <202312181710.3BIHAbLc081432@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: e02bee0b3e30 - main - efibootmgr: Report the path to the device List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e02bee0b3e30aae85efc882ddae19ae508c3866b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e02bee0b3e30aae85efc882ddae19ae508c3866b commit e02bee0b3e30aae85efc882ddae19ae508c3866b Author: Warner Losh AuthorDate: 2023-12-18 17:06:27 +0000 Commit: Warner Losh CommitDate: 2023-12-18 17:09:13 +0000 efibootmgr: Report the path to the device Report the entire path to the device, rather than the the bit after /dev/ for the --esp command. Nothing in the tree depends on the output format: Only bsdinstall's bootconfig script calls efibootmgr, and it doesn't use the --esp/-E flag. Sponsored by: Netflix --- usr.sbin/efibootmgr/efibootmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/efibootmgr/efibootmgr.c b/usr.sbin/efibootmgr/efibootmgr.c index 65ab247fb271..4a6a7fdfec39 100644 --- a/usr.sbin/efibootmgr/efibootmgr.c +++ b/usr.sbin/efibootmgr/efibootmgr.c @@ -1052,7 +1052,7 @@ report_esp_device(bool do_dp, bool do_unix) abspath[strlen(abspath) - strlen(relpath) - 1] = '\0'; printf("%s\n", abspath); } else { - printf("%s\n", dev); + printf("/dev/%s\n", dev); } free(dev); free(relpath); From nobody Mon Dec 18 17:36:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv6SK18Wyz54n9T; Mon, 18 Dec 2023 17:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv6SK0S8Wz4HX2; Mon, 18 Dec 2023 17: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=1702920977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g063P+8yay5WekGeslbyCm5iZuu6jx2t44+X4HcMyXA=; b=VXIs8EQuniylHpnHJbHVaBo2mx2xJpmLDUfhKWMsd1PNJJVfiST/kRJzdAZaaU1HfoF0un nSXQokgjMzAsJcNrylxIdq7SNQfqPllVoMoVIa+jNeIcekEbE+zmB/s9ygdpq9jE5VkfgI 5K52QrEwrrTgAZiPd/9LH5mtJMeWlOP0cLrb623nEQbR6hjjElkQdRwJRAnXDqjqUAgTP1 pB4TDENxSMOk+sYayus3Jf77PwqHyGJoA1w5UTRPOfFty55xCUu8M0Xb9VRJL2+bFD9u8s rrKsh9+GL0f7FjvtcsW0ift4TVVFAsD0vR3oWFVm5TRk7mks1vO/aajlHC9euw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702920977; a=rsa-sha256; cv=none; b=Ax1ob5tJPk7EdzGzTG48QPNGhwY5NrdM7NCiuIVRs5t5xt+BjKIS4i3FziKZBOGuph/E/M msiPDp4hEIKaBbLSxi/aB/p7bnnGfz2o7zinBtLGxG8eIL8tpo8bIu5vxiU8xwnd5OKIyX zsgsSoS5NUbg+W4AvIQ1tx33KsF/nbM7yfcur6d2k0MATZ1v25vckEw75gkCg0krGu8X31 N1UJsY1BlSyKBKd6k1tgri4T9otx3iJ8LEsnNXX9huqx4ezV2Ck2FaCgDF2V/fS4ZX/h3S tBv165zZ2914vZOUXrBzljEzNVeSCK3yia0pgP/SQkQSL0czAjebWr5E118HPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702920977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g063P+8yay5WekGeslbyCm5iZuu6jx2t44+X4HcMyXA=; b=wVN3QDGdd8XgPGFQvuuEBfbqnUzC+DAMhUcHFCDqKyGjj8Wwele7wTTyEGRsSxayt4XFXt Zv2b70EwWy7rv/3XrrlfwIWAl4qBeAeBz6U1aonGLYzGWcsjJEsbD5wO6hLWCMQZcRAv3a Idf1tnQelky0E0PlNWQYhJi1tnatZK6+eVTnLx2xa01CgYxDc4q/3MmT4w3RJvNP9LZ4o4 WhomBivp1CT7lxLeMFkGFgveEcUHMlrtvoshiQYaQ1NbEgvlI8ouPbqUcPv9ubvHEZNdye V8BVGYQFeeW3R6aWbrmp3LAnTbIPP+X7r0sGNhOv5lm4LIKLCiQ+dD5bJmr6gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv6SJ6d70zVhD; Mon, 18 Dec 2023 17:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIHaGb7021743; Mon, 18 Dec 2023 17:36:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIHaGMD021740; Mon, 18 Dec 2023 17:36:16 GMT (envelope-from git) Date: Mon, 18 Dec 2023 17:36:16 GMT Message-Id: <202312181736.3BIHaGMD021740@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: 052f6ec95bf5 - stable/13 - sshd: remove unneeded initialization of libwrap logging severities List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 052f6ec95bf5e29985b456a7d0287ffef3e01192 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=052f6ec95bf5e29985b456a7d0287ffef3e01192 commit 052f6ec95bf5e29985b456a7d0287ffef3e01192 Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Ed Maste CommitDate: 2023-12-18 17:34:47 +0000 sshd: remove unneeded initialization of libwrap logging severities This part of ca573c9a177 proved to be unnecessary. As the removed comment says, we set them merely for logging syntax errors, as we log refusals ourselves. However, inside the libwrap the parser logs any syntax errors with tcpd_warn() which has hardcoded LOG_WARNING inside. Reviewed by: philip, emaste Differential revision: https://reviews.freebsd.org/D40068 (cherry picked from commit 90f10db8a99659d1baea7b2609d9256c331f61ae) --- crypto/openssh/sshd.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 620a7efe7797..ce8db54a2b72 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -142,8 +142,6 @@ #ifdef LIBWRAP #include #include -extern int allow_severity; -extern int deny_severity; #endif /* LIBWRAP */ /* Re-exec fds */ @@ -1303,7 +1301,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * exactly. sshguard, and supposedly lots * of custom made scripts rely on it. */ - syslog(deny_severity, + syslog(LOG_WARNING, "refused connect from %s (%s)", eval_client(&req), eval_hostaddr(req.client)); @@ -2112,14 +2110,6 @@ main(int ac, char **av) /* Reinitialize the log (because of the fork above). */ log_init(__progname, options.log_level, options.log_facility, log_stderr); -#ifdef LIBWRAP - /* - * We log refusals ourselves. However, libwrap will report - * syntax errors in hosts.allow via syslog(3). - */ - allow_severity = options.log_facility|LOG_INFO; - deny_severity = options.log_facility|LOG_WARNING; -#endif /* Avoid killing the process in high-pressure swapping environments. */ if (!inetd_flag && madvise(NULL, 0, MADV_PROTECT) != 0) debug("madvise(): %.200s", strerror(errno)); From nobody Mon Dec 18 17:36:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv6SL29xNz54nBY; Mon, 18 Dec 2023 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv6SL1PLlz4H72; Mon, 18 Dec 2023 17:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702920978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GFfUzAtR1jinslkEQan8TdWmqOxnGu0hZ212Zvze2+c=; b=u7cXdZSVCT9qHS/HVO4CAEkSMQOnhrKaIuGIFuDKCenYDsThQrrzfoZSeYvxpcxFVFI/TK tv9fSC8iWMDKq1KRnNp7nU+rW1iHa//Fi99OW2vrrTGebg8lpzFx4iwJ3tEgz8k/7t5sRD 5oM2LHJuV74bnJ1kkoozS8FXaYSYzbpZorPODb+7Z9zdUjFPwmoanP095U5VtKOIMjVE2N N+8kjaMtnykyYx5eoajreKqZ6RrZM3w2Cy0c6HuSeeZN3USHDYncBGkcpS/4NSozwGHsEr pDYtOyDgCQRirHnup4bPibioIrWKpOaMDMXcGjt2MQ827ws9/bSvED8kIS6pPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702920978; a=rsa-sha256; cv=none; b=gcmjxI2AHYfvcbgScAzq+q30H1Qc6R1tZMLr+0Qj7cxef51ArFP1Vq9ANHNYYqaW1ZcKGm W1ECLbBm2txHTqycGNfVgz3REXEkYrAu/nUJz2rnl+xv0M3NyLA3A3sWPrkZF9zBroGIP6 xaClAzHHU3hpHX7LALJ8fpryenf0Sul9u0vj2McgHdKJ537daPu0FCB6Z7AhB2FRq0G8zx HQiy2n2eK1JAot+I81YFmwdDqVtqr23/mu0x74/mCOqX0l+KVSABKuJ8GLjX4dLP5n9mHW PET0u01n4XOazqWIG0e2nzZAJx/tcC8wXR7DjCMCNRj4F7UYczl3hR+AAo7MZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702920978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GFfUzAtR1jinslkEQan8TdWmqOxnGu0hZ212Zvze2+c=; b=vyNqzQutSfd6RSTvZ/sGygXGkL4tpgyVt5apbhBk8vKaB5src5/9Q9yrujjiawwHsIBcsf jdgd7NGcCAP40pHcl8gkgnq/OoBgIj1BNGGJOpYkctQJwSBK8nWvK1Kgf3hPBOIUJeQZRA rm0j20d/H2tgsouETgLf0cwFKPMpkU8vS7gPYBsWhmJT28WWa+Qw+62EXiEs9Sr56CuA7R eILtw+aqvmhu0iGtA6vMVUZIPnC9rYA90a00FoRT0FFSD+Ya5+br4KnZa3N2xVn5bTPy9u w2BSL4hCPDXxEEb4K3ajxknLDOOmvjZhxSZezUc/cPP6lHdeVSt9510gP4pTkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv6SL0VCmzWBQ; Mon, 18 Dec 2023 17:36:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIHaH5S021792; Mon, 18 Dec 2023 17:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIHaHF6021789; Mon, 18 Dec 2023 17:36:17 GMT (envelope-from git) Date: Mon, 18 Dec 2023 17:36:17 GMT Message-Id: <202312181736.3BIHaHF6021789@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: 0fbec53dcfb8 - stable/13 - sshd: do not resolve refused client hostname List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0fbec53dcfb8d31aa2e3734992e241422e152433 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0fbec53dcfb8d31aa2e3734992e241422e152433 commit 0fbec53dcfb8d31aa2e3734992e241422e152433 Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Ed Maste CommitDate: 2023-12-18 17:35:47 +0000 sshd: do not resolve refused client hostname This is a compromise between POLA and practical reasoning. We don't want to block the main server loop in an attempt to resolve. But we need to keep the format of the logged message as is, for sake of sshguard and other scripts. So let's print just the IP address twice, this is what libwrap's refuse() would do if it failed to resolve. Reviewed by: philip PR: 269456 Differential revision: https://reviews.freebsd.org/D40069 (cherry picked from commit 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225) --- crypto/openssh/sshd.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index ce8db54a2b72..a82b82d08c14 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -1297,13 +1297,24 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) SO_LINGER, &l, sizeof(l)); (void )close(*newsock); /* - * Mimic message from libwrap's refuse() - * exactly. sshguard, and supposedly lots - * of custom made scripts rely on it. + * Mimic message from libwrap's refuse() as + * precisely as we can afford. The authentic + * message prints the IP address and the + * hostname it resolves to in parentheses. If + * the IP address cannot be resolved to a + * hostname, the IP address will be repeated + * in parentheses. As name resolution in the + * main server loop could stall, and logging + * resolved names adds little or no value to + * incident investigation, this implementation + * only repeats the IP address in parentheses. + * This should resemble librwap's refuse() + * closely enough not to break auditing + * software like sshguard or custom scripts. */ syslog(LOG_WARNING, "refused connect from %s (%s)", - eval_client(&req), + eval_hostaddr(req.client), eval_hostaddr(req.client)); debug("Connection refused by tcp wrapper"); continue; From nobody Mon Dec 18 18:17:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv7Mh4Xglz54qT9; Mon, 18 Dec 2023 18:17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv7Mh3sfQz4LZZ; Mon, 18 Dec 2023 18:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702923440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqroLtddnpUg9/oLELyjEIKmKNVJhHWTYiYcqhw8UAQ=; b=k0Sp7qzuLFwsET7xPMtVIkXDrDSTqAuRcPme8NgbIOgIaMAvt0VU92fw2tCj9Pma0aJTBH M+6chS7+R47ivOVIYd8UfLjHlA3FwQ0XK0HMzfn63xjkcKzNP6AdTE1/6ZWmiMTpJn2cQ6 xKQc9Peb9iCGWo55DqPk4zqdRTj4GGl3lG5TJNFXE5Po5KW4stZMZox2u5wHLbeV8Ile2S btnIlIONoz/865mDldVwZfQY2eYibyH9VBpYUTS9UThUgzXbkYwflyG5oLbUXevKdo60cl goJWZXbM0D7YmxshmYZsO3vXMWOdV95ddo8JStHvfuioEDAGymmJeTIxL1Pc4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702923440; a=rsa-sha256; cv=none; b=KanU23O54KpEBni6cnk+ESSF73sMbb69DVKuMeutqJfJBt6vywrN59IrwO9L1p+tkmwvCH JHNjiVxHagz8PjMUDBmcYiWaO7AnD5elHQ4kZsCko5cGIrHj0/ILT3GJdDpfl4gmOliO3e BkDBPQ6tgpfSXsgwtXge0XoMNbMfZ+1kxbf9GDDyASelCbqEj8JeikNfY54cvBDjnLD0p8 hjA3EHuEeuAEUMw0WrJPr/05cSqsNqvD6o0Us5+yd9u3R52e1gkl2msmtJDmgwfMejRkJW FNZZ1U0JvTievOr8kAEj3O+FOeCcCuLFwDjI253bSg0oFb8+lwr9dD9czDaG5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702923440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZqroLtddnpUg9/oLELyjEIKmKNVJhHWTYiYcqhw8UAQ=; b=SiWhvAig2DBqT3DEk/shFnYFsHADka05Ed+mOC7cMUHDD0G15+88wWbRzHNLMmVU9fR9y/ 0+euNFy73EZ2nRcxCMV9FuhtVhRTOovcFVqCCcWxlfpMIZ+uarbTzphtAFBwfEvQNdNaAl 1eR1j+Dxm6pOM1AviWcj9wnCsT4h4k7/ZbAPoN5pW5l/kH3iaecn+0pKk87go/y7l0h4XZ AFxUmetxdd4HKIvvgStpnpk/ZjUmVrM1zknyWeikizgFyvFVF7VUtAbFzRkqxW505UQywI rLX3VVuoscIMLQHOvboxkd0U1lIhO9dzJqY4yBQoulSDOrJ1NOqXzlrdropJnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv7Mh1sKLzX4N; Mon, 18 Dec 2023 18:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIIHKmB089514; Mon, 18 Dec 2023 18:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIIHK3r089511; Mon, 18 Dec 2023 18:17:20 GMT (envelope-from git) Date: Mon, 18 Dec 2023 18:17:20 GMT Message-Id: <202312181817.3BIIHK3r089511@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: ccf8e1bb38a7 - main - arm64: Remove an unused global variable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ccf8e1bb38a7833417850e205430a0c69581c8c3 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ccf8e1bb38a7833417850e205430a0c69581c8c3 commit ccf8e1bb38a7833417850e205430a0c69581c8c3 Author: Mark Johnston AuthorDate: 2023-11-03 16:30:49 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 18:13:43 +0000 arm64: Remove an unused global variable No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. --- sys/arm64/arm64/pmap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 22bb073b597e..134ad187130c 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -7862,14 +7862,11 @@ pmap_pte_bti(pmap_t pmap, vm_offset_t va __diagused) } #if defined(KASAN) -static vm_paddr_t pmap_san_early_kernstart; static pd_entry_t *pmap_san_early_l2; void __nosanitizeaddress pmap_san_bootstrap(struct arm64_bootparams *abp) { - - pmap_san_early_kernstart = pmap_early_vtophys(KERNBASE); kasan_init_early(abp->kern_stack, KSTACK_PAGES * PAGE_SIZE); } From nobody Mon Dec 18 18:17:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sv7Mj4WTqz54qWL; Mon, 18 Dec 2023 18:17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sv7Mj3QW0z4LjS; Mon, 18 Dec 2023 18:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702923441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T10IDMocRFEZAkyWfs/W5+nzzO5aVW5Kh29O4aQpNEI=; b=rVGUUUmdvasXOO9yqLHPQ1WHUup7Dq05PsFQae/7TMkSe3iq9SybQaH95nUTwY1rE+fhgO tBZ7iW+uz9EeuWYY3p7ofoAsjwVC18/IwipCGUdFiOxguDMnwlnZmt3bmKMD1ChIj2MESU 6yFrf4vKoSkFI9DT4oKppmS/6hdQoNCJxCmKLsFeuTFRLbt1cW8Pzt7GLBMMPGEh1hU/zl nsbYRJlgj3juKRLv4p0VXnHoAAF30bqxYPo+OrAxei8LJGwtqiiFtNQgrZU45phbiQPdWG 8Qpltx1gTsfc+ZzJQw8EvAnqQYU0u+96LTYvmuv+uhLpSUks9CRY35lc6RG4GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702923441; a=rsa-sha256; cv=none; b=HmPF00TOYvfMuVaUQrfgQgGMhMdk65eThI7RYgVqu1RekvI45AaHIAYwroM+eJdbP7B8Ro 2hkL+Lg9Y9EzKlkOlkDr2QSHAy29gcr4BlWtui3tW1UfqhSmgblpacy20xz+QH6upvhl+N sEq0cusCNC5TMIOt+xWzuqBbwKTe4gEVOndJzY+aVgLzIYIKP9yh+XTXmasm9zF4FpO8Bi L4MyGKjeQzWtsGTJvrke7Qb/GSDQZmrS39r1w7399hsxYCZGOMCCiNx2n+/wUnxhSjC4yF JbhQ8SBtS9NEDPVe36HzwnqflIRSFlH8BqBFqmQUDjIt9FLZCI/La2e+riEx2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702923441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T10IDMocRFEZAkyWfs/W5+nzzO5aVW5Kh29O4aQpNEI=; b=uYVHJCKoqpjTcioB+gA2FBabLsAevQ7dTknaPCBD6kUIXBji77XWZVtt08blTZbSwjG92T EznrMHuhZ5PHRIJonrPPVr81tI1LRDpn9eQR2w9eRYaVeBzDhG0rV+ZxWJRO3PotZY7KV3 w8CTSbTpfR12G6UncSjr8ZLE+X0nn8sPTgw9tBgGxs6mpcs/j5Bd4xbmgzyrYBNItzKABL aJjes2cKIavwNHKqsLOoIUDO/7ni0xKwrmqH+3R6cUWVWiwKXwcU0uZ++HyZqwtSmz4Xoc 6EmWCHExYrQWWUh6eQeb2M9z1FXwfLvuaSHQ+Ohe6rsStvg0j9CSB96djqUN2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sv7Mj2SLPzXHK; Mon, 18 Dec 2023 18:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIIHLHn089559; Mon, 18 Dec 2023 18:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIIHLvK089556; Mon, 18 Dec 2023 18:17:21 GMT (envelope-from git) Date: Mon, 18 Dec 2023 18:17:21 GMT Message-Id: <202312181817.3BIIHLvK089556@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: 604de40a024c - main - kqueue.9: Update the description of knlist_clear() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 604de40a024c760df5db542171d3953493f56bfb Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=604de40a024c760df5db542171d3953493f56bfb commit 604de40a024c760df5db542171d3953493f56bfb Author: Mark Johnston AuthorDate: 2023-12-12 14:35:48 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 18:16:48 +0000 kqueue.9: Update the description of knlist_clear() knlist_clear() does not free knotes and so does not call fdrop(), so remove the bit of the function description which claims otherwise. (The knote will be dropped by the next queue scan, and it is at that point that the fd reference will be dropped.) MFC after: 1 week --- share/man/man9/kqueue.9 | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/share/man/man9/kqueue.9 b/share/man/man9/kqueue.9 index ddd834bb1807..8214d7c01673 100644 --- a/share/man/man9/kqueue.9 +++ b/share/man/man9/kqueue.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 20, 2022 +.Dd December 18, 2023 .Dt KQUEUE 9 .Os .Sh NAME @@ -320,16 +320,6 @@ The function will be called when the .Vt knote is deleted during the next scan. -This function must not be used when -.Va f_isfd -is set in -.Vt "struct filterops" , -as the -.Fa td -argument of -.Fn fdrop -will be -.Dv NULL . .Pp The function .Fn knlist_delete From nobody Mon Dec 18 22:28:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvDy22TZMz54BfL; Mon, 18 Dec 2023 22:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvDy217Qqz4cGC; Mon, 18 Dec 2023 22:28:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjJ3ijMX9WmpXrtW0tX5wT3cuTaorjphDeudvyiyJMc=; b=Vk/GmkrtD9v6xxyWBo0z0jnzpF0ZqPtQ7ujvutC6TwV6zw9p//MKSJs4Ts2YUmoF8TaBHc 8TthdCEMkaO5kaypZYbe/6IBKOzzJW9VMN4n9iWDKAXzkLQcS8BPfzXxWGZ4T0PGnhUC6k Sc0SwDANCIXfh4GrGS17rFFoMLGkRyJNP04FDfW2X2ArpcJxkhVcPurryqD8yUU5Xb19Uy 2Nn0FhYbZTuKikHZjfWAbkqE6enbvASyJrv/sFvKj0mnOaLN4Oe8q+VC9dmc+AWEjiyD83 Gtser6rvnq3UkckRqH3KzaveoP5AVV1vblfj3TT9oBufgf8B0uLWMnpqltNW2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702938538; a=rsa-sha256; cv=none; b=E80Srai5cOjhExQZ/RFF/W8ucIwDrG4VnecjBUQT2+P5h0z1TIZSoDqfFeHPK1HaoszFnE 8LnyqZgGkQG4BvzhWMdexiQoDIPBIuRO8PHyCQBKy73T54rN5Y0/0xFTr019cDHiUfDJHH Ns8Y+XYQ13PcOALDxzdKH/N/whQXvNKnhqpbT6MOBZRxTpQFob89H9ltAzlD6aiQZJQ6GR 4+Mv44RtlZgPZpUp6FX4LlRiPor6PWiv4ho5TAE5e88vnAcNJq1Xepfh0B/7wehFH9XI8P AfXBAQuMukS2izpngdp5eP4+0G9trBlzuk6F6EyBrBp0PP4M7q6wxFiAr0fE6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjJ3ijMX9WmpXrtW0tX5wT3cuTaorjphDeudvyiyJMc=; b=wGfEnauqF7MgRGbGqFmoBAYPMnmYJ9xg5UqXeUQXYXqDNT99merVFin3VyE8BQT3thUHgJ Ki6dccebnMGGhXgHTlmOGkNA6YlreIzcR+v1mNjBongVbTL8wmcMyyWfqqtGfzIBTEaGZ6 neewRJ3v3U/GqtC0+3JawQbnOnUjhHnpP7Ic1r/yFd8OidtZOM0It3ZYzqeeuRkYAisZO/ ds1u31fh7d6Je1K45Chh5pzpf6R19gPcZQJSYivg6sRfaVUSoqI3iMDWOhX1M1WabVmFW1 GioK/HwPWVCYqWVJKC3E7XPVb+tXbCS6ZdbPL9b08W1eU7vMmoQH2PdEYhz2OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvDy174pqzfNW; Mon, 18 Dec 2023 22:28:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMSvYB007848; Mon, 18 Dec 2023 22:28:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMSvRC007845; Mon, 18 Dec 2023 22:28:57 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:28:57 GMT Message-Id: <202312182228.3BIMSvRC007845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 300bbb3a43e3 - main - riscv/SYS.h: implement _SYSCALL_BODY() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 300bbb3a43e3cc1337b827b72ff5a22c4321a317 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=300bbb3a43e3cc1337b827b72ff5a22c4321a317 commit 300bbb3a43e3cc1337b827b72ff5a22c4321a317 Author: Brooks Davis AuthorDate: 2023-12-18 22:28:42 +0000 Commit: Brooks Davis CommitDate: 2023-12-18 22:28:42 +0000 riscv/SYS.h: implement _SYSCALL_BODY() macro Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and calls cerror as required. Use to implement PSEUDO() and RSYSCALL(). Reviewed by: imp, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43057 --- lib/libc/riscv/SYS.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/libc/riscv/SYS.h b/lib/libc/riscv/SYS.h index 1e3e67834494..47c79e38f916 100644 --- a/lib/libc/riscv/SYS.h +++ b/lib/libc/riscv/SYS.h @@ -40,23 +40,22 @@ li t0, SYS_ ## name; \ ecall -#define PSEUDO(name) \ -ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ +#define _SYSCALL_BODY(name) \ _SYSCALL(name); \ bnez t0, 1f; \ ret; \ 1: la t1, cerror; \ - jr t1; \ + jr t1 + +#define PSEUDO(name) \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define RSYSCALL(name) \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL(name); \ - bnez t0, 1f; \ - ret; \ -1: la t1, cerror; \ - jr t1; \ + _SYSCALL_BODY(name); \ END(__sys_##name) From nobody Mon Dec 18 22:28:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvDy36Klkz54BfN; Mon, 18 Dec 2023 22:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvDy31twDz4cD8; Mon, 18 Dec 2023 22:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nL3ndP0Zlq8owU6FKQgVXXmgAO46lAbQrik2/qxexmw=; b=dR8EzIzXIUbJSerU/0TgRwDmQzBi9d0IakeJjB3woCRXwlOuIxarlAzp/v3aogYR9L8sLC NtVuKiv9DcTB3DCENzb4iKiAs9sbPjtvp1Q5PqhBBUT8ouXAj4tye6Mkbslj9h2kr/07rz 7l7Q1EwryhgR9cUq4sqU1dgrlohu8ZNjuYpjMtFQt1m9+1cv4VYjBQ9MYbLFXPiisFKG3o x15XaHa5od32npjuKBsnV2v7SSK0wk8Asqe5Qw1tLixWepyo3Iqm3ldpXqSTcFC/mxKO/3 aZVeNU4R2EDGjlKywR/IHO0NgMtcDa24x9xB6EZwmlyU5EW8e9AW3XiT7NgK4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702938539; a=rsa-sha256; cv=none; b=oxxhZSz1MVcFUTcWzHUkLRvTcgSpVvZsH+xGDGCEjIXnIlQvnmp6ZCFxAM/U+VP1RdXKGc p+GNMLorxVuHA4BaK7cUmfhoZrEh5/CaUyJLqOftn+sdCGUWBhEB5RhPu2IVEDyQUiDED4 FuV5fLPawBJR1GXNKZl/SRlg6odiY3eFTe5B6M2kJkUQOrzoDKh7Tzu+8e1tAUt5QP19Tp u+r0HuzfPNoAamPbN7nPkzL+ub9D4lJEjQoamCCpfkg6ywRWYQorlaU1/xvC/Us5rGR1t9 LycHxAFoGShE2ic5X9lVJoScmLs7lEQSP3pkI5IHNZJPxI8H5wEv3lW4AjBV/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nL3ndP0Zlq8owU6FKQgVXXmgAO46lAbQrik2/qxexmw=; b=km5Ok5Ix9OpsH2hgLZESd6+EzoaNeDIcV0nv4PsJsbrV6bsmRvj9GBZiQkdwnWf6pi/Mla XWtb0v8RkaUKEAMwf/w+Xs4elAArD//C3aFAF7jClchUctbkaYzmsVcIaIw0ed82IAjMSf uqqBw5Ol/i6I+aDK1hdGdcmnae5+u93Jcm1xZuBf+vNZBD72gQTgs9EBck7Whu2jR417WB pCmH6AK0eg4ICcVvVm8J+QU6wYd/Y+3a+Ori4Eg+WOi9ioT8uulmDKBcx4FlPyrJuLyvTM Myo+HEr6zdwhZyg39NkAcwdupXBFwgVBPTDrHiZVFg9n7nC9If3BDse1mvGTIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvDy30xzKzdvr; Mon, 18 Dec 2023 22:28:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMSxig007890; Mon, 18 Dec 2023 22:28:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMSxHY007887; Mon, 18 Dec 2023 22:28:59 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:28:59 GMT Message-Id: <202312182228.3BIMSxHY007887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 8f465f509bc1 - main - {amd64,i386}/SYS.h: add _SYSCALL and _SYSCALL_BODY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f465f509bc1b038806963f716263b56004871d3 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=8f465f509bc1b038806963f716263b56004871d3 commit 8f465f509bc1b038806963f716263b56004871d3 Author: Brooks Davis AuthorDate: 2023-12-18 22:28:42 +0000 Commit: Brooks Davis CommitDate: 2023-12-18 22:28:42 +0000 {amd64,i386}/SYS.h: add _SYSCALL and _SYSCALL_BODY Add a _SYSCALL(name) which calls the SYS_name syscall. Use it to add a _SYSCALL_BODY() macro which invokes the syscall and calls cerror as required. Use the latter to implement PSEUDO() and RSYSCALL(). Reviewed by: imp, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43059 --- lib/libc/amd64/SYS.h | 18 ++++++++++++------ lib/libc/amd64/gen/rfork_thread.S | 6 ++---- lib/libc/amd64/sys/getcontext.S | 3 +-- lib/libc/amd64/sys/vfork.S | 3 +-- lib/libc/i386/SYS.h | 19 ++++++++++++------- lib/libc/i386/gen/rfork_thread.S | 6 ++---- lib/libc/i386/sys/getcontext.S | 3 +-- lib/libc/i386/sys/syscall.S | 2 +- lib/libc/i386/sys/vfork.S | 3 +-- 9 files changed, 33 insertions(+), 30 deletions(-) diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h index 23b4226d942f..2dfca1896fcd 100644 --- a/lib/libc/amd64/SYS.h +++ b/lib/libc/amd64/SYS.h @@ -35,17 +35,23 @@ #include #include +#define _SYSCALL(name) \ + mov $SYS_##name, %eax; \ + movq %rcx, %r10; \ + syscall + +#define _SYSCALL_BODY(name) \ + _SYSCALL(name); \ + jb HIDENAME(cerror); \ + ret + #define RSYSCALL(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define PSEUDO(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) - -#define KERNCALL movq %rcx, %r10; syscall diff --git a/lib/libc/amd64/gen/rfork_thread.S b/lib/libc/amd64/gen/rfork_thread.S index a3c64fad7994..a70551631f1b 100644 --- a/lib/libc/amd64/gen/rfork_thread.S +++ b/lib/libc/amd64/gen/rfork_thread.S @@ -51,8 +51,7 @@ ENTRY(rfork_thread) /* * Prepare and execute the thread creation syscall */ - movq $SYS_rfork, %rax - KERNCALL + _SYSCALL(rfork) jb 2f /* @@ -78,8 +77,7 @@ ENTRY(rfork_thread) /* * Exit system call */ - movq $SYS_exit, %rax - KERNCALL + _SYSCALL(exit) /* * Branch here if the thread creation fails: diff --git a/lib/libc/amd64/sys/getcontext.S b/lib/libc/amd64/sys/getcontext.S index 6860a3cf9bef..c3a856c879f8 100644 --- a/lib/libc/amd64/sys/getcontext.S +++ b/lib/libc/amd64/sys/getcontext.S @@ -36,8 +36,7 @@ WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movq (%rsp),%rsi /* save getcontext return address */ - mov $SYS_getcontext,%rax - KERNCALL + _SYSCALL(getcontext) jb HIDENAME(cerror) addq $8,%rsp /* remove stale (setcontext) return address */ jmp *%rsi /* restore return address */ diff --git a/lib/libc/amd64/sys/vfork.S b/lib/libc/amd64/sys/vfork.S index 3714a742bc15..e3c5f701dcff 100644 --- a/lib/libc/amd64/sys/vfork.S +++ b/lib/libc/amd64/sys/vfork.S @@ -37,8 +37,7 @@ WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popq %rsi /* fetch return address (%rsi preserved) */ - mov $SYS_vfork,%rax - KERNCALL + _SYSCALL(vfork) jb 1f jmp *%rsi 1: diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h index 24b0060372f8..292b705f80f2 100644 --- a/lib/libc/i386/SYS.h +++ b/lib/libc/i386/SYS.h @@ -35,17 +35,22 @@ #include #include +#define _SYSCALL(name) \ + mov $SYS_##name, %eax; \ + int $0x80 + +#define _SYSCALL_BODY(name) \ + _SYSCALL(name); \ + jb HIDENAME(cerror); \ + ret + #define RSYSCALL(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); \ - ret; END(__sys_##name) + _SYSCALL_BODY(name); \ + END(__sys_##name) #define PSEUDO(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) - -#define KERNCALL int $0x80 diff --git a/lib/libc/i386/gen/rfork_thread.S b/lib/libc/i386/gen/rfork_thread.S index e4d3b904d523..b37f16c930e8 100644 --- a/lib/libc/i386/gen/rfork_thread.S +++ b/lib/libc/i386/gen/rfork_thread.S @@ -64,8 +64,7 @@ ENTRY(rfork_thread) */ pushl 8(%ebp) pushl $0 - movl $SYS_rfork, %eax - KERNCALL + _SYSCALL(rfork) jb 2f /* @@ -96,8 +95,7 @@ ENTRY(rfork_thread) */ pushl %eax pushl $0 - movl $SYS_exit, %eax - KERNCALL + _SYSCALL(exit) /* * Branch here if the thread creation fails: diff --git a/lib/libc/i386/sys/getcontext.S b/lib/libc/i386/sys/getcontext.S index 8baf0caf18fd..d6b5dcd58669 100644 --- a/lib/libc/i386/sys/getcontext.S +++ b/lib/libc/i386/sys/getcontext.S @@ -36,8 +36,7 @@ WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movl (%esp),%ecx /* save getcontext return address */ - mov $SYS_getcontext,%eax - KERNCALL + _SYSCALL(getcontext) jb HIDENAME(cerror) addl $4,%esp /* remove stale (setcontext) return address */ jmp *%ecx /* restore return address */ diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S index 6e9f8e587258..9eaf193c1d7a 100644 --- a/lib/libc/i386/sys/syscall.S +++ b/lib/libc/i386/sys/syscall.S @@ -37,7 +37,7 @@ ENTRY(syscall) pop %ecx /* rta */ pop %eax /* syscall number */ push %ecx - KERNCALL + int $0x80 push %ecx /* need to push a word to keep stack frame intact upon return; the word must be the return address. */ jb HIDENAME(cerror) diff --git a/lib/libc/i386/sys/vfork.S b/lib/libc/i386/sys/vfork.S index b96f3d18c950..3399b8b752de 100644 --- a/lib/libc/i386/sys/vfork.S +++ b/lib/libc/i386/sys/vfork.S @@ -37,8 +37,7 @@ WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popl %ecx /* my rta into ecx */ - mov $SYS_vfork,%eax - KERNCALL + _SYSCALL(vfork) jb 1f jmp *%ecx 1: From nobody Mon Dec 18 22:29:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvDy440Pxz54BYM; Mon, 18 Dec 2023 22:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvDy43BCqz4cGd; Mon, 18 Dec 2023 22:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ye+AwK5HSWVE5J4yKIcCMHNFgFb1+FRnA4jbe5C9Jkw=; b=l3C88PGnl0hwoXbdujaNkhQfbp+nySGyXtNtVrwsM1wfRSeSoWAdSTjg4C8uzEZZIH1SEg GANVuIZ1pP0Lczx08PuLA3EEpGxhl9EcT8GsLYRzqz+1mVd3T5tLnqqpCU51JhQ7/Frz3S gEWCVB/tRZ+y3W/ckYG2kE3RFE7DZW5kM8o9lir5GsUJ4CYMNt5yjwQbYwoDFLJfe5v7/G 2HpwzFIdMQG5oGhXH9uSTw087uEQemIy/xaWxkSlle7MRYfyU74Kq4ap2TziLGsK3dP0D/ QQV1EwzQrrY29KsZjI2dBCe/qt1zZ9jpUTk0DLPdmwoRAJ2h3oPEYtbdgXBlog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702938540; a=rsa-sha256; cv=none; b=oec/fneCoiQ+6s8cTHLjtDhdpR9AtIKKKAEhbCzsV8vI5T9bTWtSw/M1hQutb1h13hqVdC lItxO5NILg0neTdJ4ZGPTOcCuFHBdlIvSJAJUwx7V6SGRJBt7CunxyVgE4BXIc+COdPQIL LhRdg8awCXlSQ466MFx4M+Y151+IJpRxlyPHBCi7Jg9G4ON9ZBpQfulWZarx5ji7mz66tB vafaiO6/tZxIW+Mc2Wglo8Z4l18hfOl4SqmOA0lbpl7r5VCmnaeK4jFVPCTBQo6lkV9On8 BnAUneZaRkebsn1i8q9MJ4Z3FydoAIBMHuD64n6QMaao553cjS501J4ce3lyTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ye+AwK5HSWVE5J4yKIcCMHNFgFb1+FRnA4jbe5C9Jkw=; b=BMI3R0Fu1/CSa+MLoGXm9oJT/TnViVXvDsunhl4cOBPL2VLNcJpa7yugeZ0QpHXNud0gVs 5+cYfYekt5G9TiI4AwUjRmJBSgP7inPnYn8Cr9Er86yNE+0kpDrLPjyTvHr0B+SMS3xWAG DsaorTbuWGNvrhd6CzTKzcoeA5Kn9eYZtKmImknsQfGmJF0hqFCrCKLMztM61UwxW7BzrR F5GVzCo+dNHS5yMKlAhRVg8DMg2fAwOh6RCTRILgUgodBm3VIQ19tEvhb+VtEhZMrzQv+T s3sXKniqgAghLONseSWiLUsPWCZNd6gv0/kuvor7TEt2ces47Vt6zpxQHfuEpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvDy41yBKzfX8; Mon, 18 Dec 2023 22:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMT0mv007945; Mon, 18 Dec 2023 22:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMT0vQ007942; Mon, 18 Dec 2023 22:29:00 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:29:00 GMT Message-Id: <202312182229.3BIMT0vQ007942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: d444ef53933e - main - arm/SYS.h: remove unused CURBRK 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d444ef53933e44d5acfce7d6d5aac0ee78d94a26 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=d444ef53933e44d5acfce7d6d5aac0ee78d94a26 commit d444ef53933e44d5acfce7d6d5aac0ee78d94a26 Author: Brooks Davis AuthorDate: 2023-12-18 22:28:42 +0000 Commit: Brooks Davis CommitDate: 2023-12-18 22:28:42 +0000 arm/SYS.h: remove unused CURBRK macro The last use was removed in 2018 as part of a reimplementation of brk() and sbrk() in commit 9d9fd255d646b6c389fa347cb633c665c4485aa4. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43060 --- lib/libc/arm/SYS.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h index 9ac2d90104b4..a1150ed03dc6 100644 --- a/lib/libc/arm/SYS.h +++ b/lib/libc/arm/SYS.h @@ -44,7 +44,6 @@ mov r7, ip #define CERROR _C_LABEL(cerror) -#define CURBRK _C_LABEL(curbrk) #define _SYSCALL_NOERROR(x) \ ENTRY(__CONCAT(__sys_, x)); \ From nobody Mon Dec 18 22:29:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvDy60MbHz54BkS; Mon, 18 Dec 2023 22:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvDy55lGBz4cYM; Mon, 18 Dec 2023 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=53zr5tLY87hCjtZuLLBd+FvUGIFPt2vTyy3cVpxYzII=; b=tM1muxhUUi/6O5ZNc8+mIq/rddbOXVIhUVNjxKMRYMClCe8rchkJWfuSzM1KPosCwfcGrG Tuj/QkrXRjnvEZUUtEsU7pzBAHuvBxFsxXpj44YjHfvi97tOmGkojBvi1EE7e+NA95QOO8 yX3NkkwP7TCR0Pj68Ax05VH9P6KI2/pk9wKcSbRU8GY4VuGKviu0HprGTsf7/fBPHMOTht psWDV8eC2RMdPMHIMYI3NFO6rmqrvBDntQ3DAoZbukTKEoCiRp49XIkfyqIr8S1pdYoBYT NmM+346vC+d+0Rx0vEqs9ZdpKdLO7faIGVCSCGZmZv4gtcf65IYaHrLO6BbILg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702938541; a=rsa-sha256; cv=none; b=LR2ymbHVL2tcY4eNc9kgtLQGbGurOCru1HV0//1GFx01nK0zo1ZkUIgTt0D8/JTUUlfP4j si838EJPLVVfkHXO8j7/rN4eandRsQqoNxou2Qqp1Skf3hJDyYQIL5RSLU5DWANJYmv0jx M++r3U4Khsl/pTxxcqi6mhSiiT9oDtosM4fB9+f+rzICRyRVAAougCaL6Yjrri8tPk/DV+ x7itw+oh0xiFslKHqEbYUsvrG+p/a5xdmVN58uodP970wQiP6MYItFTpOcaZvfFApVr7q7 H4UDG5rL5Ue944RJoo4PqRE+pnOAxqeS1Z00aut/2ZSHteeUQjqPKAP12WpVPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702938541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=53zr5tLY87hCjtZuLLBd+FvUGIFPt2vTyy3cVpxYzII=; b=XDUl2Rk+3L22ZpB5MFAdO87S/LKHlBKBS+GIrbia2G1LU4kOO2j7dW7ScMmUvBGaytdVJ+ KkRSXvDNgqWJ4OIEwD/3hyu0ANb5lk/ekvzEhOrrvbYXzbIrH5MNOdlSi9Sn1xLn75GTgU Tu3bh/j5PrMY4d3Oqu4OgWD/qSIsuVxrtsP/3Jk6jYsjH0HdmMk+pu6eCE9YAbwr/teAC7 x6aMvibaxWOEU72sWUSUJr8ME3FC+DFrdz0F9Q2e4SBtZsgJnOrJDA1DWhWDesJgt8bxZs RLNwBz85XVZKOVgJUSPoFoC6cCnYLfbMFvCAeZSPvdKydaeH6DV4b5c2gSv3pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvDy536nRzfG3; Mon, 18 Dec 2023 22:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMT1YS007987; Mon, 18 Dec 2023 22:29:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMT1Ga007984; Mon, 18 Dec 2023 22:29:01 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:29:01 GMT Message-Id: <202312182229.3BIMT1Ga007984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 8a1b84f861e8 - main - arm/SYS.h: align with other 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a1b84f861e869a76b1902692dbb93c2a54081d5 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=8a1b84f861e869a76b1902692dbb93c2a54081d5 commit 8a1b84f861e869a76b1902692dbb93c2a54081d5 Author: Brooks Davis AuthorDate: 2023-12-18 22:28:42 +0000 Commit: Brooks Davis CommitDate: 2023-12-18 22:28:42 +0000 arm/SYS.h: align with other arches Rename SYSTRAP() macro to _SYSCALL() and add _SYSCALL_BODY() which invokes the syscall via _SYCALL() and then calls cerror as required. Use to implement PSEUDO() and RSYSCALL() removing _SYSCALL_NOERROR(). Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43061 --- lib/libc/arm/SYS.h | 30 ++++++++++++------------------ lib/libc/arm/sys/vfork.S | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h index a1150ed03dc6..c3bc78704a16 100644 --- a/lib/libc/arm/SYS.h +++ b/lib/libc/arm/SYS.h @@ -37,7 +37,7 @@ #include #include -#define SYSTRAP(x) \ +#define _SYSCALL(x) \ mov ip, r7; \ ldr r7, =SYS_ ## x; \ swi 0; \ @@ -45,30 +45,24 @@ #define CERROR _C_LABEL(cerror) -#define _SYSCALL_NOERROR(x) \ - ENTRY(__CONCAT(__sys_, x)); \ - .weak _C_LABEL(x); \ - .set _C_LABEL(x), _C_LABEL(__CONCAT(__sys_,x)); \ - .weak _C_LABEL(__CONCAT(_,x)); \ - .set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \ - SYSTRAP(x) - -#define _SYSCALL(x) \ - _SYSCALL_NOERROR(x); \ +#define _SYSCALL_BODY(x) \ + _SYSCALL(x); \ it cs; \ - bcs PIC_SYM(CERROR, PLT) + bcs PIC_SYM(CERROR, PLT); \ + RET #define PSEUDO(x) \ ENTRY(__CONCAT(__sys_, x)); \ .weak _C_LABEL(__CONCAT(_,x)); \ .set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \ - SYSTRAP(x); \ - it cs; \ - bcs PIC_SYM(CERROR, PLT); \ - RET + _SYSCALL_BODY(x) #define RSYSCALL(x) \ - _SYSCALL(x); \ - RET + ENTRY(__CONCAT(__sys_, x)); \ + .weak _C_LABEL(x); \ + .set _C_LABEL(x), _C_LABEL(__CONCAT(__sys_,x)); \ + .weak _C_LABEL(__CONCAT(_,x)); \ + .set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \ + _SYSCALL_BODY(x); \ .globl CERROR diff --git a/lib/libc/arm/sys/vfork.S b/lib/libc/arm/sys/vfork.S index 5cc8afc8d953..2b92f56ad4e4 100644 --- a/lib/libc/arm/sys/vfork.S +++ b/lib/libc/arm/sys/vfork.S @@ -44,7 +44,7 @@ ENTRY(vfork) mov r2, r14 - SYSTRAP(vfork) + _SYSCALL(vfork) bcs PIC_SYM(CERROR, PLT) sub r1, r1, #1 /* r1 == 0xffffffff if parent, 0 if child */ and r0, r0, r1 /* r0 == 0 if child, else unchanged */ From nobody Mon Dec 18 22:45:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvFKc4Zk8z54CRd; Mon, 18 Dec 2023 22:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvFKc493qz3ZRL; Mon, 18 Dec 2023 22:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702939556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZvhSw1XQ8VzX+ZuW2QKo8ddr6NiasNjnbnPnp4VvDk=; b=OsQ5xtodOxWP94WWFUL3VvoF8VTgSZGu++GXA0y5xGlbWAsBInJ7C3SfuCkJ5AMk5PEkmu PMDwVQ5q5N/r6NugkJeYBWsJffn9od3aRNLY8DFhrnP5zEhUj84mDM7iQ4YyDjfcRMJYZn ARlZ8LwLnCTVrs59Si73OtQ/jHdRqMEJc/0a+96GnE/hk2Ft59pRBytWVONLXzb7jL98R7 SBfJL1ZZGwUTApnnWSGeOUIqg/7srL1UvxQEr0scVIhdD86/iW+VC6TD3A9stYEB+lEoX+ lgsdvCT8DonZXf158azh+xcfqhdhpuzgefculipwiR+MTOID3SnqRBUW8eWQyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702939556; a=rsa-sha256; cv=none; b=YQBCLUDmvq/4yuHk0yFF1fLW5Xy0w1jgYv/b6xbYPvt/VVCnC/QOgT1Q6n5o753tKdSLD2 hIhw7WgecY5LuIxDzHYrUIpqGgrl9qL4qfTAbJdHiVe+p6Kl/VCNhS9Hd+AE6J3ImJXVj/ aHE+wMsQvNhgTkjedO1a4kqCvNM6PX+efZ5hJKfe+haQ/hJOHA0I7S7Nz6XNICDJQWYZon yf6c6ZiGh+Q406gDMV2w4e1TxRaIuKb1+kkvxNj1iQf9JRiAknuxQZldP9E6XCBtWjReRj b5PCpcI5ICpZ9uRu9WgCEN0utzKRsDGtQQ1JXVLz5FJzVG5f55UqU+St6KCpqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702939556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QZvhSw1XQ8VzX+ZuW2QKo8ddr6NiasNjnbnPnp4VvDk=; b=TPiepOigrINt2p3VMlzEJATG+k4yZhpOqT3mUQJmPXJer0gTHpvJbzai98Od8Qlty4Zq1j xiwTbIEbWyaqNYO9tT3NniHfd9CGx6ChpiaVtdPOMJsPfy3A9DaVe0ZY4MGgjy+sn5iV+V zMvE6aioXm82/27Ls4zGyLxDrjKFqnjs1+nmNiMTEQUxHyvKJoCyT6B9Pb+38ZsQ7rKw4I 5NWeDy3n+CouTcDx9NMEEsZcMgfqSS9cD1fTvBYLSD+yfrBG0LnJb3IDly6nHvc+q9bWHt RXnhsd4S4skkOQG55iCTaC2AHKC23CvgeSEAc2X4m/bgMnNvSOClYkCiuhufvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvFKc3CfTzg0G; Mon, 18 Dec 2023 22:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BIMjuxS040505; Mon, 18 Dec 2023 22:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BIMjuFt040502; Mon, 18 Dec 2023 22:45:56 GMT (envelope-from git) Date: Mon, 18 Dec 2023 22:45:56 GMT Message-Id: <202312182245.3BIMjuFt040502@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: d9b7301bb791 - main - nvme: Initialize HMB entries before loading them into the controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d9b7301bb791faab48b6c7733c34078427b9a374 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d9b7301bb791faab48b6c7733c34078427b9a374 commit d9b7301bb791faab48b6c7733c34078427b9a374 Author: Mark Johnston AuthorDate: 2023-12-18 22:45:24 +0000 Commit: Mark Johnston CommitDate: 2023-12-18 22:45:24 +0000 nvme: Initialize HMB entries before loading them into the controller struct nvme_hmb_desc contains a pad field which was not getting initialized before being synced. This doesn't have much consequence but triggers a report from KMSAN, which verifies that host-filled DMA memory is initialized before it is made visible to the device. So, let's just initialize it properly. Reported by: KMSAN Reviewed by: mav, imp MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D43090 --- sys/dev/nvme/nvme_ctrlr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 836d13eaa16d..771e5cd1251b 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1007,6 +1007,8 @@ again: } for (i = 0; i < ctrlr->hmb_nchunks; i++) { + memset(&ctrlr->hmb_desc_vaddr[i], 0, + sizeof(struct nvme_hmb_desc)); ctrlr->hmb_desc_vaddr[i].addr = htole64(ctrlr->hmb_chunks[i].hmbc_paddr); ctrlr->hmb_desc_vaddr[i].size = htole32(ctrlr->hmb_chunk / ctrlr->page_size); From nobody Tue Dec 19 00:29:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvHcw5wppz54LKk; Tue, 19 Dec 2023 00:29: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvHcw0dgcz4SYD; Tue, 19 Dec 2023 00:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702945760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aGbTf/AIGnsHlRe0hYgINE8f2Z9DrXvBh+rOGQeWbRY=; b=AzHVvIrK87CBwEeJQhfB/L4z5kobMbqFaYuXc2aW93dYtGwehk0mHzt2G37MEZEWLX6zKS BQtBtzwF0RDFkqcJq2br0ecCw4BjYwShx20d8eQg10vTajVM+GzrgOXBbfQdoHdNEoOy41 TkTVjlHCwlIuEueS+RZhhhzIhmP8PsioevNKZXxwcu9IzGCiZhOSfoebBqSNAcuSi4JmCH x8G929n8kAAoB5u/oyG/o28cHAYTRqfUrmToDV9SX17/T2CKInEl0+pGsc1eXhHqO+wcFN RRSm/2ziu8XCustI9dIqoBPYc40bXOU+GxXuSHqsPhRbsE9SWdHA1CZ+SuvVVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702945760; a=rsa-sha256; cv=none; b=Is9v3q+n7rvWHEE6bd8BRWW6w+xxPSrJLXLtEU+kRxk7b712HmgXscYhEG1NkfVO6MKcyb sSSpvrwFNSzIybv/S7Q0P7ikfL4rJgtKSI3VzG2WluEUy4LVDJuFVwdY5Tu88w/XhBTLvC jJ6ihuPWk5uDJWiYg2REGCc3hYh904c0geYR5pQeBuzDAeiXcU07VQRGr7dZ6tT3BCavmS wI5F50DvIwFbJI7uCufkS+pAbrLRw/6ZVTJAVzu/tBFWr1t/xuqKK+sMP+yyql6Vi0hMlS QzbmbkgKocfRDDxja3Ul4nCqn1TJDOr5XUhxty0M8cWJJhF/wtNAo1ZuZojUXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702945760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aGbTf/AIGnsHlRe0hYgINE8f2Z9DrXvBh+rOGQeWbRY=; b=wPwDvlhXtwi3ue1j7vmh6j2pja5VmiDYABmXwbjHM9EtDPj4D0X5HGbRwwIhgn1oYxRMQr Cf1ucBrmS2It2vEbN8DsPsyO3Lm+li1TlEbww9pyppgdDzYCHwQ/mhlpiK0Dq5O4nm8Fey jqCeQJIgoHNoWViAzDP5oTOrNueemqITCyocXQK9uDiwYdEulA+MnfrjY30tQ3WGJMRq7t TFSYPE/oH+gMlbuqQG6wce56YnqxNgCVGO+VZQbm3mT9D0KMe5GOhcJHWcqC6D64IBKSY9 npMKSD9svVcnA8PfRzDSQ3VjV4OdWR0SPacdhoi6cHf5qJ/iFlHoOpazBSjfmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvHcv4g37zjJP; Tue, 19 Dec 2023 00:29:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ0TJTe008414; Tue, 19 Dec 2023 00:29:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ0TJNj008411; Tue, 19 Dec 2023 00:29:19 GMT (envelope-from git) Date: Tue, 19 Dec 2023 00:29:19 GMT Message-Id: <202312190029.3BJ0TJNj008411@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: 399961e0a413 - stable/14 - if_tun: check device name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 399961e0a4132fb14b9b975c937cbc46849f8b39 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=399961e0a4132fb14b9b975c937cbc46849f8b39 commit 399961e0a4132fb14b9b975c937cbc46849f8b39 Author: Konstantin Belousov AuthorDate: 2023-12-12 00:13:59 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-19 00:28:47 +0000 if_tun: check device name PR: 266999 (cherry picked from commit 0365e5fc905b425313a0a2d89f0d8e2566924df2) --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index a01bc11aa64c..a1d9929a2e28 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -817,7 +817,7 @@ tun_create_device(struct tuntap_driver *drv, int unit, struct ucred *cr, make_dev_args_init(&args); if (cr != NULL) - args.mda_flags = MAKEDEV_REF; + args.mda_flags = MAKEDEV_REF | MAKEDEV_CHECKNAME; args.mda_devsw = &drv->cdevsw; args.mda_cr = cr; args.mda_uid = UID_UUCP; From nobody Tue Dec 19 00:29:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvHdW1fpjz54LYw; Tue, 19 Dec 2023 00:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvHdV0Th1z4TBY; Tue, 19 Dec 2023 00:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702945790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DmYVlHrGPCT3UN0tEMSUZRolC+zUZGH9vTjBaW4YYL4=; b=tWH1W+kpJQ5sfzP0SH4D0vaXb68tua2x729QM/jWmkyYoDYcqx1gOdRY228cqxmRavJGva JPj10S90jZ03ZIMqdcBU7TlMLREd+S5G+RnnYYlxlLYKheasXtwFj2RZuawuiLT56Kd1Ur 0iE4uvOu9matVs+rm07w3EA8iF7iyQW8kMur0QNVPvfWz/rSBt9on8sh2GpK+ix3k0B/zj 8qIh/8EGLhheMHDYwl0d2+mqYWIMs4nsSvYBk1nZKjYZ9w+rYik1L7OjSzszepk/VigruF NwhtxWv/oxsfdy3fIjaQgXPj9C7QJYxDTSk7bEAVRAuBlhVsCjRfInUIt6wbnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702945790; a=rsa-sha256; cv=none; b=JJz/lJlI+1xWWeRLlLGcu5N3KL3+tajMRcA5N8taa7jjOQyGP9cqwnV/EwqcHIW1IG1Yfc FB/O72ioYH/rKygv2mGPAB2Tb2XCP9cMSg/wyFo+SdlGT/J0Wqq0r1t8OtlWyhe/A316mz +xftk6r7SgUEs1nG18I0jXcUC1wu6SVJGAl4VcDvdAZ5sd22EI7+hKUMUQuHPsYvUPLEjj NdO7Shr4EbgsFHG1w1Oh8wSYXbvT1NpFhqlNXOCxdqW3VTytPyDlXtg6CKjJImzHN9Ev5i lqhj4YFhOMP+mIkIaixAQVQiq45zNCFeWK+Paun4tn0qNJjRVuRj0rlLWNZaxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702945790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DmYVlHrGPCT3UN0tEMSUZRolC+zUZGH9vTjBaW4YYL4=; b=nkGwbz6+PlqOjGbGuqnvjSNR16wI6cjiEvqS9xL4MHv92ibNs+UehNcR15x1Bedm0KiWde 0fFBeSihbnul3sRmMxh5foqLiSU6ys3z4secklc4wRQrvK8tML7ufV24PtnUss/uA/+rjE l3vI4weAisNQiQOJv/NDmT2kLfyZ/gocFY/vNZyCUjpEFgfcxRIVYMPISLSePnIZIQcAcv kL1wCWFPBz83AZPnb11mCihJq1hgxE8amHNb4XVMF4caNTffYdUW+AlM6XiTIyQcNN/NKU iLzg0f2pfqxM/ABAqlD8wiklmcfwZ8rYmZXIPuZ4Ov2YqZpAA3w51fm6jteSHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvHdT6cMlzjJQ; Tue, 19 Dec 2023 00:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ0TnIR008603; Tue, 19 Dec 2023 00:29:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ0Tnvt008600; Tue, 19 Dec 2023 00:29:49 GMT (envelope-from git) Date: Tue, 19 Dec 2023 00:29:49 GMT Message-Id: <202312190029.3BJ0Tnvt008600@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: a317a58658d4 - stable/13 - if_tun: check device name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: a317a58658d4a529211c66b675ec7998032ecb4e Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a317a58658d4a529211c66b675ec7998032ecb4e commit a317a58658d4a529211c66b675ec7998032ecb4e Author: Konstantin Belousov AuthorDate: 2023-12-12 00:13:59 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-19 00:29:28 +0000 if_tun: check device name PR: 266999 (cherry picked from commit 0365e5fc905b425313a0a2d89f0d8e2566924df2) --- sys/net/if_tuntap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c index 756aa04482cb..da55034638d1 100644 --- a/sys/net/if_tuntap.c +++ b/sys/net/if_tuntap.c @@ -810,7 +810,7 @@ tun_create_device(struct tuntap_driver *drv, int unit, struct ucred *cr, make_dev_args_init(&args); if (cr != NULL) - args.mda_flags = MAKEDEV_REF; + args.mda_flags = MAKEDEV_REF | MAKEDEV_CHECKNAME; args.mda_devsw = &drv->cdevsw; args.mda_cr = cr; args.mda_uid = UID_UUCP; From nobody Tue Dec 19 00:48:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvJ3H3rZwz54MWL; Tue, 19 Dec 2023 00:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvJ3G6c8Qz4rgt; Tue, 19 Dec 2023 00:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702946923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDu5Hs7VybZ5K+PCHv5+3N8bFhOj8oibhlm2XU2phhY=; b=M3JHHdAWz/1jbXWjuRekA/qg+YEdrf83kwuxHioMWEYVPrR1Siq2e1e8DH5W59p474jERC SSagnTnsGOF8UdWTf1XPhBKTr0/I+rLygfTlwAbp4GkoP445PoYonNcZDBN7pi0xZ+4b01 Cvugz1/9XPSe20K1RZpALhvS9CzSe/LvdCs2fTbsxDsdelhxutTJ+IX4727S/ItpdZawbC O3vVjIVtGndUWdsMeaLlM4tLdcKaev5A/qXk/P+2GvA7if9fgVXbaGSdTf0bM6bnweQLvY 9rdg1zO1Z9fFhJNpdf4YPPXVrkFUM/FdsFLbQZ2jVwulYCfZnQK41y+G+VNvBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702946922; a=rsa-sha256; cv=none; b=bAObhyjD7cftuyPPP4XTBXTxQUvOAsJpBzy+W3H0OgAQ0nJqLvyQrNfR1aiv+rpWSl6Gtv HcFmIYmBzpps78staEBLGWTWsubBo0km1/9MT+bz/AAYOk5n20kqbxf18FTM9bRSLr1mhp UO0b6nBqoB4rrmOZkLwun3mTR4nFfSBpgpwuuQpsaN1I5XIBxxSjqOJENoPJrWpnWJh37M dNc3MHlU4VnqzKBjvSwCmuePUbussC1mIdEzufDbRhJiz2ki/cubxHFEDR00f3auSIL6Xk 3VzlmpEIEnExiRJIECSOZ/Xz5C8bBxUy+7tYQj9mSu9o8w+Itg77D7pIc8b5jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702946922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDu5Hs7VybZ5K+PCHv5+3N8bFhOj8oibhlm2XU2phhY=; b=cBZpzCRd7xuGZgGo2g6JoXDqOhLoufCifEMy1/WzxOXuCJBKEKqbCrs/nd5uSD/vmkuiJZ zi0+G9GQCJY4LiX6eirpGKdvukDYU62mgSbQhHBd1ms/WxbECRBXKy5njl6os/ewNN0b/p d0ZoFKSo3a19pyEWQ+tSFPmTJkd/YyVfaERKhOS9nTzroSWZN27qaT6Q/+DESQBoYs9AJx eaxRGW+2jLNqYcq3WH2JvhKAkvjzXwZZZ52Ko2OAaxPOQArPdXFcz15cx6rpxi29UCdERw t4YCjecOKJNQW6G4smOYoukq84JweI2wfqCKGJLmFLfacYm+GYQEgrypfNEVpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvJ3G2dfLzjrc; Tue, 19 Dec 2023 00:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ0mgQj041990; Tue, 19 Dec 2023 00:48:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ0mgXZ041987; Tue, 19 Dec 2023 00:48:42 GMT (envelope-from git) Date: Tue, 19 Dec 2023 00:48:42 GMT Message-Id: <202312190048.3BJ0mgXZ041987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: acd5638e268a - main - tty: delete knotes when TTY is revoked List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: acd5638e268a6706f6b7ad84947a8425e8d51ef7 Auto-Submitted: auto-generated The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=acd5638e268a6706f6b7ad84947a8425e8d51ef7 commit acd5638e268a6706f6b7ad84947a8425e8d51ef7 Author: Robert Wing AuthorDate: 2023-12-19 00:40:46 +0000 Commit: Robert Wing CommitDate: 2023-12-19 00:40:46 +0000 tty: delete knotes when TTY is revoked Do not clear knotes from the TTY until it gets dealloc'ed, unless the TTY is being revoked, in that case delete the knotes when closed is called on the TTY. When knotes are cleared from a knlist, those knotes become detached from the knlist. And when an event is triggered on a detached knote there isn't an associated knlist and therefore no lock will be taken when the event is triggered. This becomes a problem when a detached knote is triggered on a TTY since the mutex for a TTY is also used as the lock for its knlists. This scenario ends up calling the TTY event handlers without the TTY lock being held and tripping on asserts in the event handlers. PR: 272151 Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41605 --- sys/kern/tty.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e051c66ab0c9..61a6beafa2c0 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -253,9 +253,6 @@ ttydev_leave(struct tty *tp) ttyoutq_free(&tp->t_outq); tp->t_outlow = 0; - knlist_clear(&tp->t_inpoll.si_note, 1); - knlist_clear(&tp->t_outpoll.si_note, 1); - if (!tty_gone(tp)) ttydevsw_close(tp); @@ -369,7 +366,7 @@ done: tp->t_flags &= ~TF_OPENCLOSE; static int ttydev_close(struct cdev *dev, int fflag, int devtype __unused, - struct thread *td __unused) + struct thread *td) { struct tty *tp = dev->si_drv1; @@ -392,8 +389,11 @@ ttydev_close(struct cdev *dev, int fflag, int devtype __unused, } /* If revoking, flush output now to avoid draining it later. */ - if (fflag & FREVOKE) + if ((fflag & FREVOKE) != 0) { tty_flush(tp, FWRITE); + knlist_delete(&tp->t_inpoll.si_note, td, 1); + knlist_delete(&tp->t_outpoll.si_note, td, 1); + } tp->t_flags &= ~TF_EXCLUDE; @@ -1120,6 +1120,8 @@ tty_dealloc(void *arg) ttyoutq_free(&tp->t_outq); seldrain(&tp->t_inpoll); seldrain(&tp->t_outpoll); + knlist_clear(&tp->t_inpoll.si_note, 0); + knlist_clear(&tp->t_outpoll.si_note, 0); knlist_destroy(&tp->t_inpoll.si_note); knlist_destroy(&tp->t_outpoll.si_note); From nobody Tue Dec 19 00:53:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvJ8b1F5sz54MrL; Tue, 19 Dec 2023 00:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvJ8Z6zZTz3D34; Tue, 19 Dec 2023 00:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702947199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Op50DDUHPanwGz6nkgCtPB2C+RCGeiyt4fF7+4eD/4Y=; b=sZnwc5CouUrhBejMZZ/40NXLXr336LsMtmj9hnwsyyhNJdG+WLkB9JmB3QwQs/wpLtMQy3 B7KWhQjNTlvvO2mcQ4SwWvwe/7axmnGogzRXpSotfbv/XyF0nHT44543CDfO0JIq67z0YL 6mT5rTQ9ULTCnbgby7HzGhtHmXNbGMWl6lO+/+2jAJzBvu43HEm6egxRg6DDBxVn77myLN Z5J9Qvgk//sTMparzcBwZQovTbDtKfpbkJ4BDO5d34YMkkPUk2s/wKZp4HNHN88znk5KFg GwI2cE08bVov80hZZEyCJeReoQx8gLgHyRIBSM3zybdhkkQJaqYPtk7G7AG0ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702947199; a=rsa-sha256; cv=none; b=iIv6aEc6Iv7OyY/0qjpyHCN7meepHM9O4R7OIHw2B68FlG0G/jiLVg2QodgDSHJL9B/+So 1z+keQD5jsvHFAqPjxFTT01ptcFwovt/53zz7ByssXEqrl9IAj2D6wrEb0Lr1jDS1k2RO+ FWhoEHjxbE6F0eY+EuLU3Z82uFNB98FVpDqRdOhijFGTnAq7CnQ6QKtcCOTDnWSrLr4aXG OSibS5m6RHK+5QZcKnwZc7tX2cfaGKCzPiFEo5NgG6x8JskQfQsP+rsI40+5F9C4eLKMBm +UImPuMX4NOQl1/zCPY0c7CbKXXxaKnmlb8yaEUg/yg9byOnNjiViOTRCU6jhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702947199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Op50DDUHPanwGz6nkgCtPB2C+RCGeiyt4fF7+4eD/4Y=; b=RcDFGoROWLNkFoep1wJZga1C18uzCloK1P1ec9Hte/X8BE9Z0iu8cCcaPg4JOW42LKCPMf niwaHKCigRqSJ8mN6u+c2UaTermRavhqxAGabqdcOQ+Fv0tLL1+WFIuTJ5nTqKBFpSmr06 2aRvtZpZOQo9UEw3MdXm7YOr8YxFRCJIDfSGBd8KdiyplMvzeTTF7hJh1l84wxGQPR8J4K SVpjftVjDKQUHJVlprWRj0x2ahDnIsAbFbdmOK22ZavH4dGYZM6XtzyBAQsWYoky1NHt4h AXr5RUzOBdnjB+6EKEbK9K6gw0euOeSMsBxUURZ0HUMudRwRFc5QYkLfsoUTkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvJ8Z4vwwzjNM; Tue, 19 Dec 2023 00:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ0rIrf058209; Tue, 19 Dec 2023 00:53:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ0rIFf058206; Tue, 19 Dec 2023 00:53:18 GMT (envelope-from git) Date: Tue, 19 Dec 2023 00:53:18 GMT Message-Id: <202312190053.3BJ0rIFf058206@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: eac3646fcdd4 - main - LinuxKPI: 802.11: more TXQ implementation and locking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: eac3646fcdd445297cade756630335e23e92ea13 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eac3646fcdd445297cade756630335e23e92ea13 commit eac3646fcdd445297cade756630335e23e92ea13 Author: Bjoern A. Zeeb AuthorDate: 2023-12-12 01:59:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-12-19 00:50:49 +0000 LinuxKPI: 802.11: more TXQ implementation and locking Implement ieee80211_handle_wake_tx_queue() and ieee80211_tx_dequeue_ni() while looking at the code. They are needed by various wireless drivers. Introduce an ltxq lock and protect the skbq by that. This prevents panics due to a race between a driver upcall and the net80211 tx downcall. While the former should be rcu protected we cannot rely on that. It remains questionable if we need to protect further fields there (with a different lock?). Also introduce a txq_mtx on the lhw which needs to be further deployed but we need to come up with a good strategy to not end up with 7 different locks. Sponsored by: The FreeBSD Foundation PR: 274178, 275710 Tested by: cc MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 27 +++++---- sys/compat/linuxkpi/common/src/linux_80211.c | 67 +++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 29 +++++++++- 3 files changed, 107 insertions(+), 16 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index fa36bd84ac6e..c4d001b3a7e8 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1117,6 +1117,8 @@ void linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *, uint8_t); struct ieee80211_txq *linuxkpi_ieee80211_next_txq(struct ieee80211_hw *, uint8_t); void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *, struct ieee80211_txq *, bool); +void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *, + struct ieee80211_txq *); /* -------------------------------------------------------------------------- */ @@ -1681,7 +1683,7 @@ static inline void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, bool withoutpkts) { - linuxkpi_ieee80211_schedule_txq(hw, txq, true); + linuxkpi_ieee80211_schedule_txq(hw, txq, withoutpkts); } static inline void @@ -1706,7 +1708,7 @@ static inline void ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { - TODO(); + linuxkpi_ieee80211_handle_wake_tx_queue(hw, txq); } /* -------------------------------------------------------------------------- */ @@ -2197,13 +2199,25 @@ ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf, TODO(); } -static __inline struct sk_buff * +static inline struct sk_buff * ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { return (linuxkpi_ieee80211_tx_dequeue(hw, txq)); } +static inline struct sk_buff * +ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) +{ + struct sk_buff *skb; + + local_bh_disable(); + skb = linuxkpi_ieee80211_tx_dequeue(hw, txq); + local_bh_enable(); + + return (skb); +} + static __inline void ieee80211_update_mu_groups(struct ieee80211_vif *vif, u_int _i, uint8_t *ms, uint8_t *up) @@ -2456,13 +2470,6 @@ ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, TODO(); } -static __inline struct sk_buff * -ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct ieee80211_tx_info *info) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5f7528e994b6..aa90100a328c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -329,6 +329,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], ltxq->txq.sta = sta; TAILQ_ELEM_INIT(ltxq, txq_entry); skb_queue_head_init(<xq->skbq); + LKPI_80211_LTXQ_LOCK_INIT(ltxq); sta->txq[tid] = <xq->txq; } @@ -380,8 +381,13 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], return (lsta); cleanup: - for (; tid >= 0; tid--) + for (; tid >= 0; tid--) { + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + LKPI_80211_LTXQ_LOCK_DESTROY(ltxq); free(sta->txq[tid], M_LKPI80211); + } free(lsta, M_LKPI80211); return (NULL); } @@ -975,6 +981,7 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, { struct lkpi_txq *ltxq; int tid; + bool ltxq_empty; /* Wake up all queues to know they are allocated in the driver. */ for (tid = 0; tid < nitems(sta->txq); tid++) { @@ -993,7 +1000,10 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, if (dequeue_seen && !ltxq->seen_dequeue) continue; - if (no_emptyq && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (no_emptyq && ltxq_empty) continue; lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); @@ -3540,6 +3550,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) KASSERT(ltxq != NULL, ("%s: lsta %p sta %p m %p skb %p " "ltxq %p != NULL\n", __func__, lsta, sta, m, skb, ltxq)); + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_tail(<xq->skbq, skb); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) @@ -3552,6 +3563,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) skb_queue_len(<xq->skbq), ltxq->txq.ac, ltxq->txq.tid, ac, skb->priority, skb->qmap); #endif + LKPI_80211_LTXQ_UNLOCK(ltxq); lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); return; } @@ -4074,6 +4086,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) LKPI_80211_LHW_LOCK_INIT(lhw); LKPI_80211_LHW_SCAN_LOCK_INIT(lhw); + LKPI_80211_LHW_TXQ_LOCK_INIT(lhw); sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK); TAILQ_INIT(&lhw->lvif_head); for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { @@ -4112,9 +4125,10 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) lhw->ic = NULL; /* Cleanup more of lhw here or in wiphy_free()? */ - sx_destroy(&lhw->lvif_sx); - LKPI_80211_LHW_LOCK_DESTROY(lhw); + LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw); + LKPI_80211_LHW_LOCK_DESTROY(lhw); + sx_destroy(&lhw->lvif_sx); IMPROVE(); } @@ -5017,7 +5031,11 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, goto stopped; } + IMPROVE("hw(TX_FRAG_LIST)"); + + LKPI_80211_LTXQ_LOCK(ltxq); skb = skb_dequeue(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); stopped: return (skb); @@ -5034,10 +5052,12 @@ linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq, ltxq = TXQ_TO_LTXQ(txq); fc = bc = 0; + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_walk(<xq->skbq, skb) { fc++; bc += skb->len; } + LKPI_80211_LTXQ_UNLOCK(ltxq); if (frame_cnt) *frame_cnt = fc; if (byte_cnt) @@ -5590,13 +5610,17 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, { struct lkpi_hw *lhw; struct lkpi_txq *ltxq; + bool ltxq_empty; ltxq = TXQ_TO_LTXQ(txq); IMPROVE_TXQ("LOCKING"); /* Only schedule if work to do or asked to anyway. */ - if (!withoutpkts && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (!withoutpkts && ltxq_empty) goto out; /* Make sure we do not double-schedule. */ @@ -5609,6 +5633,39 @@ out: return; } +void +linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, + struct ieee80211_txq *txq) +{ + struct lkpi_hw *lhw; + struct ieee80211_txq *ntxq; + struct ieee80211_tx_control control; + struct sk_buff *skb; + + lhw = HW_TO_LHW(hw); + + LKPI_80211_LHW_TXQ_LOCK(lhw); + ieee80211_txq_schedule_start(hw, txq->ac); + do { + ntxq = ieee80211_next_txq(hw, txq->ac); + if (ntxq == NULL) + break; + + memset(&control, 0, sizeof(control)); + control.sta = ntxq->sta; + do { + skb = linuxkpi_ieee80211_tx_dequeue(hw, ntxq); + if (skb == NULL) + break; + lkpi_80211_mo_tx(hw, &control, skb); + } while(1); + + ieee80211_return_txq(hw, ntxq, false); + } while (1); + ieee80211_txq_schedule_end(hw, txq->ac); + LKPI_80211_LHW_TXQ_UNLOCK(lhw); +} + /* -------------------------------------------------------------------------- */ struct lkpi_cfg80211_bss { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index ef1f841e4f22..c9ac19321ab3 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -109,6 +109,7 @@ struct lkpi_radiotap_rx_hdr { struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; + struct mtx ltxq_mtx; bool seen_dequeue; bool stopped; uint32_t txq_generation; @@ -184,6 +185,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct sx sx; + struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; @@ -279,13 +281,26 @@ struct lkpi_wiphy { mtx_destroy(&(_lhw)->scan_mtx); #define LKPI_80211_LHW_SCAN_LOCK(_lhw) \ mtx_lock(&(_lhw)->scan_mtx) -#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ +#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ mtx_unlock(&(_lhw)->scan_mtx) #define LKPI_80211_LHW_SCAN_LOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_OWNED) #define LKPI_80211_LHW_SCAN_UNLOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_NOTOWNED) +#define LKPI_80211_LHW_TXQ_LOCK_INIT(_lhw) \ + mtx_init(&(_lhw)->txq_mtx, "lhw-txq", NULL, MTX_DEF | MTX_RECURSE); +#define LKPI_80211_LHW_TXQ_LOCK_DESTROY(_lhw) \ + mtx_destroy(&(_lhw)->txq_mtx); +#define LKPI_80211_LHW_TXQ_LOCK(_lhw) \ + mtx_lock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_UNLOCK(_lhw) \ + mtx_unlock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_LOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_OWNED) +#define LKPI_80211_LHW_TXQ_UNLOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_NOTOWNED) + #define LKPI_80211_LHW_LVIF_LOCK(_lhw) sx_xlock(&(_lhw)->lvif_sx) #define LKPI_80211_LHW_LVIF_UNLOCK(_lhw) sx_xunlock(&(_lhw)->lvif_sx) @@ -295,6 +310,18 @@ struct lkpi_wiphy { #define LKPI_80211_LSTA_LOCK(_lsta) mtx_lock(&(_lsta)->txq_mtx) #define LKPI_80211_LSTA_UNLOCK(_lsta) mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LTXQ_LOCK_INIT(_ltxq) \ + mtx_init(&(_ltxq)->ltxq_mtx, "ltxq", NULL, MTX_DEF); +#define LKPI_80211_LTXQ_LOCK_DESTROY(_ltxq) \ + mtx_destroy(&(_ltxq)->ltxq_mtx); +#define LKPI_80211_LTXQ_LOCK(_ltxq) \ + mtx_lock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_UNLOCK(_ltxq) \ + mtx_unlock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_LOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_OWNED) +#define LKPI_80211_LTXQ_UNLOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_NOTOWNED) int lkpi_80211_mo_start(struct ieee80211_hw *); void lkpi_80211_mo_stop(struct ieee80211_hw *); From nobody Tue Dec 19 03:45:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvMzg0ZFZz54ZFN; Tue, 19 Dec 2023 03:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvMzf1RZQz4Jpf; Tue, 19 Dec 2023 03:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702957550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HeRdCD65uhBAC5VgGElS8S7NHaiJom8T7t3+VtxAdAw=; b=fag6RC3+qN7uURI9/zIXX2fj1M8aJn44dx6G372zkBUv6DqA3yVFJrURWWvVxX9iZMKLpQ KY70G+hD2fmk3eNySYvapEMzrZ9i2I5UDG+LPt6DIxsjjUVtuEufkqE/dq1DOk4ZO/rjHA VaIPFzUnBOtAnJguY+C6nijZUrMT04S4p6tXXHkrg5MBGwQsQg5j7dypr2M10tzPxL9dki KMRi8ayG2rQKYjXaU+rQRuVyzfHNqS09LWojzOIjlbG2715C0EfJHNk+ItRfNHVQ/6+Sg7 bR2jTpCisrIPOUP2mOfgpRryQdqXTu3gYJM9SFEN4ub5BKzyzuhAk9RoixjflQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702957550; a=rsa-sha256; cv=none; b=w625mDgwb69hDzO45P6hhCn6BuNXQxPZiOYcLeMFYHmnCnet6vgActwzvMujmD1Zw85owg hyw7W/ZAFpnmK+TfRO6rhMwkygk1bmVxYIxdrjnf2+OXnUS1KoMOBUOut+ko3zkNrnVFKE DBmPT/neZnYTdEPhlJXm9CUl0fjzd6zZ6QiAT8oikwv8XNKTVfiR6cWXaeM+Y2iDAlFN3q 0T+v0yuhRyWMMmUVz0ejdSveoxDUch5+JV+dyL2kuHXpaOuHACE1kKiaKyorAgPQdroJOX e90WUkVSphKcLnLYKXSM9yB234g6g+IjE+NbiCMSkUOjf/65PdCJGArmvpNm5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702957550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HeRdCD65uhBAC5VgGElS8S7NHaiJom8T7t3+VtxAdAw=; b=yLrjZnPZnChK4wALwsIK2QBHQSBKoZ4/hnCP4UGtLgzX4a33/lWITblpW5sJqn7LntUv5n XkDmvV8xEgyi0ix8tuiXykYUQKXXSAxO5F87YOcCX0/7zxk7snJTch/pXzVK7IPLWd0DMf SUhRAiCyytSiJo0UXFhV4R3h/2cjmncTh2WUAYrO329RVQqI3O+P3Ku261exUZxR1KWdPW 9eRCOrU0Stl9xaXwHY7IHg+bXhyhtLqguh1tM60zNEqQN0BMl0K6RqZS8G7rdUAuvaXjVU zXBMJ3lyKJCklpqzh1edrrk+We1HTjaVnsC6T850sSyCbj166tu7wmlghV3FfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvMzf0WZyzpcB; Tue, 19 Dec 2023 03:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ3jn43043412; Tue, 19 Dec 2023 03:45:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ3jnL6043409; Tue, 19 Dec 2023 03:45:49 GMT (envelope-from git) Date: Tue, 19 Dec 2023 03:45:49 GMT Message-Id: <202312190345.3BJ3jnL6043409@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: d760d74dbed8 - main - ieee80211: Check for copyout() errors in the SIOCG80211STATS handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d760d74dbed81638979e662130e24111b3a5db0d Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d760d74dbed81638979e662130e24111b3a5db0d commit d760d74dbed81638979e662130e24111b3a5db0d Author: Mark Johnston AuthorDate: 2023-12-19 03:44:54 +0000 Commit: Mark Johnston CommitDate: 2023-12-19 03:44:54 +0000 ieee80211: Check for copyout() errors in the SIOCG80211STATS handler In preparation for annotating copyin() and related functions with __result_use_check. Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43095 --- sys/net80211/ieee80211_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 170cdc416276..d5b242b679d0 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -3636,8 +3636,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCG80211STATS: ifr = (struct ifreq *)data; - copyout(&vap->iv_stats, ifr_data_get_ptr(ifr), - sizeof (vap->iv_stats)); + error = copyout(&vap->iv_stats, ifr_data_get_ptr(ifr), + sizeof(vap->iv_stats)); break; case SIOCSIFMTU: ifr = (struct ifreq *)data; From nobody Tue Dec 19 08:46:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvVfz4tbrz54tmn; Tue, 19 Dec 2023 08:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvVfz40d8z3WVP; Tue, 19 Dec 2023 08:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702975611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qixOzvt1ucgmtU6wmBZjk03FLFbanamgPvptDLt5jk0=; b=spyLWylRH9dBO6etBRDyasn8smFNoZB+edmtc7+JPBGsHnq9HBfjh+/Ek1jkdgXjWn1eGm Ee61vaWguNwXlkAWqMWRY9XibgIw47jxj7JUUwBSc00LJkNW1gc7JIjFUbVErEtwEa8u7/ 7Ut40AcGZTLLkqeJ6OTD6vNCBHSgwezsJQlWr9Grshq4Q5ZZqU0mxI1IPCaxhCrbdRkCXY XeiOY895nJl6vlNPkdQbPdneA13LkzOmYnW58ec0i0NAMSIrMv537Y+YG4gbi7t19azSvF XBvRb8MjJgIaP1XEywVybCAvw8PWJovMthbZmDkjoiGYTpznCLYIw+WM6FcjMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702975611; a=rsa-sha256; cv=none; b=nyEtgTDVAMzwboFoTCIdt/FU8+PfrslomzlubFoi9To4tiZF1Vu4NadYSH9llM/l7OMEk/ wgn1CO0qe2jcEQuvysEgW3LuQzxIG2oJBAHqDWNoPssZ83R6a4Q+O8cz6Tn8/ja5mjdYJK 5QDcFod2nS38zlNO3FARs+EjWC5RHvAW9ayS6+3nQ+9jl23GtN4vbE1d0ZodWK2frOnEtj af938C0FHtB8NsUSkfZ41t2l8Hy5lT8+pOsQBPcqesnHyz5lIYUxAxGgV0H8cx/5yYf/SU ub+UYZTvpgPWj44m1PZ1MWDISlpfQdaT8xhgb1MmjOdU3TqJfFHxFhQqaFEreg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702975611; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qixOzvt1ucgmtU6wmBZjk03FLFbanamgPvptDLt5jk0=; b=Anb1ZR35S5JQFho3eye+YoRmSy4PGDpTzGY36hLjfbwZdzffPYvf/XfvEzwIKxRiFA3GMY 0FGpc4IIZSSC/KatkfWMEyWtkFa55aN5alBbNC5F2Mmz4XReM4yyy9Z/wlgPJ/NVOpK4Ro f1fiK2cgZ5ZBn8r5QBz88BWvRegbdSKKj2c+b7PCCI8LC6nXUliD8kYMrIog4M/BHpI1fB Q4FB8bs0z4bgh3Ub1WjlmPNfj3OXWcl3mvsnRXzDVImVOZtn2JmU0DmlHWsD+WN35MulQO V7mx+UNNIi/8YOq9WHdsV6AnGhSENYB/9OW+pn4oEranf8LlON4A/SBx5yRjtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvVfz2YCVzyB9; Tue, 19 Dec 2023 08:46:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ8kpAZ045677; Tue, 19 Dec 2023 08:46:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ8kpxf045674; Tue, 19 Dec 2023 08:46:51 GMT (envelope-from git) Date: Tue, 19 Dec 2023 08:46:51 GMT Message-Id: <202312190846.3BJ8kpxf045674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: a540e5ee07ac - main - committers-src: Add olce@ with mentors emaste@ and markj@ List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a540e5ee07ace7de9684fcd419c48c8716100372 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a540e5ee07ace7de9684fcd419c48c8716100372 commit a540e5ee07ace7de9684fcd419c48c8716100372 Author: Olivier Certner AuthorDate: 2023-12-11 17:11:20 +0000 Commit: Olivier Certner CommitDate: 2023-12-19 08:43:45 +0000 committers-src: Add olce@ with mentors emaste@ and markj@ Approved by: emaste (mentor) --- share/misc/committers-src.dot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index 4e5119df9897..9de6a783f3c4 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -291,6 +291,7 @@ nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] n_hibma [label="Nick Hibma\nn_hibma@FreeBSD.org\n1998/11/26"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] oh [label="Oskar Holmlund\noh@FreeBSD.org\n2021/04/21"] +olce [label="Olivier Certner\nolce@FreeBSD.org\n2023/12/01"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] oshogbo [label="Mariusz Zaborski\noshogbo@FreeBSD.org\n2015/04/15"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] @@ -537,6 +538,7 @@ emaste -> kevans emaste -> lwhsu emaste -> markj emaste -> ngie +emaste -> olce emaste -> rstone emaste -> scottph @@ -751,6 +753,7 @@ markj -> dougm markj -> jfree markj -> lwhsu markj -> mhorne +markj -> olce markj -> rlibby markm -> jasone From nobody Tue Dec 19 09:37:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvWn53t9Kz54x00; Tue, 19 Dec 2023 09:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvWn53Rk2z4N8T; Tue, 19 Dec 2023 09:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702978633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bHbST2GYcz8tOhvLxEu5cQuCXtYY5UNT4lQ7LJpfkJo=; b=ikXL3qeX2kY/Qp1wu8Yh+9zc8kDrncyao4n0lZZ8DWPza1n2/8zIre5EVC5tqP+JIeJvkq BhAJk8Q96/vQHo6FhIw0SlgIYbl61SewXICTZdKMmwolDDbVAJB8bM1T17habTFQGVAnGa anUbCYhEjyRNj/UcM3+uS7fANGnTmAqlXbLimoiZcD5joDUcKiqdhnCJLb1Y0AoXjmEhJY aai0RSZ1G74XKqQNaDOC9vuECcHY2iThz9xAcZUaOINq5dhCOAjQtYlKAf6eq8kQTYghZd kzlHiW8Jqpfg5GwvttCW3G/T2HRhTwpUh5XJ8AX8xhQJ9T13wuLQxhQM4fqL2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702978633; a=rsa-sha256; cv=none; b=GdvK2jirh42eOFviGRdoxiz1DmW/FD8rO0ds/Xfz2b3OShnNwS++ud+bbHAntXD0RItRwu tkrFbDADeuCuQ4PMUE6Be5LghT+OSft+vBtoSAf3/ZjVCNaEN1DceLUC3/hv1qLHlyY5yD 1Fc9wf7pTeYYbiOj1pVP5GSxrBeTAYsFFiOoLUbOV2ELWnaQ2LOp2oYlaUl8aqeVHhWT0H abQqLZ7ouGctZC5ah9qiHgBC2hfpuNMWN28Wa8hdY6IrLS/UjszLesiU0BFQ0WBWiKaSGM LZgqZt5IPK9ZwqaFfsax9exWrv+x8bHf+l/wL/AsClG9gx/MdQo4gRWPGEiUYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702978633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bHbST2GYcz8tOhvLxEu5cQuCXtYY5UNT4lQ7LJpfkJo=; b=TR31G54QKm7y2JhYwDWkEtsqoG+yeVLYORHVlRf6V7QniaQj85ZF5OqsLYv7vNrKasN0Ai +dolEiTwkWQIRRU6DRMrkqqutnWU+Ben0mRhGBEEB2jOmYpUNM46O5v4hpdbYYXpt7kpIt xWJXKZBjZp9rq9DU22gS9f9J7JnfponEgFeC8hDGihTxw3Ssjry3ZLATrxEMloBipLu77x 7tol1ZmHzXnc5J7hLgpXuLCVUIq0wCjCckWQ1hD8EMlKUvy2RMrsnEUk6FOXg0Hwf+Sczb uIHmfZUIqUu0e8ihsR94Oi9KW1B/HgCoCZYJ6AVgQC7VwIp7t7xUkZCIfMq0vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvWn52TxDz100n; Tue, 19 Dec 2023 09:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJ9bDbM029967; Tue, 19 Dec 2023 09:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJ9bDkL029964; Tue, 19 Dec 2023 09:37:13 GMT (envelope-from git) Date: Tue, 19 Dec 2023 09:37:13 GMT Message-Id: <202312190937.3BJ9bDkL029964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 2134b35e0f71 - main - stress2: Fix "-Wunused-but-set-variable" warnings. Style fixes, while here List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2134b35e0f71a7cafa3602a4d362ee7ef8b65ebb Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=2134b35e0f71a7cafa3602a4d362ee7ef8b65ebb commit 2134b35e0f71a7cafa3602a4d362ee7ef8b65ebb Author: Peter Holm AuthorDate: 2023-12-19 09:36:41 +0000 Commit: Peter Holm CommitDate: 2023-12-19 09:36:41 +0000 stress2: Fix "-Wunused-but-set-variable" warnings. Style fixes, while here --- tools/test/stress2/misc/fcntl.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tools/test/stress2/misc/fcntl.sh b/tools/test/stress2/misc/fcntl.sh index 39f7f87dc005..237cacdf6de8 100755 --- a/tools/test/stress2/misc/fcntl.sh +++ b/tools/test/stress2/misc/fcntl.sh @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -# fcntl(2) locking scenario. No problems seen. +# fcntl(2) locking scenario. . ../default.cfg @@ -45,6 +45,8 @@ rm -f /tmp/fcntl exit $status EOF #include +#include + #include #include #include @@ -52,7 +54,6 @@ EOF #include #include #include -#include #include #define PARALLEL 16 @@ -80,9 +81,10 @@ add(int n, int increment) { struct flock fl; off_t pos; - long val, oval __unused; - int r; + long val, oval; + int debug, r; + debug = 0; /* set to "1" for debug output. */ pos = n * sizeof(val); memset(&fl, 0, sizeof(fl)); fl.l_start = pos; @@ -107,10 +109,9 @@ add(int n, int increment) } oval = val; val = val + increment; -#if defined(DEBUG) - fprintf(stderr, "add(%d, %d) @ pos %ld: %ld = %ld + %d\n", - n, increment, (long)pos, val, oval, increment); -#endif + if (debug != 0) + fprintf(stderr, "add(%d, %d) @ pos %ld: %ld = %ld + %d\n", + n, increment, (long)pos, val, oval, increment); if (lseek(fd, pos, SEEK_SET) == -1) err(1, "lseek"); while ((r = write(fd, &val, sizeof(val)) != sizeof(val))) { @@ -178,9 +179,9 @@ down(void) int main(void) { - int flags, i; - long val, sum; off_t len; + long val, sum; + int flags, i; signal(SIGHUP, handler); signal(SIGALRM, ahandler); From nobody Tue Dec 19 15:34:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svghp1ktcz54Qp5; Tue, 19 Dec 2023 15:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svghp0msQz3DSZ; Tue, 19 Dec 2023 15:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703000042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33F0YSTGQoPBRQl47mIc2Hll9IfKZ56Jj8uG3gqsfSo=; b=JXpPlWyEvELUFkPHkSX4hIWlAoeXy3BStOzybsRuEW4hG9zJvg9Upb5KDv+9M+75QTJIrC SmP1hKTma+uhJIch+relFSdBPnqDS/ifVqKbNuyGu7z38KRrfcHi/2Savmm9Qdw4PD0Uzy XbXvCHs+ff3WmZbkqC12zThLV3Q6C4fYnzzUU38pMBCsoNuScy/ieFUpDxlxDxtwsSSDl1 Tg2UtxKTHgiBVLmzv+6c5pEjNbMbC5sxTCC1XLWYlWQUe24E2tl+3vLIQDwhHYpVS8K/ci Gv9aBGfUWS4WO2yFwtm+Px9ONu2kC7H40sBSoSmhCEtFRITCN+zFSbgPhk51qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703000042; a=rsa-sha256; cv=none; b=JLeN+DQY/lDXk7O5JTUV7GQLWMrGP1PC6+9I5nPVbH+/LF1WUeAS4KzkMVl8YacVvVJDg1 nz7VmU4a1Hl2TGaf5HGfBt+OI0JQQz3JEiLxlB6HOHHNulyjeb9EG6Guv4WaQMhfF29NsO A1I9el+XFStJasn/2gvzC8gQYQeK9r5spn5tEEMICVTh7Ksd0pNy26wT4R9JhSkChwuHo+ oyCXBQOtGX3pzhOXC+D5xjIgma0/HkQO8mE+AvTh9aVtXV0f570zyjxfXAzHZ8TzmMpt3T H3EZ8KAOzbYleMI+giW6pRCXyN6q2dEimCtMlLGgSIo6dPo1xjld6EQiar0xiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703000042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33F0YSTGQoPBRQl47mIc2Hll9IfKZ56Jj8uG3gqsfSo=; b=djav8pjQKN6H6aKnFcdFj93L/KWdeq0wk/9PTmp+Pc9hMK08EwTAn4yrAFwUbn3+GHvQMH 52G7rMsFJsycPQGztsR9mGU7N/HJYoNW6oZX6ZIzG8AJjKcQtGsIGIGuZhE3wsqytVRJVn s/V7wYmX+n7SXVPz63va+MWYeTJ4SIavPFDgejw+WC9WSoPJ757wslsa0H3ulFJAhtsSPa QHJ4opJUeVIUaVVDFNwLRJTv+YsrS6jjOMlgbP0aTTmOzb4EIxAZvbJEBUdI6weADdSt2L MZ3eWsrLXyk+i/K9gcuPADmfa4lj3j79Vr0P371YZUVB4AZWStqpOZrytsa/eQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svghn70ncz19Bk; Tue, 19 Dec 2023 15:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJFY1N7030845; Tue, 19 Dec 2023 15:34:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJFY1cp030842; Tue, 19 Dec 2023 15:34:01 GMT (envelope-from git) Date: Tue, 19 Dec 2023 15:34:01 GMT Message-Id: <202312191534.3BJFY1cp030842@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: ed19c0989fe7 - main - tmpfs: enforce size limit on writes when file system size is default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed19c0989fe77ec3c9d7bdb752bab6bbef4c0be6 Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=ed19c0989fe77ec3c9d7bdb752bab6bbef4c0be6 commit ed19c0989fe77ec3c9d7bdb752bab6bbef4c0be6 Author: Mike Karels AuthorDate: 2023-12-19 15:32:58 +0000 Commit: Mike Karels CommitDate: 2023-12-19 15:32:58 +0000 tmpfs: enforce size limit on writes when file system size is default tmpfs enforced the file system size limit on writes for file systems with a specified size, but not when the size was the default. Add enforcement when the size is default: do not allocate additional pages if the available memory + swap falls to the reserve level. Note, enforcement is also done when attempting to create a file, both with and without an explicit file system size. PR: 275436 MFC after: 1 month Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D43010 --- sys/fs/tmpfs/tmpfs_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 2fe7f7e3ca58..e255c6488613 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -290,6 +290,8 @@ tmpfs_can_alloc_page(vm_object_t obj, vm_pindex_t pindex) if (tm == NULL || vm_pager_has_page(obj, pindex, NULL, NULL) || tm->tm_pages_max == 0) return (true); + if (tm->tm_pages_max == ULONG_MAX) + return (tmpfs_mem_avail() >= 1); return (tm->tm_pages_max > atomic_load_long(&tm->tm_pages_used)); } From nobody Tue Dec 19 15:34:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svghq5Qkyz54QwK; Tue, 19 Dec 2023 15:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svghq1vXhz3DXS; Tue, 19 Dec 2023 15:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703000043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jFzdUsyue/mQDWXdHniLO4miHCqQtM098LZes3S9XY=; b=vMXOs9rBsz1gR7vAJhlR6mAg9wUsevRsziWsFbO9JyXkE6clXoEzm5L1zQAiwPJgy4fAkg NwTZFSeJDVoebI4CsVQ//OnZ9bl9sbISuwjCqajRlZlGkfBzOYQZsNWwmXOiyqLjOyMtHy IldDl5kyLmk1WLw4K8xJe89km6CcIjf96GwaUMLgxYvMV0ZkviNN7i6w/sFmUFNHEwIeIY Lt2umtKgQTwVfvnADmhWd6FXQaz4mPcBzmy+PjfaqvbxmJvpRXZ78R/YpfjgMJfo3wVYxW nF13QTVTF4wYlenzDC1f+wjRpKiiSG8OjDaBFvPrwwmX8DoiOX7IN6/LKAZoPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703000043; a=rsa-sha256; cv=none; b=lwL58mgqMJHRcVTmvVhsVz90qlEXlUy3V8cowIO3B8SMetGmkYGMmRvkMHYNp819z+qfef UhwR5MK7gL9v4AJnb/XGFkdGCUlPr3cJVdNQj+E1yZ32JO8mzaVgdDxiiUQ4brZ06B0ADg QIxlljqjtp+5EJL9KLTLHtqwaSIxAvYVv85RArp9FfOkxH7wl3pwlzWhnFswobuXD/i0DM d+f/h0IezB8U0z8ilqYGSDNpBzU/h6mtKJ0gXNCMi3E2/uNzJCROoC45jR0oQusj9P1STQ QYme3KfnyXxK9190O8KHfoSQh/lzmuNj4zbkBmGzH28V5D2F3yfT/tI+XKoftg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703000043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jFzdUsyue/mQDWXdHniLO4miHCqQtM098LZes3S9XY=; b=e/B+5bd5zFA7ZXCCF4qvevjZWYVUojTsWS18ryoV7v2m9C2/yIhBelIaeznjTq7FqrLUHc McemDKnsjnhb1vRrAjplMB8Vnz7VNt5sPVZ6Tw+RiLp5X929Q98T3TPT4tX8p3FpP0NoOb MlgznZJmtbyGtiOS3EE88t2DsZbHlauu3YkEtuivzEP0EU/lLAccuuUNypwtTBCyhDXJ1b 5Wh0iIEqu47ZIUyUDzydzIh0N9S7XO+NVZU0qKpUhVaD6C+MXqCyFOyNDrip4ejwxD2dgl wh2gsZ0h4kRfuulnj6xKtKctkXZbA69lf0qwaLhA3NzO9XtEgkoDc1NtWwyw1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svghq10Hpz19Bl; Tue, 19 Dec 2023 15:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJFY3ux030911; Tue, 19 Dec 2023 15:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJFY3fo030908; Tue, 19 Dec 2023 15:34:03 GMT (envelope-from git) Date: Tue, 19 Dec 2023 15:34:03 GMT Message-Id: <202312191534.3BJFY3fo030908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 636592343c3e - main - tmpfs: increase memory reserve to a percent of available memory + 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 636592343c3ec0feb61a4d8043676381384420dd Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=636592343c3ec0feb61a4d8043676381384420dd commit 636592343c3ec0feb61a4d8043676381384420dd Author: Mike Karels AuthorDate: 2023-12-19 15:33:33 +0000 Commit: Mike Karels CommitDate: 2023-12-19 15:33:33 +0000 tmpfs: increase memory reserve to a percent of available memory + swap The tmpfs memory reserve defaulted to 4 MB, and other than that, all of available memory + swap could be allocated to tmpfs files. This was dangerous, as the page daemon attempts to keep some memory free, using up swap, and then resulting in processes being killed. Increase the reserve to a fraction of available memory + swap at file system startup time. The limit is expressed as a percentage of available memory + swap that can be used, and defaults to 95%. The percentage can be changed via the vfs.tmpfs.memory_percent sysctl, recomputing the reserve with the new percentage but the initial available memory + swap. Note that the reserve can also be set directly with an existing sysctl, ignoring the percentage. The previous behavior can be specified by setting vfs.tmpfs.memory_percent to 100. Add sysctl for vfs.tmpfs.memory_percent and the pre-existing vfs.tmpfs.memory_reserved to tmpfs(5). PR: 275436 MFC after: 1 month Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D43011 --- share/man/man5/tmpfs.5 | 18 ++++++++++++++++++ sys/fs/tmpfs/tmpfs.h | 8 ++++++++ sys/fs/tmpfs/tmpfs_subr.c | 40 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/share/man/man5/tmpfs.5 b/share/man/man5/tmpfs.5 index c01aefd8550a..f3d6a2f6c2b5 100644 --- a/share/man/man5/tmpfs.5 +++ b/share/man/man5/tmpfs.5 @@ -164,6 +164,24 @@ The default is the mount point's UID. Refer to .Xr mount 8 . .El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables are available: +.Bl -tag -width indent +.It Va vfs.tmpfs.memory_percent +The percentage of memory plus swap space available at kernel file system +initialization that can be used by a file system with a size of 0. +When this amount of space in use is reached, new files cannot be created +and files cannot be extended. +The default is 95%. +Changing this value also changes +.Va vfs.tmpfs.memory_reserved . +.It Va vfs.tmpfs.memory_reserved +The currently-reserved amount of memory plus swap space +based on the memory percentage. +The minimum is compiled into the system, and defaults to 4 MB. +.El .Sh EXAMPLES Mount a .Nm diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 7ebdffbec84f..5c86a386b9da 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -543,6 +543,14 @@ tmpfs_update(struct vnode *vp) #define TMPFS_PAGES_MINRESERVED (4 * 1024 * 1024 / PAGE_SIZE) #endif +/* + * Percent of available memory + swap available to use by tmpfs file systems + * without a size limit. + */ +#if !defined(TMPFS_MEM_PERCENT) +#define TMPFS_MEM_PERCENT 95 +#endif + /* * Amount of memory to reserve for extended attributes. */ diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index e255c6488613..c8961a819e7b 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -73,6 +73,9 @@ SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "tmpfs file system"); static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; +static long tmpfs_pages_avail_init; +static int tmpfs_mem_percent = TMPFS_MEM_PERCENT; +static void tmpfs_set_reserve_from_percent(void); MALLOC_DEFINE(M_TMPFSDIR, "tmpfs dir", "tmpfs dirent structure"); static uma_zone_t tmpfs_node_pool; @@ -367,6 +370,9 @@ tmpfs_subr_init(void) sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); VFS_SMR_ZONE_SET(tmpfs_node_pool); + + tmpfs_pages_avail_init = tmpfs_mem_avail(); + tmpfs_set_reserve_from_percent(); return (0); } @@ -401,10 +407,42 @@ sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_reserved, - CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &tmpfs_pages_reserved, 0, + CTLTYPE_LONG | CTLFLAG_MPSAFE | CTLFLAG_RW, &tmpfs_pages_reserved, 0, sysctl_mem_reserved, "L", "Amount of available memory and swap below which tmpfs growth stops"); +static int +sysctl_mem_percent(SYSCTL_HANDLER_ARGS) +{ + int error, percent; + + percent = *(int *)arg1; + error = sysctl_handle_int(oidp, &percent, 0, req); + if (error || !req->newptr) + return (error); + + if ((unsigned) percent > 100) + return (EINVAL); + + *(long *)arg1 = percent; + tmpfs_set_reserve_from_percent(); + return (0); +} + +static void +tmpfs_set_reserve_from_percent(void) +{ + size_t reserved; + + reserved = tmpfs_pages_avail_init * (100 - tmpfs_mem_percent) / 100; + tmpfs_pages_reserved = max(reserved, TMPFS_PAGES_MINRESERVED); +} + +SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_percent, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &tmpfs_mem_percent, 0, + sysctl_mem_percent, "I", + "Percent of available memory that can be used if no size limit"); + static __inline int tmpfs_dirtree_cmp(struct tmpfs_dirent *a, struct tmpfs_dirent *b); RB_PROTOTYPE_STATIC(tmpfs_dir, tmpfs_dirent, uh.td_entries, tmpfs_dirtree_cmp); From nobody Tue Dec 19 16:24:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svhpd42Tfz54VqQ; Tue, 19 Dec 2023 16:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svhpc6KW9z3Mfm; Tue, 19 Dec 2023 16:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703003048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DxrLZ6qfDYi3XsXVOxEOHt6a1V2N6eYoqAlsJq7jDnk=; b=HxnrRvD7Ue4G3+S0jIGBkrJqBMucHXjWz2BtSk9vL/Dn+6EGr1lNqKII5IPd6LoG+TkJHF n18RG7oyeIdH1AiBb0gDI28O5udy7q+T9l8EQd22XzkOSeR+GtEa+SaBiRF0lZtaEXF2yi RmdOoxyY58NmNcwyY4x3a/R6HgGccyKtBqmbTto+sOBNXkvfGaJ8p9UVQEpLLZXvV44xy8 vjoZsb51t1D7+snaA1+HjQbLsdtzq3nb7fgVKRLES6y2XbNzKuancLBM9aXvCrxlp1HRUW MeZg/Yf5EQNclhNXoJCeDe3pqVcN1+fUlQV6yT11PLVyc6A6TYqdnw5wZLWmug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703003048; a=rsa-sha256; cv=none; b=j8DRv/nMD+ae8Zk05N8cUGAhWympWMXE/wxpXC0wXC0cR6J5NrFrWMrdX+LZ3YR4P67blS NJMgS+11LYAtYS4dlTEbsKeiqVP0jFPJkTYxud3LTrQfI02+/7xVb5m07feGun9NyV8wzu /8RRZNxh1vtWf3wVCiMWBZYMNf4c6QQQ3ksswTexdkAg1Q4LQo/kiH+s2/pGbcnW8QCIeY k0Q5GZ55/yNAFlX1c7XgSJSPN7vBbBbKLARZy1cGk33/z4tjUIuFEnE4aAtcSOUzVch8bL ClkT2aows18QeomKbWqPMY+q+XwKVr6imgw7BXn2Ud57IHLXVNgCI/6FZ9xbHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703003048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DxrLZ6qfDYi3XsXVOxEOHt6a1V2N6eYoqAlsJq7jDnk=; b=XCv2+J3S60wCCN3G3/SbSB6cf37gbKwHYAa4emwsUm/B3xbgU422tOpHlsGhsAy4keIOIO HdsHDkxgrkeUqxcp86MT7YbcLsPQLyrV0MZogWJ6IUqMy0r/sveBMseWTAlmEJBGxuwDlK LZ79PxX5oAZ0W5iGbCdw0OCQxszTRaFG5/AMTRIRs0Qb6NSJVfi8Bw37ACc+UTE2W/VeZ0 S0gXLFPk+1zWSF0xjOKIftm0zMwSYTOC//gnBZQ9QL1SrZWrXhzYluoQuz2SQtLWNQ70EX BcK1axVdyU3Vx3yVwD+Cl8/chsLXpAVCHYfgsXMZV8Iz3KfSU9u73eT6O15acQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svhpc571kz1BlV; Tue, 19 Dec 2023 16:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJGO8To015061; Tue, 19 Dec 2023 16:24:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJGO8wt015058; Tue, 19 Dec 2023 16:24:08 GMT (envelope-from git) Date: Tue, 19 Dec 2023 16:24:08 GMT Message-Id: <202312191624.3BJGO8wt015058@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: ec6682ed6c1d - main - atf.test: fix installation of python test scripts List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ec6682ed6c1d7304521bad39a1ad7ceae76aaca3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ec6682ed6c1d7304521bad39a1ad7ceae76aaca3 commit ec6682ed6c1d7304521bad39a1ad7ceae76aaca3 Author: Kristof Provost AuthorDate: 2023-12-19 13:15:48 +0000 Commit: Kristof Provost CommitDate: 2023-12-19 16:23:54 +0000 atf.test: fix installation of python test scripts Python test scripts get processed (to add the `#! /usr/libexec/ atf_pytest_wrapper` shebang line), into a .xtmp file, and installed from there. However, as there was no dependency of this .xtmp file on the original file we kept reinstalling the .xtmp file, even if the original had been edited already. This could cause great confusion when debugging python test scripts. Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D43118 --- share/mk/atf.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/atf.test.mk b/share/mk/atf.test.mk index 4b8ac8dedc27..f7696641ffb0 100644 --- a/share/mk/atf.test.mk +++ b/share/mk/atf.test.mk @@ -143,7 +143,7 @@ CLEANFILES+= ${_T} ${_T}.tmp # this proves to be useful within the tests. ATF_TESTS_PYTEST_SED_${_T}?= # empty ATF_TESTS_PYTEST_SRC_${_T}?= ${.CURDIR}/${_T:S,.xtmp$,,} -${_T}: +${_T}: ${_T:S/.xtmp//} echo "#! /usr/libexec/atf_pytest_wrapper -P ${TESTSBASE}" > ${.TARGET}.tmp .if empty(ATF_TESTS_PYTEST_SED_${_T}) cat ${ATF_TESTS_PYTEST_SRC_${_T}} >>${.TARGET}.tmp From nobody Tue Dec 19 17:40:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvkVp21MGz54ccK; Tue, 19 Dec 2023 17:40:34 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4SvkVn3fwgz4NGd; Tue, 19 Dec 2023 17:40:33 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: by glebi.us (Postfix, from userid 1000) id 1EA75552FA; Tue, 19 Dec 2023 09:40:26 -0800 (PST) Date: Tue, 19 Dec 2023 09:40:26 -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: ec6682ed6c1d - main - atf.test: fix installation of python test scripts Message-ID: References: <202312191624.3BJGO8wt015058@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202312191624.3BJGO8wt015058@gitrepo.freebsd.org> 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:27348, ipnet:162.251.186.0/24, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SvkVn3fwgz4NGd Kristof, On Tue, Dec 19, 2023 at 04:24:08PM +0000, Kristof Provost wrote: K> commit ec6682ed6c1d7304521bad39a1ad7ceae76aaca3 K> Author: Kristof Provost K> AuthorDate: 2023-12-19 13:15:48 +0000 K> Commit: Kristof Provost K> CommitDate: 2023-12-19 16:23:54 +0000 K> K> atf.test: fix installation of python test scripts K> K> Python test scripts get processed (to add the `#! /usr/libexec/ K> atf_pytest_wrapper` shebang line), into a .xtmp file, and installed from K> there. However, as there was no dependency of this .xtmp file on the K> original file we kept reinstalling the .xtmp file, even if the original K> had been edited already. K> K> This could cause great confusion when debugging python test scripts. Oh, that gave me a lot confusion and several times. I even attempted to fix it, but messed up due to bad make(1) skills. Thanks for fixing! -- Gleb Smirnoff From nobody Tue Dec 19 17:49:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svkj32zmSz54dBk; Tue, 19 Dec 2023 17:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svkj32Fc7z4bQs; Tue, 19 Dec 2023 17:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703008167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IaoHiw9iS4juiZgbBCuSda3SaUSKGFGMMz5X+a1B3xI=; b=Sn2NF53ZhI4deJZcCuErZhmpWVgNSkJ2rW3bqtLwxNJLFe23tocQJVymLUmvfc41srBYZL UBY7yTydxIIL7AYCOMVIXmtWhAYc9pj/rPJZz//yw+eoE9EKw6keQtLFUcWwD7a81JAVbW /JYN6B5Bpy/XHihnVx9sND9Qca8kC+qf4+06tbYvJk8gwN2XPNgX7qwtm3ZS9OFqAqS/jQ z+L2phoFLh3JpWrrpsefigD7hlp7bM0v4f0+Er0aM0R5yhCyHCNqUzmHWwepOyPaX+VLGL BnXI/guVptaxPXeUORr6rN4wYqdDr7Cgrvt+6W7d+PulpkTw8zH4+pEJvASi0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703008167; a=rsa-sha256; cv=none; b=xf9/oVSq0Aw3Nrau47yLDYLQDI2JvB44XYScWz9IP+JwzW+ETzGMqcfAIh5nKH+uWyOh81 etv8sbbRkcY0MjllEZGVDCstgJzcEN4OQR9EiHzqgTVIiE4InhwEkHw47L6v1mfpyb57wv IuoaE7dFfRjccFkHaOdqx5dZA3KvUvZPaggyLjsn1rXrK+65BX+VAifMnIH0sUoJXYSj/e u7xAQnKO6jeU/Z7wrkarqenruUORs4QR/7rp8Z2iNn3k0B94BOu/haeCr5bMZrVYi2eMUK kd/NzK51r9in8PID+XIfjoX0gSW/Q4D1fTYBIK9iaYZwWk+91C2CPNX45XrWWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703008167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IaoHiw9iS4juiZgbBCuSda3SaUSKGFGMMz5X+a1B3xI=; b=f9xzLp4/+oHtzB6nzEE3OQ5d5oBgKkOMZeXp3Ib5eU+e1f4Ok7GqqWtOuXgwrytSgkkt5U mHLI4ODqTgwlq05awpENXuhsavenQgeGdSkW+XyvOKtr3x3tx++a047DemNB6Pa9fOOs4S RORaOzg24pInnYEz6sGWZlhuMz7vy9+Ep+MSFu8k19/dvnBj6NjslAt/ILD2PS3VTQcUAd 3554x55SKthru5J3EIY02rTGnoW9/yev05l/8bZMT1OPkhlbgK1dFk5gR60gZvxWi//BOI lcRoat2IBxCktjcS8KTC8sxEyiTdCS+PyuzX6CVqCVsTBRHF8fTHqH+1cJO/6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svkj30nHtzsl; Tue, 19 Dec 2023 17:49:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJHnRvJ049473; Tue, 19 Dec 2023 17:49:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJHnR4X049470; Tue, 19 Dec 2023 17:49:27 GMT (envelope-from git) Date: Tue, 19 Dec 2023 17:49:27 GMT Message-Id: <202312191749.3BJHnR4X049470@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: c2e0b604a3aa - main - netinet tests: test that we send IGMP join/leave packets as expected List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c2e0b604a3aa2a510f87a0e49badf485585252c5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2e0b604a3aa2a510f87a0e49badf485585252c5 commit c2e0b604a3aa2a510f87a0e49badf485585252c5 Author: Kristof Provost AuthorDate: 2023-12-19 16:47:41 +0000 Commit: Kristof Provost CommitDate: 2023-12-19 16:47:41 +0000 netinet tests: test that we send IGMP join/leave packets as expected Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netinet/Makefile | 1 + tests/sys/netinet/igmp.py | 108 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index 44f76508bf5c..434aadc87f46 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -24,6 +24,7 @@ ATF_TESTS_SH= arp \ redirect ATF_TESTS_PYTEST+= carp.py +ATF_TESTS_PYTEST+= igmp.py TEST_METADATA.divert+= required_programs="python" TEST_METADATA.forward+= required_programs="python" diff --git a/tests/sys/netinet/igmp.py b/tests/sys/netinet/igmp.py new file mode 100644 index 000000000000..b079c5d18664 --- /dev/null +++ b/tests/sys/netinet/igmp.py @@ -0,0 +1,108 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +import pytest +from atf_python.sys.net.tools import ToolsHelper +from atf_python.sys.net.vnet import VnetTestTemplate +import os +import socket +import struct +import sys +import logging +logging.getLogger("scapy").setLevel(logging.CRITICAL) +curdir = os.path.dirname(os.path.realpath(__file__)) +netpfil_common = curdir + "/../netpfil/common" +sys.path.append(netpfil_common) +from sniffer import Sniffer + +sc = None +sp = None + +def check_igmpv3(args, pkt): + igmp = pkt.getlayer(sc.igmpv3.IGMPv3) + if igmp is None: + return False + + igmpmr = pkt.getlayer(sc.igmpv3.IGMPv3mr) + if igmpmr is None: + return False + + for r in igmpmr.records: + if r.maddr != args["group"]: + return False + if args["type"] == "join": + if r.rtype != 4: + return False + elif args["type"] == "leave": + if r.rtype != 3: + return False + r.show() + + return True + +class TestIGMP(VnetTestTemplate): + REQUIRED_MODULES = [] + TOPOLOGY = { + "vnet1": { "ifaces": [ "if1" ] }, + "if1": { "prefixes4": [ ("192.0.2.1/24", "192.0.2.2/24" ) ] }, + } + + def setup_method(self, method): + global sc + if sc is None: + import scapy.contrib as _sc + import scapy.contrib.igmp + import scapy.contrib.igmpv3 + import scapy.all as _sp + sc = _sc + sp = _sp + super().setup_method(method) + + def test_igmp3_join_leave(self): + "Test that we send the expected join/leave IGMPv2 messages" + + if1 = self.vnet.iface_alias_map["if1"] + + # Start a background sniff + expected_pkt = { "type": "join", "group": "230.0.0.1" } + sniffer = Sniffer(expected_pkt, check_igmpv3, if1.name, timeout=10) + + # Now join a multicast group, and see if we're getting the igmp packet we expect + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) + mreq = struct.pack("4sl", socket.inet_aton('230.0.0.1'), socket.INADDR_ANY) + s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) + + # Wait for the sniffer to see the join packet + sniffer.join() + assert(sniffer.correctPackets > 0) + + # Now leave, check for the packet + expected_pkt = { "type": "leave", "group": "230.0.0.1" } + sniffer = Sniffer(expected_pkt, check_igmpv3, if1.name) + + s.close() + sniffer.join() + assert(sniffer.correctPackets > 0) From nobody Tue Dec 19 18:22:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvlRc38hnz54gfS; Tue, 19 Dec 2023 18:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvlRc2DRyz4Rdr; Tue, 19 Dec 2023 18:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703010172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YxTIogOpxNUGCVZ1bkh/GZpH77BNleEw3NbbrOIZ3FQ=; b=psRpQ1vRSXdpXhhH/EtHMBl74qfF+t1pPvwsV2SILOQq1K7t1T+QOOSbX3OmI//vnoqDyB 9+frHv9TauLS8M8r9y1uYxLB2+6lMg4rFK1lAcomjvK1mEqiFfzp0AlY3OramnuVUCrPLO P0tiTDCgBy/DiW4jOM+bW0KSIi7aNuCM58Yr1ykE2lYbkHharwTMAjFRwHM9YHviP56rgV aPxdMr/yJma631oGB686qTjTOtvjnXgUQ8uCOlzRT7GUnf7sdKTYXwiNN1z77iMJS8J6tM NhogW1LhzshwmaUExsraE/DZOiVhhdoJTPzLoMN+4vnfiVmu552yahZ6bF6VHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703010172; a=rsa-sha256; cv=none; b=Pl/vgpvGkFl5WHZbAiu/E9rGY1FPnJwL2ukA8JstVVM99mKQ6K8ACuq766oJuO6UIjdVP7 VZi9kSoULFv6K4Zzqoc/YBL72wt/VzXKaQI+t0A3+OvQVo84yPwMOC9uq78mvhH4kk9Yxe wpYXOgMUMY2Er4zYQEXrpLP62EYcQyU2TIw+k8QdXMr6Qyxonq7wo2+jjKvaO8G+gV95+c oMFWZFvDj3PamxM+OTo5eS2Yimk0GCulJuDH+juZ3781LPz9idl8H/Uk4NOP4i0W9CzOkk ki62RyX+teqsgwjU9g3e+bsk1hdskzyX5lKfTXVLe1JF8Oua2A8bfueUnhv13g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703010172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YxTIogOpxNUGCVZ1bkh/GZpH77BNleEw3NbbrOIZ3FQ=; b=tySBJu7EcPf77UYRSn2sPXjm6Y5zpfpbakoQ9pUVPzaWWb9OHqCvYt013RX3OhxGrjThIs VqN6MYdST66vlZk9GoSML3hJrnyY8dvWfw5jqPIX9XBH9BCJNV20usQmKdWP0SzjbXiEli pI6GQDC+X/IJNjwDBtLmNJwduXwhV+8ncVVnwMjjOxU4Z1Blv2fQ9OjcEMzjMtsPuRkhzA baowcDZJkL8xj+yH2ujfF4SRnG+fgXB4pWRXqOpdJP3K2msY3FbA6Zjd0BJKchvTR0SFFW sL83IQEASME0X6cC9V8LS1dNA00qgVDT2JbMeOOCPbVO580Ziqe3UqfuhU6bRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvlRb6w5Tz20x; Tue, 19 Dec 2023 18:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJIMpGh016102; Tue, 19 Dec 2023 18:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJIMpGa016099; Tue, 19 Dec 2023 18:22:51 GMT (envelope-from git) Date: Tue, 19 Dec 2023 18:22:51 GMT Message-Id: <202312191822.3BJIMpGa016099@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: 175d4d69887f - main - tcp_hpts: use tcp_pace.cts_last_ran for last ran 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 175d4d69887fb103f0b0385cbbafec0432284ff3 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=175d4d69887fb103f0b0385cbbafec0432284ff3 commit 175d4d69887fb103f0b0385cbbafec0432284ff3 Author: Gleb Smirnoff AuthorDate: 2023-12-19 18:21:56 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-19 18:21:56 +0000 tcp_hpts: use tcp_pace.cts_last_ran for last ran table Remove the global cts_last_ran and use already existing unused field of struct tcp_hptsi, which seems originally planned to hold this table. This makes it consistent with other malloc-ed tables, like main array of HPTS entities and CPU groups. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43091 --- sys/netinet/tcp_hpts.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index f1b729c249c6..50a30a2cff03 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -236,7 +236,6 @@ static int tcp_bind_threads = 1; static int tcp_bind_threads = 2; #endif static int tcp_use_irq_cpu = 0; -static uint32_t *cts_last_ran; static int hpts_does_tp_logging = 0; static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout); @@ -1098,7 +1097,7 @@ tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout) hpts->p_lasttick = hpts->p_curtick; hpts->p_curtick = tcp_gethptstick(&tv); - cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); orig_exit_slot = hpts->p_cur_slot = tick_to_wheel(hpts->p_curtick); if ((hpts->p_on_queue_cnt == 0) || (hpts->p_lasttick == hpts->p_curtick)) { @@ -1441,7 +1440,7 @@ no_one: goto again; } no_run: - cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[hpts->p_num] = tcp_tv_to_usectick(&tv); /* * Set flag to tell that we are done for * any slot input that happens during @@ -1523,8 +1522,8 @@ tcp_choose_hpts_to_run(void) } oldest_idx = -1; for (i = start; i < end; i++) { - if (TSTMP_GT(cts, cts_last_ran[i])) - calc = cts - cts_last_ran[i]; + if (TSTMP_GT(cts, tcp_pace.cts_last_ran[i])) + calc = cts - tcp_pace.cts_last_ran[i]; else calc = 0; if (calc > time_since_ran) { @@ -1830,7 +1829,7 @@ tcp_init_hptsi(void *st) sz = (tcp_pace.rp_num_hptss * sizeof(struct tcp_hpts_entry *)); tcp_pace.rp_ent = malloc(sz, M_TCPHPTS, M_WAITOK | M_ZERO); sz = (sizeof(uint32_t) * tcp_pace.rp_num_hptss); - cts_last_ran = malloc(sz, M_TCPHPTS, M_WAITOK); + tcp_pace.cts_last_ran = malloc(sz, M_TCPHPTS, M_WAITOK); tcp_pace.grp_cnt = 0; if (cpu_top == NULL) { tcp_pace.grp_cnt = 1; @@ -1916,7 +1915,7 @@ tcp_init_hptsi(void *st) SYSCTL_ADD_UINT(&hpts->hpts_ctx, SYSCTL_CHILDREN(hpts->hpts_root), OID_AUTO, "lastran", CTLFLAG_RD, - &cts_last_ran[i], 0, + &tcp_pace.cts_last_ran[i], 0, "The last usec tick that this hpts ran"); SYSCTL_ADD_LONG(&hpts->hpts_ctx, SYSCTL_CHILDREN(hpts->hpts_root), @@ -1937,7 +1936,7 @@ tcp_init_hptsi(void *st) hpts->p_hpts_sleep_time = hpts_sleep_max; hpts->p_num = i; hpts->p_curtick = tcp_gethptstick(&tv); - cts_last_ran[i] = tcp_tv_to_usectick(&tv); + tcp_pace.cts_last_ran[i] = tcp_tv_to_usectick(&tv); hpts->p_prev_slot = hpts->p_cur_slot = tick_to_wheel(hpts->p_curtick); hpts->p_cpu = 0xffff; hpts->p_nxt_slot = hpts_slot(hpts->p_cur_slot, 1); From nobody Tue Dec 19 18:22:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvlRf0vbjz54gsG; Tue, 19 Dec 2023 18:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvlRd3Yf3z4Rf0; Tue, 19 Dec 2023 18:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703010173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NnVK9K5Ac5TwXNsbOIsFCLQp1b3qL36VMGw93OqVYwo=; b=yeMvs+aW7D3w8eyxjBOQWxIq4B7dwOU8F5j99Un3aGcbfpbOlPuYujKJjcp6lw2OCcCjy1 xGiMI6jITpMW1BBtQBbofqVEgfOOdut74i0a4tpNbXcbG42NEkJa2077AWTH+DqWmQ+sJ6 WwmtZfbNOQdmc2bh998VFmoJh9qJRgs6fOgtwfDGV0DVrQMOh9B4m9bYwHvHuHtpFHj+KU ixvomQ8b6djyxVu19mD2hDrA0KVaZwHC1FYsCb7eDuFy6FKFpH3EbFw+43WY2kKDCdQELA PHx0h/KU2zzSqGyoDf7R5UPcWxe4+1vd7AXMGrvsuGRwwalLn22eoGKdbgV9zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703010173; a=rsa-sha256; cv=none; b=QF4uuicTuz2tfYBgmXrxcoBuNBjfdgiJIStjnYAh2IuaVaJU5RaeK3hr6hNydAb12Hdv+7 txaa5EcNh0LsM5oM/T08cwH7ECMI6I4JSJqtcnfUcCvxd/Mm11aNFg4WqKtNOggKuCCZBz 9FWjhZVo89BFhX/R6DebtNrmluocbnwNK5hCMoPv8/Rc+CX1rRqNZax/QGau0i8RHywIY0 2eckwgljql0TCJlVQdrdOhOThM+Yzt6BPOQtJOXr/WBGeMSGhW7HBQN3yVqlBvoBh7+Wh1 3IfhTOqMauLfLlUrLS7d8fi4nLfMUvyjqGi61CQz+S2i6pYbZ2hs1lHIz62d9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703010173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NnVK9K5Ac5TwXNsbOIsFCLQp1b3qL36VMGw93OqVYwo=; b=fr60PnJ6KaThc3Z5UD+mtoMjFvfjvg+Z577JnwaUTy00ZmyVuTTZtzR3jnGV5cmXewQeWu UmMDtelJiQkjUJ5UDu8FXyAXSqhnmjAam3B6Ard+RpehIUwusvZWAwV2RAS2CDfU+9xESv 9zWXlsyofR4riGvtS2IpJtGs6aWVLQxQmcQvDnecM1k70TeHhGNTFM6G1+RXQteHjN8XKz 0ADHwEjmE8Ntwp8gmVV1Cz4th5Q3PKi5jSeytqIorQ8BUcb+7zz5zGIrRy+5JGE8k4/2o1 0sZuC+idJra2IKx++l2uiqLl66dUZBw6NdG3k7dJyNhrisUR4JVgT0QrsH/ZwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvlRd0wqTz1RM; Tue, 19 Dec 2023 18:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJIMqqf016145; Tue, 19 Dec 2023 18:22:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJIMqbo016142; Tue, 19 Dec 2023 18:22:52 GMT (envelope-from git) Date: Tue, 19 Dec 2023 18:22:52 GMT Message-Id: <202312191822.3BJIMqbo016142@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: 48b55a7c7be4 - main - tcp_hpts: make the module unloadable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 48b55a7c7be4175998f9b26dfbec5a561acbd936 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=48b55a7c7be4175998f9b26dfbec5a561acbd936 commit 48b55a7c7be4175998f9b26dfbec5a561acbd936 Author: Gleb Smirnoff AuthorDate: 2023-12-19 18:21:56 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-19 18:21:56 +0000 tcp_hpts: make the module unloadable Although the HPTS subsytem wasn't initially designed as a loadable module, now it is so. Make it possible to also unload it, but for safety reasons hide that under 'kldunload -f'. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43092 --- sys/netinet/tcp_hpts.c | 82 ++++++++++++++++++++++++++++++++++++++++++---- sys/netinet/tcp_hpts.h | 1 + sys/netinet/tcp_lro_hpts.c | 6 ++++ 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 50a30a2cff03..a6fa79a26949 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -229,7 +229,7 @@ static struct tcp_hptsi { uint32_t rp_num_hptss; /* Number of hpts threads */ } tcp_pace; -MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); +static MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); #ifdef RSS static int tcp_bind_threads = 1; #else @@ -240,7 +240,6 @@ static int hpts_does_tp_logging = 0; static int32_t tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout); static void tcp_hpts_thread(void *ctx); -static void tcp_init_hptsi(void *st); int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; static int conn_cnt_thresh = DEFAULT_CONNECTION_THESHOLD; @@ -1794,7 +1793,7 @@ hpts_gather_grps(struct cpu_group **grps, int32_t *at, int32_t max, struct cpu_g } static void -tcp_init_hptsi(void *st) +tcp_hpts_mod_load(void) { struct cpu_group *cpu_top; int32_t error __diagused; @@ -2005,10 +2004,81 @@ tcp_init_hptsi(void *st) printf("TCP Hpts created %d swi interrupt threads and bound %d to %s\n", created, bound, tcp_bind_threads == 2 ? "NUMA domains" : "cpus"); -#ifdef INVARIANTS - printf("HPTS is in INVARIANT mode!!\n"); +} + +static void +tcp_hpts_mod_unload(void) +{ + int rv __diagused; + + tcp_lro_hpts_uninit(); + atomic_store_ptr(&tcp_hpts_softclock, NULL); + + for (int i = 0; i < tcp_pace.rp_num_hptss; i++) { + struct tcp_hpts_entry *hpts = tcp_pace.rp_ent[i]; + + rv = callout_drain(&hpts->co); + MPASS(rv != 0); + + rv = swi_remove(hpts->ie_cookie); + MPASS(rv == 0); + + rv = sysctl_ctx_free(&hpts->hpts_ctx); + MPASS(rv == 0); + + mtx_destroy(&hpts->p_mtx); + free(hpts->p_hptss, M_TCPHPTS); + free(hpts, M_TCPHPTS); + } + + free(tcp_pace.rp_ent, M_TCPHPTS); + free(tcp_pace.cts_last_ran, M_TCPHPTS); +#ifdef SMP + free(tcp_pace.grps, M_TCPHPTS); #endif + + counter_u64_free(hpts_hopelessly_behind); + counter_u64_free(hpts_loops); + counter_u64_free(back_tosleep); + counter_u64_free(combined_wheel_wrap); + counter_u64_free(wheel_wrap); + counter_u64_free(hpts_wake_timeout); + counter_u64_free(hpts_direct_awakening); + counter_u64_free(hpts_back_tosleep); + counter_u64_free(hpts_direct_call); + counter_u64_free(cpu_uses_flowid); + counter_u64_free(cpu_uses_random); +} + +static int +tcp_hpts_modevent(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + tcp_hpts_mod_load(); + return (0); + case MOD_QUIESCE: + /* + * Since we are a dependency of TCP stack modules, they should + * already be unloaded, and the HPTS ring is empty. However, + * function pointer manipulations aren't 100% safe. Although, + * tcp_hpts_mod_unload() use atomic(9) the userret() doesn't. + * Thus, allow only forced unload of HPTS. + */ + return (EBUSY); + case MOD_UNLOAD: + tcp_hpts_mod_unload(); + return (0); + default: + return (EINVAL); + }; } -SYSINIT(tcphptsi, SI_SUB_SOFTINTR, SI_ORDER_ANY, tcp_init_hptsi, NULL); +static moduledata_t tcp_hpts_module = { + .name = "tcphpts", + .evhand = tcp_hpts_modevent, +}; + +DECLARE_MODULE(tcphpts, tcp_hpts_module, SI_SUB_SOFTINTR, SI_ORDER_ANY); MODULE_VERSION(tcphpts, 1); diff --git a/sys/netinet/tcp_hpts.h b/sys/netinet/tcp_hpts.h index 7eb1b2e08cb4..0c5cfac28a6c 100644 --- a/sys/netinet/tcp_hpts.h +++ b/sys/netinet/tcp_hpts.h @@ -153,6 +153,7 @@ void __tcp_set_hpts(struct tcpcb *tp, int32_t line); void tcp_set_inp_to_drop(struct inpcb *inp, uint16_t reason); void tcp_lro_hpts_init(void); +void tcp_lro_hpts_uninit(void); extern int32_t tcp_min_hptsi_time; diff --git a/sys/netinet/tcp_lro_hpts.c b/sys/netinet/tcp_lro_hpts.c index 769c82a32391..7724e727d5ce 100644 --- a/sys/netinet/tcp_lro_hpts.c +++ b/sys/netinet/tcp_lro_hpts.c @@ -584,3 +584,9 @@ tcp_lro_hpts_init(void) { tcp_lro_flush_tcphpts = _tcp_lro_flush_tcphpts; } + +void +tcp_lro_hpts_uninit(void) +{ + atomic_store_ptr(&tcp_lro_flush_tcphpts, NULL); +} From nobody Tue Dec 19 18:28:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvlZW6Rzvz54hPJ; Tue, 19 Dec 2023 18:28:51 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4SvlZV6wXMz4Z02; Tue, 19 Dec 2023 18:28:50 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id 3A0F35533D; Tue, 19 Dec 2023 10:28:50 -0800 (PST) Date: Tue, 19 Dec 2023 10:28:50 -0800 From: Gleb Smirnoff To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 0fbec53dcfb8 - stable/13 - sshd: do not resolve refused client hostname Message-ID: References: <202312181736.3BIHaHF6021789@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202312181736.3BIHaHF6021789@gitrepo.freebsd.org> X-Spamd-Result: default: False [2.31 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_SHORT(0.71)[0.714]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; ONCE_RECEIVED(0.10)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-branches@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; R_DKIM_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4SvlZV6wXMz4Z02 X-Spamd-Bar: ++ Ed, On Mon, Dec 18, 2023 at 05:36:17PM +0000, Ed Maste wrote: E> The branch stable/13 has been updated by emaste: E> E> URL: https://cgit.FreeBSD.org/src/commit/?id=0fbec53dcfb8d31aa2e3734992e241422e152433 E> E> commit 0fbec53dcfb8d31aa2e3734992e241422e152433 E> Author: Gleb Smirnoff E> AuthorDate: 2023-07-20 21:56:20 +0000 E> Commit: Ed Maste E> CommitDate: 2023-12-18 17:35:47 +0000 E> E> sshd: do not resolve refused client hostname E> E> This is a compromise between POLA and practical reasoning. We don't E> want to block the main server loop in an attempt to resolve. But we E> need to keep the format of the logged message as is, for sake of E> sshguard and other scripts. So let's print just the IP address twice, E> this is what libwrap's refuse() would do if it failed to resolve. E> E> Reviewed by: philip E> PR: 269456 E> Differential revision: https://reviews.freebsd.org/D40069 E> E> (cherry picked from commit 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225) You probably also want to merge 1d9722de6f90c3edf286b077938bfa696e728d6c -- Gleb Smirnoff From nobody Tue Dec 19 19:24:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvmqC6pZlz54msd; Tue, 19 Dec 2023 19:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvmqC6559z3MGZ; Tue, 19 Dec 2023 19:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703013895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3Vw3nE4xIFotocGZq8mnf5qQ1pXbu6Tul9hsqw7+XI=; b=Fk1Ho5iWIC4GcuanunhuT6L5wH4JLI/Jwyq1nESESpVm465IdwUPG4AUN6ITF853hrz7Lx Vl2iYf3+plDQDcKE6QwHOnfo1E2Dfq7XHczqmZS4AaGEltkW750ZzK989gypN/gu3h5PvW Oqp+UJrjiAWr8mSUa2BT+BDNSoK4kmb2Fe5O8JyoHWWQDSQrACfIgsQSChwMn4gloriAFH 8cVEsE/ZyC9OomByeCZQESXcbsQ8z2uhkOHoMOA+pjhZTj0xR1N0TxVxgmuxohMRg0jc/q lCE3LPIQDzOor0EUPW+LvIXSYN4h6HoHCOhsfNfDkLq1Q0GonZUpmktdZGmR3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703013895; a=rsa-sha256; cv=none; b=Z1DRSAg3UvoM4FdOTDwfoXth9lowyIPQs4i8WVYXzeMtWnzuLw/RQ+gNpq4J4FejV64VeP CSz6Z2qsMPR5kbGy2AnPyIZtDFInCTnRHyX6kSZHGKwk4wDCUsXAgtNxgtN9oAscf8ws8G W8v0znb1F3yMIc8M4sKX+FQo9jXzHLgTiBgMRrNOncsNUSlqeVpse3lE2wLUgimCcz+N6U IlwPKq96UxGkNo9NGxyw3inV3jJVS5ok/D5W2/zpu5QgP84CfGErughw02ZBIHsljuu0HY oNlpkEpkkTf0nLLa79N/ohbUKROoGtjx8gFbbW94PPyxSsS7Jq4cEmiU+Zo4FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703013895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U3Vw3nE4xIFotocGZq8mnf5qQ1pXbu6Tul9hsqw7+XI=; b=NQQVJNHR2ew9n/Dslq8TIy2b3VcKJ1ubGZPAx7Mm4JLOW+RkPYTSsfpbR9n1wXOdzfe5Dh 5HS87Bf8b5XMdU/I7TchBxqVW7v3dK+odHdcx00bx76Q7A6NcdWDE3oLPAougEsj8AYNMZ BYn7x1gd3W4YXPbw1cxmnLrbSMDA5ZvCFcMlvggrpFJsCCx55sMPXXV792vUumI2Y98NV6 V+ssEzMo49axzU7K6R/+DTeorlytwc+gjjqjHbOoindhtydkt0DqTBcvxafqwDFBTeVxBn lbtJixW7osFfKUSklt/r1AXNKpe3NdzHYWphH/hfb3ZwntaBY1orHDhgJgrXEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvmqC4kL0z3TW; Tue, 19 Dec 2023 19:24:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJJOtFn016385; Tue, 19 Dec 2023 19:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJJOtOQ016382; Tue, 19 Dec 2023 19:24:55 GMT (envelope-from git) Date: Tue, 19 Dec 2023 19:24:55 GMT Message-Id: <202312191924.3BJJOtOQ016382@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: 513f2e2e7180 - main - tcp: always set tcp_tun_port to a correct value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 513f2e2e7180202167ca2963d815d2a4c3ac0af9 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=513f2e2e7180202167ca2963d815d2a4c3ac0af9 commit 513f2e2e7180202167ca2963d815d2a4c3ac0af9 Author: Gleb Smirnoff AuthorDate: 2023-12-19 19:24:17 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-19 19:24:17 +0000 tcp: always set tcp_tun_port to a correct value The tcp_tun_port field that is used to pass port value between UDP and TCP in case of tunneling is a generic field that used to pass data between network layers. It can be contaminated on entry, e.g. by a VLAN tag set by a NIC driver. Explicily set it, so that it is zeroed out in a normal not-tunneled TCP. If it contains garbage, tcp_twcheck() later can enter wrong block of code and treat the packet as incorrectly tunneled one. On main and stable/14 that will end up with sending incorrect responses, but on stable/13 with ipfw(8) and pcb-matching rules it may end up in a panic. This is a minimal conservative patch to be merged to stable branches. Later we may redesign this. PR: 275169 Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D43065 --- sys/netinet/tcp_input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 05f9a4a9726a..ab8fc4b4a3e4 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -633,6 +633,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) to.to_flags = 0; TCPSTAT_INC(tcps_rcvtotal); + m->m_pkthdr.tcp_tun_port = port; #ifdef INET6 if (isipv6) { ip6 = mtod(m, struct ip6_hdr *); From nobody Tue Dec 19 20:19:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svp2Y0YBcz54ryN; Tue, 19 Dec 2023 20:19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svp2X6zXZz4GJp; Tue, 19 Dec 2023 20:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RTBvG7CesJ6Ct6Up65yDWT4oZ7nb9TQgodyq1YmFAPU=; b=YwtJTcOlP8tLEkB/CRVhEPHowuaxhm8mBkjT9dPf4N4Oh2MjuMMDa4/BxXsmgtMwVVvNpK FQCRVAGuxVS8oGeP8tTHOrCbcSqPfYeS1nC2r9xaOBE3S1kyQYFGcMgV3uvTAWXs/xlKK/ I3+fu8WgDwmSBPvxFBp6I4KppT+qrfsx9X00LLb9BGzJfMU7bSh0Q4OPeIo7gfszFiGG7/ JYNEdDPEtHC5mNaoXFvMGW/nvcErqU+jjUaSWtc8tqWmgvUhiLjIdquf57C/+JQkJouhGW khX9hws1NAHrHrZWU4MCtX3HzZ96FSUehWTlVM8j9lCuNM2DTEoogqWy44PGKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017189; a=rsa-sha256; cv=none; b=XppIaflhF2sNu5ss9JgSwqdK1rgmlIWJrTZhCK3O0h6VuHMkPZ3SfG0UQncjEERJRJ1AO6 U5NRGTNP6O5WxsaI2jdbrLdVh3RopDMn0Uzl3Vsb7dKCY4j/HzTwTrbTsmbuPelkF9n3J5 vOgoIBIjAEUtp2GKjmDjv7c8saIMkAw0T/k5n9mcQMztzzZ82yqEZ0rtBN9nPdNlcWtSbG pK13n7uv6/Gc5OCYM3twiKLy07gqXzJto+i7m1ZoP6y+KrHtpKZy79J+L3NFNSLNc2Y8FW AzLhsPZ4WNaNUc4LhoXWhm9aR9mrxPfbMi+VRtU9df4sCH+r7K4gQQTjVu3dNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RTBvG7CesJ6Ct6Up65yDWT4oZ7nb9TQgodyq1YmFAPU=; b=UjkkMFFkesPp9b+9/gdDbLquOZVMwuSje2/BtuawXVBadf2GZP86TFSyWgJflWHX7cHwKL PtVw6zUBdCGENGGOL/HV3dZf17dUBFxyds8A512vjaqSZwmcOumP0lPmo+VB0j37UK0KbQ IqmnnNhUhelmhuNZJ3kBmPh/IxtkErT/8a2rIoC3n9MJng3daBFt4jBkYpQ2DIbuyxcpDT IT13IQWDbXZuhWFpfAZy/BEGBfLfG6IwFPhBEox8MSqt3sna54Q6va2Us3V3mzg3cO9ST/ jOx4Oc1z5wrLSms2lh7bFI7pYB5wHjLeWyQrBmCqfZDW3E1RkdIGYsXzSuTAmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svp2X5cHhz4ND; Tue, 19 Dec 2023 20:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKJmXR001010; Tue, 19 Dec 2023 20:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKJmNj001007; Tue, 19 Dec 2023 20:19:48 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:19:48 GMT Message-Id: <202312192019.3BJKJmNj001007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: b9856d61e99d - releng/14.0 - Implement "strict key exchange" in ssh and sshd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: b9856d61e99d62e302e2e6a420257dcfea18b353 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=b9856d61e99d62e302e2e6a420257dcfea18b353 commit b9856d61e99d62e302e2e6a420257dcfea18b353 Author: Gordon Tetlow AuthorDate: 2023-12-18 16:22:22 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-19 20:15:15 +0000 Implement "strict key exchange" in ssh and sshd. This adds a protocol extension to improve the integrity of the SSH transport protocol, particular in and around the initial key exchange (KEX) phase. Full details of the extension are in the PROTOCOL file. OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 Approved by: so (implicit) Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Security: CVE-2023-48795 Security: FreeBSD-SA-23:19.openssh (cherry picked from commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4) (cherry picked from commit 673d1ead65c912ee3b52e507421d499b8104a810) --- crypto/openssh/PROTOCOL | 28 +++++++++++- crypto/openssh/kex.c | 82 ++++++++++++++++++++++------------ crypto/openssh/kex.h | 3 +- crypto/openssh/packet.c | 103 +++++++++++++++++++++++++------------------ crypto/openssh/packet.h | 3 +- crypto/openssh/sshconnect2.c | 10 +---- 6 files changed, 146 insertions(+), 83 deletions(-) diff --git a/crypto/openssh/PROTOCOL b/crypto/openssh/PROTOCOL index d453c779be92..ded935eb6752 100644 --- a/crypto/openssh/PROTOCOL +++ b/crypto/openssh/PROTOCOL @@ -137,6 +137,32 @@ than as a named global or channel request to allow pings with very short packet lengths, which would not be possible with other approaches. +1.9 transport: strict key exchange extension + +OpenSSH supports a number of transport-layer hardening measures under +a "strict KEX" feature. This feature is signalled similarly to the +RFC8308 ext-info feature: by including a additional algorithm in the +initiial SSH2_MSG_KEXINIT kex_algorithms field. The client may append +"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server +may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms +are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored +if they are present in subsequent SSH2_MSG_KEXINIT packets. + +When an endpoint that supports this extension observes this algorithm +name in a peer's KEXINIT packet, it MUST make the following changes to +the the protocol: + +a) During initial KEX, terminate the connection if any unexpected or + out-of-sequence packet is received. This includes terminating the + connection if the first packet received is not SSH2_MSG_KEXINIT. + Unexpected packets for the purpose of strict KEX include messages + that are otherwise valid at any time during the connection such as + SSH2_MSG_DEBUG and SSH2_MSG_IGNORE. +b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the + packet sequence number to zero. This behaviour persists for the + duration of the connection (i.e. not just the first + SSH2_MSG_NEWKEYS). + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" @@ -745,4 +771,4 @@ master instance and later clients. OpenSSH extends the usual agent protocol. These changes are documented in the PROTOCOL.agent file. -$OpenBSD: PROTOCOL,v 1.49 2023/08/28 03:28:43 djm Exp $ +$OpenBSD: PROTOCOL,v 1.50 2023/12/18 14:45:17 djm Exp $ diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index 8ff92f2a2d5e..2cb5ab3cf07c 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -65,7 +65,7 @@ #include "xmalloc.h" /* prototype */ -static int kex_choose_conf(struct ssh *); +static int kex_choose_conf(struct ssh *, uint32_t seq); static int kex_input_newkeys(int, u_int32_t, struct ssh *); static const char * const proposal_names[PROPOSAL_MAX] = { @@ -177,6 +177,18 @@ kex_names_valid(const char *names) return 1; } +/* returns non-zero if proposal contains any algorithm from algs */ +static int +has_any_alg(const char *proposal, const char *algs) +{ + char *cp; + + if ((cp = match_list(proposal, algs, NULL)) == NULL) + return 0; + free(cp); + return 1; +} + /* * Concatenate algorithm names, avoiding duplicates in the process. * Caller must free returned string. @@ -184,7 +196,7 @@ kex_names_valid(const char *names) char * kex_names_cat(const char *a, const char *b) { - char *ret = NULL, *tmp = NULL, *cp, *p, *m; + char *ret = NULL, *tmp = NULL, *cp, *p; size_t len; if (a == NULL || *a == '\0') @@ -201,10 +213,8 @@ kex_names_cat(const char *a, const char *b) } strlcpy(ret, a, len); for ((p = strsep(&cp, ",")); p && *p != '\0'; (p = strsep(&cp, ","))) { - if ((m = match_list(ret, p, NULL)) != NULL) { - free(m); + if (has_any_alg(ret, p)) continue; /* Algorithm already present */ - } if (strlcat(ret, ",", len) >= len || strlcat(ret, p, len) >= len) { free(tmp); @@ -334,15 +344,23 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], const char *defpropclient[PROPOSAL_MAX] = { KEX_CLIENT }; const char **defprop = ssh->kex->server ? defpropserver : defpropclient; u_int i; + char *cp; if (prop == NULL) fatal_f("proposal missing"); + /* Append EXT_INFO signalling to KexAlgorithms */ + if (kexalgos == NULL) + kexalgos = defprop[PROPOSAL_KEX_ALGS]; + if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? + "kex-strict-s-v00@openssh.com" : + "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL) + fatal_f("kex_names_cat"); + for (i = 0; i < PROPOSAL_MAX; i++) { switch(i) { case PROPOSAL_KEX_ALGS: - prop[i] = compat_kex_proposal(ssh, - kexalgos ? kexalgos : defprop[i]); + prop[i] = compat_kex_proposal(ssh, cp); break; case PROPOSAL_ENC_ALGS_CTOS: case PROPOSAL_ENC_ALGS_STOC: @@ -363,6 +381,7 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], prop[i] = xstrdup(defprop[i]); } } + free(cp); } void @@ -466,7 +485,12 @@ kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) { int r; - error("kex protocol error: type %d seq %u", type, seq); + /* If in strict mode, any unexpected message is an error */ + if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { + ssh_packet_disconnect(ssh, "strict KEX violation: " + "unexpected packet type %u (seqnr %u)", type, seq); + } + error_f("type %u seq %u", type, seq); if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -563,7 +587,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) if (ninfo >= 1024) { error("SSH2_MSG_EXT_INFO with too many entries, expected " "<=1024, received %u", ninfo); - return SSH_ERR_INVALID_FORMAT; + return dispatch_protocol_error(type, seq, ssh); } for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0) @@ -681,7 +705,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) error_f("no kex"); return SSH_ERR_INTERNAL_ERROR; } - ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); + ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_protocol_error); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; @@ -717,7 +741,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) if (!(kex->flags & KEX_INIT_SENT)) if ((r = kex_send_kexinit(ssh)) != 0) return r; - if ((r = kex_choose_conf(ssh)) != 0) + if ((r = kex_choose_conf(ssh, seq)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL) @@ -981,20 +1005,14 @@ proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX]) return (1); } -/* returns non-zero if proposal contains any algorithm from algs */ static int -has_any_alg(const char *proposal, const char *algs) +kexalgs_contains(char **peer, const char *ext) { - char *cp; - - if ((cp = match_list(proposal, algs, NULL)) == NULL) - return 0; - free(cp); - return 1; + return has_any_alg(peer[PROPOSAL_KEX_ALGS], ext); } static int -kex_choose_conf(struct ssh *ssh) +kex_choose_conf(struct ssh *ssh, uint32_t seq) { struct kex *kex = ssh->kex; struct newkeys *newkeys; @@ -1019,13 +1037,23 @@ kex_choose_conf(struct ssh *ssh) sprop=peer; } - /* Check whether client supports ext_info_c */ - if (kex->server && (kex->flags & KEX_INITIAL)) { - char *ext; - - ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); - kex->ext_info_c = (ext != NULL); - free(ext); + /* Check whether peer supports ext_info/kex_strict */ + if ((kex->flags & KEX_INITIAL) != 0) { + if (kex->server) { + kex->ext_info_c = kexalgs_contains(peer, "ext-info-c"); + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-c-v00@openssh.com"); + } else { + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-s-v00@openssh.com"); + } + if (kex->kex_strict) { + debug3_f("will use strict KEX ordering"); + if (seq != 0) + ssh_packet_disconnect(ssh, + "strict KEX violation: " + "KEXINIT was not the first packet"); + } } /* Check whether client supports rsa-sha2 algorithms */ diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h index 5f7ef784eec9..272ebb43d79d 100644 --- a/crypto/openssh/kex.h +++ b/crypto/openssh/kex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: kex.h,v 1.119 2023/08/28 03:28:43 djm Exp $ */ +/* $OpenBSD: kex.h,v 1.120 2023/12/18 14:45:17 djm Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -149,6 +149,7 @@ struct kex { u_int kex_type; char *server_sig_algs; int ext_info_c; + int kex_strict; struct sshbuf *my; struct sshbuf *peer; struct sshbuf *client_version; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index d69b903c844c..2d1401e7c9f5 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.312 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.313 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1208,8 +1208,13 @@ ssh_packet_send2_wrapped(struct ssh *ssh) sshbuf_dump(state->output, stderr); #endif /* increment sequence number for outgoing packets */ - if (++state->p_send.seqnr == 0) + if (++state->p_send.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "outgoing sequence number " + "wrapped during initial key exchange"); + } logit("outgoing seqnr wraps around"); + } if (++state->p_send.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1217,6 +1222,11 @@ ssh_packet_send2_wrapped(struct ssh *ssh) state->p_send.bytes += len; sshbuf_reset(state->outgoing_packet); + if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting send seqnr %u", state->p_send.seqnr); + state->p_send.seqnr = 0; + } + if (type == SSH2_MSG_NEWKEYS) r = ssh_set_newkeys(ssh, MODE_OUT); else if (type == SSH2_MSG_USERAUTH_SUCCESS && state->server_side) @@ -1345,8 +1355,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) /* Stay in the loop until we have received a complete packet. */ for (;;) { /* Try to read a packet from the buffer. */ - r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p); - if (r != 0) + if ((r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p)) != 0) break; /* If we got a packet, return it. */ if (*typep != SSH_MSG_NONE) @@ -1417,29 +1426,6 @@ ssh_packet_read(struct ssh *ssh) return type; } -/* - * Waits until a packet has been received, verifies that its type matches - * that given, and gives a fatal error and exits if there is a mismatch. - */ - -int -ssh_packet_read_expect(struct ssh *ssh, u_int expected_type) -{ - int r; - u_char type; - - if ((r = ssh_packet_read_seqnr(ssh, &type, NULL)) != 0) - return r; - if (type != expected_type) { - if ((r = sshpkt_disconnect(ssh, - "Protocol error: expected packet type %d, got %d", - expected_type, type)) != 0) - return r; - return SSH_ERR_PROTOCOL_ERROR; - } - return 0; -} - static int ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { @@ -1630,10 +1616,16 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshbuf_consume(state->input, mac->mac_len)) != 0) goto out; } + if (seqnr_p != NULL) *seqnr_p = state->p_read.seqnr; - if (++state->p_read.seqnr == 0) + if (++state->p_read.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "incoming sequence number " + "wrapped during initial key exchange"); + } logit("incoming seqnr wraps around"); + } if (++state->p_read.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1699,6 +1691,10 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) #endif /* reset for next packet */ state->packlen = 0; + if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting read seqnr %u", state->p_read.seqnr); + state->p_read.seqnr = 0; + } if ((r = ssh_packet_check_rekey(ssh)) != 0) return r; @@ -1721,10 +1717,39 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; - if (*typep) { - state->keep_alive_timeouts = 0; - DBG(debug("received packet type %d", *typep)); + if (*typep == 0) { + /* no message ready */ + return 0; } + state->keep_alive_timeouts = 0; + DBG(debug("received packet type %d", *typep)); + + /* Always process disconnect messages */ + if (*typep == SSH2_MSG_DISCONNECT) { + if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || + (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) + return r; + /* Ignore normal client exit notifications */ + do_log2(ssh->state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s port %d:" + "%u: %.400s", ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), reason, msg); + free(msg); + return SSH_ERR_DISCONNECTED; + } + + /* + * Do not implicitly handle any messages here during initial + * KEX when in strict mode. They will be need to be allowed + * explicitly by the KEX dispatch table or they will generate + * protocol errors. + */ + if (ssh->kex != NULL && + (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) + return 0; + /* Implicitly handle transport-level messages */ switch (*typep) { case SSH2_MSG_IGNORE: debug3("Received SSH2_MSG_IGNORE"); @@ -1739,19 +1764,6 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) debug("Remote: %.900s", msg); free(msg); break; - case SSH2_MSG_DISCONNECT: - if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || - (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) - return r; - /* Ignore normal client exit notifications */ - do_log2(ssh->state->server_side && - reason == SSH2_DISCONNECT_BY_APPLICATION ? - SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, - "Received disconnect from %s port %d:" - "%u: %.400s", ssh_remote_ipaddr(ssh), - ssh_remote_port(ssh), reason, msg); - free(msg); - return SSH_ERR_DISCONNECTED; case SSH2_MSG_UNIMPLEMENTED: if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0) return r; @@ -2244,6 +2256,7 @@ kex_to_blob(struct sshbuf *m, struct kex *kex) (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || + (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || @@ -2406,6 +2419,7 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp) (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || + (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 || (r = sshbuf_get_stringb(m, kex->my)) != 0 || (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || @@ -2734,6 +2748,7 @@ sshpkt_disconnect(struct ssh *ssh, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); + debug2_f("sending SSH2_MSG_DISCONNECT: %s", buf); if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 || (r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h index 11925a27d438..b2bc3215ddbc 100644 --- a/crypto/openssh/packet.h +++ b/crypto/openssh/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.95 2023/08/28 03:31:16 djm Exp $ */ +/* $OpenBSD: packet.h,v 1.96 2023/12/18 14:45:17 djm Exp $ */ /* * Author: Tatu Ylonen @@ -124,7 +124,6 @@ int ssh_packet_send2_wrapped(struct ssh *); int ssh_packet_send2(struct ssh *); int ssh_packet_read(struct ssh *); -int ssh_packet_read_expect(struct ssh *, u_int type); int ssh_packet_read_poll(struct ssh *); int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p); int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len); diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index 90cbba6821e9..6401e304a977 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -358,7 +358,6 @@ struct cauthmethod { }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); -static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -472,7 +471,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -523,12 +522,6 @@ input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) return r; } -static int -input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) -{ - return kex_input_ext_info(type, seqnr, ssh); -} - void userauth(struct ssh *ssh, char *authlist) { @@ -607,6 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } From nobody Tue Dec 19 20:19:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svp2Z1LMZz54s1g; Tue, 19 Dec 2023 20:19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svp2Y6tq9z4GRD; Tue, 19 Dec 2023 20:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/83oZWmNaMc/ZZOj6x2QHufjynoWUDorkleUWOhj8A=; b=OWm8gHw5AbxtQzoGeBcqGiY0ApZOx+tHaxSYI2TfKvdiXeAJkFZmASe01L7nxlxBy/Ly8x R0J7U8mwTKdZSHMzGPERzHaSVDJS54xcbRq9wfTWMut8ygwUNBZfMRHzo379WewX4jUfjd iYjQ4pIgURs222cPn9R+aCfJxWXJGoIdocySzUq3ZywylGta2Os3noHShkV3Kwize4QMBC G3o3V/F9naAKSIShsYRmia6XMp6LS8T+AYibl719VhrV8IcvgptdFVdTZCI+SmVsO2MCeT xjOum0PVMCfLsdmmpRv8QJ09RRoUA8Fs4mKedmCoGgGYxazyDpgbL+aqJEM3LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017190; a=rsa-sha256; cv=none; b=cKgzVqYYI3GszvnFfT/5Uqu40CD+XXB+8nCLcXGIdqr9DFmE9tHyiql/9eqYKWrPLQV5tg +L7JEd2rS+XnGO6DemQjnVzG4jVuanly6YxqnerczrhHCyOF6U56uINvnUQBp4EqEu5TE5 TN6UIUXtoI824SjABWCFNT3/2ZwQNiiZZZh8FGc8m7L5wtLYOvicoq++JVQU17DoC75j8t UQ0GLb1L7l9W4avG7tW1r7z4m5s1w8GQ9V3UJS/mX+LDNL0dqDB4VlikmQHCoqNha1MfAv YVO5GyZQK927wqaoqGnASh9NF/AgUp7mCmN2lI/CfhMpl+fgpdJghb8lhJRVOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k/83oZWmNaMc/ZZOj6x2QHufjynoWUDorkleUWOhj8A=; b=KbrMh8JNoEOLJvNncc7PBhE61VevPgZH1XiElBvm2+cbF/PN5Ujm8fZg8GPkCToN8zz/nF vX9Yy8mb2BmbGBtDdZWHsFC1hFaDKCfB++Yv6Fsgmra9ILy3A0cNOLzBu3LcIiyWUzmLM4 C+dT8st2Db/SCad7p8W+ZEQYZzPBX8APCI/f9XmpugBGUdM+fR6KRfGKu/10lNvGZD3xvh G90wrDwLe75MwWAsw0M1Iw/msZwZkLikZU6vWg8y438hHdQh+wwWXS1hrWQ9yMBDDUUbG5 7bnQpI6BAmboMDzxVLi6Hc5hPEN+B5KvzQoWOlKjkYmmmrilVIT09K7wbCtVIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svp2Y61G9z4M8; Tue, 19 Dec 2023 20:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKJn7N001066; Tue, 19 Dec 2023 20:19:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKJnjL001063; Tue, 19 Dec 2023 20:19:49 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:19:49 GMT Message-Id: <202312192019.3BJKJnjL001063@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 4edf3b80733e - releng/14.0 - Add an UPDATING entry and bump the branch version. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 4edf3b80733ecf34d05111a6cf0af9295ffbebe7 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=4edf3b80733ecf34d05111a6cf0af9295ffbebe7 commit 4edf3b80733ecf34d05111a6cf0af9295ffbebe7 Author: Gordon Tetlow AuthorDate: 2023-12-19 20:16:52 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-19 20:19:24 +0000 Add an UPDATING entry and bump the branch version. Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 673957975366..30a245edf611 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. +20231219: + 14.0-RELEASE-p4 SA-23:19.openssh + + Prefix Truncation Attack in the SSH protocol [SA-23:19.openssh] + 20231212: 14.0-RELEASE-p3 SA-23:18.nfsclient diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index c1d998125dfe..4565e444ae39 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="14.0" -BRANCH="RELEASE-p3" +BRANCH="RELEASE-p4" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 19 20:19:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svp2j5WgTz54rsP; Tue, 19 Dec 2023 20:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svp2j1ttKz4GkH; Tue, 19 Dec 2023 20:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XObSG4sXGViE4izjPa5QTyv2LpAihvSaag6mq8XhxEA=; b=F/F9mwWwqtLdDSnoFvAZ49z8g1OQdGCvw8QS0gXqlkDpd9pl5V+PtQxkiwW8H40ONPUApl Py+Ce7g1iBlOmEApn+dtD4VDOoOhASXkbJ9xzzd0IMrXgLXrXCj74WXixrU70J6JNDTqkL RxV+6vLX34qwZtQdLcbCEzyoFJC7aYT233h62J97w9kWkm3TWQ7+JfwT8x2uBqOE7MLELN xK1IdbohE0WYTOzFwCmt4FSYE4n01jDREVon97/cOyQgerhRY9Sb3kSzdmBFdDtpuoiCSO ovuW+iWloRa7gll2Sitr0H29XImq6GO4pAsTq3gp8Ie8fvFsG+5vYbP+GzHqug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017197; a=rsa-sha256; cv=none; b=xTeqG3FF6pwZhKVeoe/Nqvmz9g4feX24AyEcgQNpinVzTBWx+xIPOLciBZSnIqz89LbV6V HxO7EBDtt1y/TPjXagO0L4JMy/Lbpi+6uaHnzAxZKqxK0rsiBEiX8g9Y1RB2INlk2vMz3l kaw+VlKck6g5/2mRh+bEJnbD/9xqstVCLx9XFaY7p23/ZaNQJeS0gfTS5nDpDMetbsrtbM CMfAxPIUrdbek2pazAuKvGRs4KTdIx2RHwhfoYy9a2PGWmzIWV744gnI6Kp/NYmN9SSAuJ yiKqRWkD+t2UsobpbJWNU0J92YAvfviGpFfxyGtoSdgPDhp+mNysb1akFgngyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XObSG4sXGViE4izjPa5QTyv2LpAihvSaag6mq8XhxEA=; b=iFHDYnJrOuUWrNKo6yriQCXGGcy+p87lje1UyP9lKMbtEKGbW92a4aHI63nMW+D+yMTCoj CCn1IHSNDK90sp43x4LFay8TWqpcbPW7Kw1J8kDoBhWls71yzqrdhwpUOA/eZcnFEscbz8 KF3kcpxwTZ65iqB2+0S7tKACVv9tuIY71rzSowx5VZqmtQHMGedOK2+BMREHJKdXEe9hTT k3EXGPM9pNZ4XnUetoDx3RTlV/iJiVNRUg6ipZjQU3mpBlFhKjWVCgaHHoNgICogLIdQgE C/knzX3KLokCC38uKVqsH3cGFP8cl7vmFMH2BSGEEX1HolSNxuWQOpxLiWZDCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svp2j0dshz4M9; Tue, 19 Dec 2023 20:19:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKJvE2001231; Tue, 19 Dec 2023 20:19:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKJvgg001228; Tue, 19 Dec 2023 20:19:57 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:19:57 GMT Message-Id: <202312192019.3BJKJvgg001228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: 69bd68ba30c0 - releng/13.2 - Implement "strict key exchange" in ssh and sshd. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: 69bd68ba30c0fe0c863ec55726aa273ee0fe6c30 Auto-Submitted: auto-generated The branch releng/13.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=69bd68ba30c0fe0c863ec55726aa273ee0fe6c30 commit 69bd68ba30c0fe0c863ec55726aa273ee0fe6c30 Author: Gordon Tetlow AuthorDate: 2023-12-18 16:22:22 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-19 20:17:35 +0000 Implement "strict key exchange" in ssh and sshd. This adds a protocol extension to improve the integrity of the SSH transport protocol, particular in and around the initial key exchange (KEX) phase. Full details of the extension are in the PROTOCOL file. OpenBSD-Commit-ID: 2a66ac962f0a630d7945fee54004ed9e9c439f14 Approved by: so (implicit) Obtained from: https://anongit.mindrot.org/openssh.git/patch/?id=1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5 Security: CVE-2023-48795 Security: FreeBSD-SA-23:19.openssh (cherry picked from commit 92f58c69a14c0afe910145f177c0e8aeaf9c7da4) (cherry picked from commit 3bafcb9744c966ff7750357b24fc7942f2d928d4) --- crypto/openssh/PROTOCOL | 26 +++++++++++ crypto/openssh/kex.c | 82 +++++++++++++++++++++++------------ crypto/openssh/kex.h | 1 + crypto/openssh/packet.c | 101 +++++++++++++++++++++++++------------------ crypto/openssh/packet.h | 1 - crypto/openssh/sshconnect2.c | 10 +---- 6 files changed, 142 insertions(+), 79 deletions(-) diff --git a/crypto/openssh/PROTOCOL b/crypto/openssh/PROTOCOL index 27804d0cadbd..ad611a01a200 100644 --- a/crypto/openssh/PROTOCOL +++ b/crypto/openssh/PROTOCOL @@ -104,6 +104,32 @@ http://git.libssh.org/users/aris/libssh.git/plain/doc/curve25519-sha256@libssh.o This is identical to curve25519-sha256 as later published in RFC8731. +1.9 transport: strict key exchange extension + +OpenSSH supports a number of transport-layer hardening measures under +a "strict KEX" feature. This feature is signalled similarly to the +RFC8308 ext-info feature: by including a additional algorithm in the +initiial SSH2_MSG_KEXINIT kex_algorithms field. The client may append +"kex-strict-c-v00@openssh.com" to its kex_algorithms and the server +may append "kex-strict-s-v00@openssh.com". These pseudo-algorithms +are only valid in the initial SSH2_MSG_KEXINIT and MUST be ignored +if they are present in subsequent SSH2_MSG_KEXINIT packets. + +When an endpoint that supports this extension observes this algorithm +name in a peer's KEXINIT packet, it MUST make the following changes to +the the protocol: + +a) During initial KEX, terminate the connection if any unexpected or + out-of-sequence packet is received. This includes terminating the + connection if the first packet received is not SSH2_MSG_KEXINIT. + Unexpected packets for the purpose of strict KEX include messages + that are otherwise valid at any time during the connection such as + SSH2_MSG_DEBUG and SSH2_MSG_IGNORE. +b) After sending or receiving a SSH2_MSG_NEWKEYS message, reset the + packet sequence number to zero. This behaviour persists for the + duration of the connection (i.e. not just the first + SSH2_MSG_NEWKEYS). + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" diff --git a/crypto/openssh/kex.c b/crypto/openssh/kex.c index b4e2ab75f541..251cff7af530 100644 --- a/crypto/openssh/kex.c +++ b/crypto/openssh/kex.c @@ -65,7 +65,7 @@ #include "xmalloc.h" /* prototype */ -static int kex_choose_conf(struct ssh *); +static int kex_choose_conf(struct ssh *, uint32_t seq); static int kex_input_newkeys(int, u_int32_t, struct ssh *); static const char * const proposal_names[PROPOSAL_MAX] = { @@ -177,6 +177,18 @@ kex_names_valid(const char *names) return 1; } +/* returns non-zero if proposal contains any algorithm from algs */ +static int +has_any_alg(const char *proposal, const char *algs) +{ + char *cp; + + if ((cp = match_list(proposal, algs, NULL)) == NULL) + return 0; + free(cp); + return 1; +} + /* * Concatenate algorithm names, avoiding duplicates in the process. * Caller must free returned string. @@ -184,7 +196,7 @@ kex_names_valid(const char *names) char * kex_names_cat(const char *a, const char *b) { - char *ret = NULL, *tmp = NULL, *cp, *p, *m; + char *ret = NULL, *tmp = NULL, *cp, *p; size_t len; if (a == NULL || *a == '\0') @@ -201,10 +213,8 @@ kex_names_cat(const char *a, const char *b) } strlcpy(ret, a, len); for ((p = strsep(&cp, ",")); p && *p != '\0'; (p = strsep(&cp, ","))) { - if ((m = match_list(ret, p, NULL)) != NULL) { - free(m); + if (has_any_alg(ret, p)) continue; /* Algorithm already present */ - } if (strlcat(ret, ",", len) >= len || strlcat(ret, p, len) >= len) { free(tmp); @@ -334,15 +344,23 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], const char *defpropclient[PROPOSAL_MAX] = { KEX_CLIENT }; const char **defprop = ssh->kex->server ? defpropserver : defpropclient; u_int i; + char *cp; if (prop == NULL) fatal_f("proposal missing"); + /* Append EXT_INFO signalling to KexAlgorithms */ + if (kexalgos == NULL) + kexalgos = defprop[PROPOSAL_KEX_ALGS]; + if ((cp = kex_names_cat(kexalgos, ssh->kex->server ? + "kex-strict-s-v00@openssh.com" : + "ext-info-c,kex-strict-c-v00@openssh.com")) == NULL) + fatal_f("kex_names_cat"); + for (i = 0; i < PROPOSAL_MAX; i++) { switch(i) { case PROPOSAL_KEX_ALGS: - prop[i] = compat_kex_proposal(ssh, - kexalgos ? kexalgos : defprop[i]); + prop[i] = compat_kex_proposal(ssh, cp); break; case PROPOSAL_ENC_ALGS_CTOS: case PROPOSAL_ENC_ALGS_STOC: @@ -363,6 +381,7 @@ kex_proposal_populate_entries(struct ssh *ssh, char *prop[PROPOSAL_MAX], prop[i] = xstrdup(defprop[i]); } } + free(cp); } void @@ -466,7 +485,12 @@ kex_protocol_error(int type, u_int32_t seq, struct ssh *ssh) { int r; - error("kex protocol error: type %d seq %u", type, seq); + /* If in strict mode, any unexpected message is an error */ + if ((ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) { + ssh_packet_disconnect(ssh, "strict KEX violation: " + "unexpected packet type %u (seqnr %u)", type, seq); + } + error_f("type %u seq %u", type, seq); if ((r = sshpkt_start(ssh, SSH2_MSG_UNIMPLEMENTED)) != 0 || (r = sshpkt_put_u32(ssh, seq)) != 0 || (r = sshpkt_send(ssh)) != 0) @@ -544,7 +568,7 @@ kex_input_ext_info(int type, u_int32_t seq, struct ssh *ssh) if (ninfo >= 1024) { error("SSH2_MSG_EXT_INFO with too many entries, expected " "<=1024, received %u", ninfo); - return SSH_ERR_INVALID_FORMAT; + return dispatch_protocol_error(type, seq, ssh); } for (i = 0; i < ninfo; i++) { if ((r = sshpkt_get_cstring(ssh, &name, NULL)) != 0) @@ -660,7 +684,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) error_f("no kex"); return SSH_ERR_INTERNAL_ERROR; } - ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL); + ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, &kex_protocol_error); ptr = sshpkt_ptr(ssh, &dlen); if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0) return r; @@ -696,7 +720,7 @@ kex_input_kexinit(int type, u_int32_t seq, struct ssh *ssh) if (!(kex->flags & KEX_INIT_SENT)) if ((r = kex_send_kexinit(ssh)) != 0) return r; - if ((r = kex_choose_conf(ssh)) != 0) + if ((r = kex_choose_conf(ssh, seq)) != 0) return r; if (kex->kex_type < KEX_MAX && kex->kex[kex->kex_type] != NULL) @@ -960,20 +984,14 @@ proposals_match(char *my[PROPOSAL_MAX], char *peer[PROPOSAL_MAX]) return (1); } -/* returns non-zero if proposal contains any algorithm from algs */ static int -has_any_alg(const char *proposal, const char *algs) +kexalgs_contains(char **peer, const char *ext) { - char *cp; - - if ((cp = match_list(proposal, algs, NULL)) == NULL) - return 0; - free(cp); - return 1; + return has_any_alg(peer[PROPOSAL_KEX_ALGS], ext); } static int -kex_choose_conf(struct ssh *ssh) +kex_choose_conf(struct ssh *ssh, uint32_t seq) { struct kex *kex = ssh->kex; struct newkeys *newkeys; @@ -998,13 +1016,23 @@ kex_choose_conf(struct ssh *ssh) sprop=peer; } - /* Check whether client supports ext_info_c */ - if (kex->server && (kex->flags & KEX_INITIAL)) { - char *ext; - - ext = match_list("ext-info-c", peer[PROPOSAL_KEX_ALGS], NULL); - kex->ext_info_c = (ext != NULL); - free(ext); + /* Check whether peer supports ext_info/kex_strict */ + if ((kex->flags & KEX_INITIAL) != 0) { + if (kex->server) { + kex->ext_info_c = kexalgs_contains(peer, "ext-info-c"); + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-c-v00@openssh.com"); + } else { + kex->kex_strict = kexalgs_contains(peer, + "kex-strict-s-v00@openssh.com"); + } + if (kex->kex_strict) { + debug3_f("will use strict KEX ordering"); + if (seq != 0) + ssh_packet_disconnect(ssh, + "strict KEX violation: " + "KEXINIT was not the first packet"); + } } /* Check whether client supports rsa-sha2 algorithms */ diff --git a/crypto/openssh/kex.h b/crypto/openssh/kex.h index 8b54e3f4b912..a7ae59bf7869 100644 --- a/crypto/openssh/kex.h +++ b/crypto/openssh/kex.h @@ -148,6 +148,7 @@ struct kex { u_int kex_type; char *server_sig_algs; int ext_info_c; + int kex_strict; struct sshbuf *my; struct sshbuf *peer; struct sshbuf *client_version; diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index 3f885c3d01d1..cc492476f675 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1206,8 +1206,13 @@ ssh_packet_send2_wrapped(struct ssh *ssh) sshbuf_dump(state->output, stderr); #endif /* increment sequence number for outgoing packets */ - if (++state->p_send.seqnr == 0) + if (++state->p_send.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "outgoing sequence number " + "wrapped during initial key exchange"); + } logit("outgoing seqnr wraps around"); + } if (++state->p_send.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1215,6 +1220,11 @@ ssh_packet_send2_wrapped(struct ssh *ssh) state->p_send.bytes += len; sshbuf_reset(state->outgoing_packet); + if (type == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting send seqnr %u", state->p_send.seqnr); + state->p_send.seqnr = 0; + } + if (type == SSH2_MSG_NEWKEYS) r = ssh_set_newkeys(ssh, MODE_OUT); else if (type == SSH2_MSG_USERAUTH_SUCCESS && state->server_side) @@ -1343,8 +1353,7 @@ ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) /* Stay in the loop until we have received a complete packet. */ for (;;) { /* Try to read a packet from the buffer. */ - r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p); - if (r != 0) + if ((r = ssh_packet_read_poll_seqnr(ssh, typep, seqnr_p)) != 0) break; /* If we got a packet, return it. */ if (*typep != SSH_MSG_NONE) @@ -1415,29 +1424,6 @@ ssh_packet_read(struct ssh *ssh) return type; } -/* - * Waits until a packet has been received, verifies that its type matches - * that given, and gives a fatal error and exits if there is a mismatch. - */ - -int -ssh_packet_read_expect(struct ssh *ssh, u_int expected_type) -{ - int r; - u_char type; - - if ((r = ssh_packet_read_seqnr(ssh, &type, NULL)) != 0) - return r; - if (type != expected_type) { - if ((r = sshpkt_disconnect(ssh, - "Protocol error: expected packet type %d, got %d", - expected_type, type)) != 0) - return r; - return SSH_ERR_PROTOCOL_ERROR; - } - return 0; -} - static int ssh_packet_read_poll2_mux(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) { @@ -1628,10 +1614,16 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshbuf_consume(state->input, mac->mac_len)) != 0) goto out; } + if (seqnr_p != NULL) *seqnr_p = state->p_read.seqnr; - if (++state->p_read.seqnr == 0) + if (++state->p_read.seqnr == 0) { + if ((ssh->kex->flags & KEX_INITIAL) != 0) { + ssh_packet_disconnect(ssh, "incoming sequence number " + "wrapped during initial key exchange"); + } logit("incoming seqnr wraps around"); + } if (++state->p_read.packets == 0) if (!(ssh->compat & SSH_BUG_NOREKEY)) return SSH_ERR_NEED_REKEY; @@ -1697,6 +1689,10 @@ ssh_packet_read_poll2(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) #endif /* reset for next packet */ state->packlen = 0; + if (*typep == SSH2_MSG_NEWKEYS && ssh->kex->kex_strict) { + debug_f("resetting read seqnr %u", state->p_read.seqnr); + state->p_read.seqnr = 0; + } if ((r = ssh_packet_check_rekey(ssh)) != 0) return r; @@ -1717,10 +1713,39 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) r = ssh_packet_read_poll2(ssh, typep, seqnr_p); if (r != 0) return r; - if (*typep) { - state->keep_alive_timeouts = 0; - DBG(debug("received packet type %d", *typep)); + if (*typep == 0) { + /* no message ready */ + return 0; } + state->keep_alive_timeouts = 0; + DBG(debug("received packet type %d", *typep)); + + /* Always process disconnect messages */ + if (*typep == SSH2_MSG_DISCONNECT) { + if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || + (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) + return r; + /* Ignore normal client exit notifications */ + do_log2(ssh->state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s port %d:" + "%u: %.400s", ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), reason, msg); + free(msg); + return SSH_ERR_DISCONNECTED; + } + + /* + * Do not implicitly handle any messages here during initial + * KEX when in strict mode. They will be need to be allowed + * explicitly by the KEX dispatch table or they will generate + * protocol errors. + */ + if (ssh->kex != NULL && + (ssh->kex->flags & KEX_INITIAL) && ssh->kex->kex_strict) + return 0; + /* Implicitly handle transport-level messages */ switch (*typep) { case SSH2_MSG_IGNORE: debug3("Received SSH2_MSG_IGNORE"); @@ -1735,19 +1760,6 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) debug("Remote: %.900s", msg); free(msg); break; - case SSH2_MSG_DISCONNECT: - if ((r = sshpkt_get_u32(ssh, &reason)) != 0 || - (r = sshpkt_get_string(ssh, &msg, NULL)) != 0) - return r; - /* Ignore normal client exit notifications */ - do_log2(ssh->state->server_side && - reason == SSH2_DISCONNECT_BY_APPLICATION ? - SYSLOG_LEVEL_INFO : SYSLOG_LEVEL_ERROR, - "Received disconnect from %s port %d:" - "%u: %.400s", ssh_remote_ipaddr(ssh), - ssh_remote_port(ssh), reason, msg); - free(msg); - return SSH_ERR_DISCONNECTED; case SSH2_MSG_UNIMPLEMENTED: if ((r = sshpkt_get_u32(ssh, &seqnr)) != 0) return r; @@ -2213,6 +2225,7 @@ kex_to_blob(struct sshbuf *m, struct kex *kex) (r = sshbuf_put_u32(m, kex->hostkey_type)) != 0 || (r = sshbuf_put_u32(m, kex->hostkey_nid)) != 0 || (r = sshbuf_put_u32(m, kex->kex_type)) != 0 || + (r = sshbuf_put_u32(m, kex->kex_strict)) != 0 || (r = sshbuf_put_stringb(m, kex->my)) != 0 || (r = sshbuf_put_stringb(m, kex->peer)) != 0 || (r = sshbuf_put_stringb(m, kex->client_version)) != 0 || @@ -2375,6 +2388,7 @@ kex_from_blob(struct sshbuf *m, struct kex **kexp) (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_type)) != 0 || (r = sshbuf_get_u32(m, (u_int *)&kex->hostkey_nid)) != 0 || (r = sshbuf_get_u32(m, &kex->kex_type)) != 0 || + (r = sshbuf_get_u32(m, &kex->kex_strict)) != 0 || (r = sshbuf_get_stringb(m, kex->my)) != 0 || (r = sshbuf_get_stringb(m, kex->peer)) != 0 || (r = sshbuf_get_stringb(m, kex->client_version)) != 0 || @@ -2703,6 +2717,7 @@ sshpkt_disconnect(struct ssh *ssh, const char *fmt,...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); + debug2_f("sending SSH2_MSG_DISCONNECT: %s", buf); if ((r = sshpkt_start(ssh, SSH2_MSG_DISCONNECT)) != 0 || (r = sshpkt_put_u32(ssh, SSH2_DISCONNECT_PROTOCOL_ERROR)) != 0 || (r = sshpkt_put_cstring(ssh, buf)) != 0 || diff --git a/crypto/openssh/packet.h b/crypto/openssh/packet.h index 176488b1e5d2..9fc035b5e04f 100644 --- a/crypto/openssh/packet.h +++ b/crypto/openssh/packet.h @@ -124,7 +124,6 @@ int ssh_packet_send2_wrapped(struct ssh *); int ssh_packet_send2(struct ssh *); int ssh_packet_read(struct ssh *); -int ssh_packet_read_expect(struct ssh *, u_int type); int ssh_packet_read_poll(struct ssh *); int ssh_packet_read_poll2(struct ssh *, u_char *, u_int32_t *seqnr_p); int ssh_packet_process_incoming(struct ssh *, const char *buf, u_int len); diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index bc05f02142fd..d30b7364313f 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -358,7 +358,6 @@ struct cauthmethod { }; static int input_userauth_service_accept(int, u_int32_t, struct ssh *); -static int input_userauth_ext_info(int, u_int32_t, struct ssh *); static int input_userauth_success(int, u_int32_t, struct ssh *); static int input_userauth_failure(int, u_int32_t, struct ssh *); static int input_userauth_banner(int, u_int32_t, struct ssh *); @@ -472,7 +471,7 @@ ssh_userauth2(struct ssh *ssh, const char *local_user, ssh->authctxt = &authctxt; ssh_dispatch_init(ssh, &input_userauth_error); - ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, &input_userauth_ext_info); + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, kex_input_ext_info); ssh_dispatch_set(ssh, SSH2_MSG_SERVICE_ACCEPT, &input_userauth_service_accept); ssh_dispatch_run_fatal(ssh, DISPATCH_BLOCK, &authctxt.success); /* loop until success */ pubkey_cleanup(ssh); @@ -523,12 +522,6 @@ input_userauth_service_accept(int type, u_int32_t seq, struct ssh *ssh) return r; } -static int -input_userauth_ext_info(int type, u_int32_t seqnr, struct ssh *ssh) -{ - return kex_input_ext_info(type, seqnr, ssh); -} - void userauth(struct ssh *ssh, char *authlist) { @@ -607,6 +600,7 @@ input_userauth_success(int type, u_int32_t seq, struct ssh *ssh) free(authctxt->methoddata); authctxt->methoddata = NULL; authctxt->success = 1; /* break out */ + ssh_dispatch_set(ssh, SSH2_MSG_EXT_INFO, dispatch_protocol_error); return 0; } From nobody Tue Dec 19 20:19:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svp2k49ztz54rsQ; Tue, 19 Dec 2023 20:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Svp2k288nz4GfD; Tue, 19 Dec 2023 20:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82kw5tp7DwTTVfONlxPl72QfrizQ5P40E/NkU85xe4w=; b=ZtIQ61FegNNyUSz7RF3I9jEzhP8uGZN3A2BiXx8l5GbM13UzRq+w2E9n5a/qmzuvB/35+s UrKNlY2d6Gcxr+JKAR/DGJSmi7mH8HN7hcYXm0CW5ipSWHT3DHb610khmUJ6mfDeN7qU5s S0JA9r7RJl0rt0ulFZ2eu0ECD6ZS6JXvCDPhPFoi4Px9rEc6ONpGqnaMtbJ7oqYWBhYeub KG5XUIx2NgvHaI8yqRFaIuXrrLuqmhsBoT5P4PlyZFEHuxJrXCZzVAKtRQNJQiLzFGqIgx F33dFOVSNPvtspGoS1EH0QMU0DJi8+4Uixpoj/m563qFumIrIhSe8JTYDH2geg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017198; a=rsa-sha256; cv=none; b=nkYRPhcSOFa5TlPcq4ScRgzKLWpPaNpxSJPwzNKdX2wyVC4LRpNpSbWLcapag7j/lLReks DP2lcY/O0t0wD2GO8oxenK75DO4WFhMVpfBdFNsmDZO+KUlK/L8ykNDZzOL3lv4LTLhdbN W1xurtozdniBq/CYV9cq/lQaz8p0RYJsS8FLpSJRXvHwF2cLX5NkyhPzijYIlyvlNrJrk5 7ZH/DjZVOyDUJUYRzOkSDWNZGimUJRfdUrxUYzjXmbKdSYY1xf07Mcvg4NrAS4BCXAQTfx KApb3uGXfRsOZEBORToSJWMERuWOmz4n7L8tQNpU2IOqIhPxmaT8VQsfwQpUdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=82kw5tp7DwTTVfONlxPl72QfrizQ5P40E/NkU85xe4w=; b=wP8a1vAN+UrnW+F4/+AIIcetKfll1gRHtt2d4oBm/xKp7LQeeY4YLSavmTWKVdZm0o4sDJ WO7BPwbaVE+1ZeYgtvUTV9sZaNSGjGQDAtarBQQiuG929F8HhZXQxuM4UeiuE0hkCEBJgY w3LyIYlr1gAxDZrIAFcKGtwa0LLh972++ihJm+TdtNzVep09K/cDw38fpeuAhKAnW0IS7V xv2N7KOgGczSzFCq8L4J89W/jOvlPiRyDH3pOlpEuNj5f8L7MEnQTnvdiHNNfPwZL2e9I4 d0LtvOVH5XYftcYCZtEsPEOJXRsNDOOph3R98A2MamFk1q70xm3Ya6RkCFanEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Svp2k1G4cz4Z1; Tue, 19 Dec 2023 20:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKJwMj001293; Tue, 19 Dec 2023 20:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKJwZe001290; Tue, 19 Dec 2023 20:19:58 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:19:58 GMT Message-Id: <202312192019.3BJKJwZe001290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Tetlow Subject: git: c78c31d2ef40 - releng/13.2 - Add an UPDATING entry and bump the branch version. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gordon X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.2 X-Git-Reftype: branch X-Git-Commit: c78c31d2ef40c2345de7a73070d397c8be6e563a Auto-Submitted: auto-generated The branch releng/13.2 has been updated by gordon: URL: https://cgit.FreeBSD.org/src/commit/?id=c78c31d2ef40c2345de7a73070d397c8be6e563a commit c78c31d2ef40c2345de7a73070d397c8be6e563a Author: Gordon Tetlow AuthorDate: 2023-12-19 20:18:52 +0000 Commit: Gordon Tetlow CommitDate: 2023-12-19 20:18:52 +0000 Add an UPDATING entry and bump the branch version. Approved by: so --- UPDATING | 5 +++++ sys/conf/newvers.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 8ed94c3a241d..142afbf8e4fa 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. +20231212: + 13.2-RELEASE-p9 SA-23:19.openssh + + Prefix Truncation Attack in the SSH protocol [SA-23:19.openssh] + 20231212: 13.2-RELEASE-p8 SA-23:18.nfsclient diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index fb24da9b4dac..35e325add855 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.2" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Tue Dec 19 20:32:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvpKH04GFz54spL; Tue, 19 Dec 2023 20:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvpKG6l2Lz4cyw; Tue, 19 Dec 2023 20:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scnLpu2XjU/aXHcL5gtLSz9NRItJ6KWbMcPPmYoW+0U=; b=c4tcD3sMWJ31UbjQodkd8SvEM7xWaQdj3ZUtKLn96pli+s5mc3m95yCoqSlJCqj4/oI+OE 7/akWddPVFQ0DYbmyb6HHdhMxe4xiVREkxHjXqWjnUYJIpU1GfEGDG4hPo7u1X0Klon5zV ApgtT2rPTgssBRwAbXXVgOUO5z7Du2+/ILQExPaTj0P8oIyY0j5Rqq32eJMItBv502sihl rPMi/WUZc3nMY8+MhobVaaStp84l7RFaDBACJl/L+u9qbx0/wFNGoJ+Lpf8tFmMXJe9woY Si1dG272GLriR8CK3DQpaDHuopHmsAkycbbqrK2MdG/0UNii0MteU24ETuNMsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017954; a=rsa-sha256; cv=none; b=bVjIT9K9E+RN1Ek9VvyNJfIY/0R0qDrnRou20GjvwP07u6HeJ3sZ0F5HMLM6Tuz0OKSB/N cB6IfSbtQDjLuyGNjpUEucBm1LFQy8p9GJ/WOfgJOFBiuIw39QDcmx356QeemwFge/y0VW Td3izaaUppsZMHj8PIWk8glCHgEQSiXrZHZ7YSRwHGyCGEn1eqpcOR4sQ9JqzGakM9i2Ik Ip2evewyZwsyZwFman74GEGrtnAbOPkuHUrouAN70ot77mDGyzWLp3ZlCM9V9Vo/PzMA5u Wu6YIWIynAJgNN9m+mblDslzxiygNNHZLrAgyueYIpjd/lTiGjdlLjobbrHg3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=scnLpu2XjU/aXHcL5gtLSz9NRItJ6KWbMcPPmYoW+0U=; b=s3taB5YbHOCoR7EVw5sczk3mkSlC9axBcjpfd/b8pt4eg/OmaNhEEGEPzWtjNIylksyYFw 4A9GnCQ7a8dxwWN9NmCS2ZVIInFJuma6bvIyGsKxW9LbnVSAlL/cwpe8Jm4jPThAvO2L6m T8u0uGzBd8zlWSNO4afiAJXgcmt2iQp8OEuLvoyNCSH1/ocGneKeQYOudUyvqMgHShlOsV mOrTb+J+lw8L6yLAyyzYRONp3HIh7fqcuqA8dzPLyPSI9qvz3NShWJAf69Lol55P3V3rX1 MU+OCw2d1UG9YCg2qTFbimJ5egTHoOv/GWvtfvR6KVJ+jwR5WNQeR7k4kEn5/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvpKG5sCHz5PJ; Tue, 19 Dec 2023 20:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKWYjw033314; Tue, 19 Dec 2023 20:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKWYNl033311; Tue, 19 Dec 2023 20:32:34 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:32:34 GMT Message-Id: <202312192032.3BJKWYNl033311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: cb494408d86c - main - ichsmb(4): Add PCI ID for Intel Ice Lake SMBus controller List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb494408d86cd91472e6fee6766bd2f148dcc63f Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=cb494408d86cd91472e6fee6766bd2f148dcc63f commit cb494408d86cd91472e6fee6766bd2f148dcc63f Author: Dmitry Luhtionov AuthorDate: 2023-12-19 20:32:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-19 20:32:01 +0000 ichsmb(4): Add PCI ID for Intel Ice Lake SMBus controller MFC after: 2 weeks --- sys/dev/ichsmb/ichsmb_pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/ichsmb/ichsmb_pci.c b/sys/dev/ichsmb/ichsmb_pci.c index 57f9afb66f01..4d4cc9be70e5 100644 --- a/sys/dev/ichsmb/ichsmb_pci.c +++ b/sys/dev/ichsmb/ichsmb_pci.c @@ -108,6 +108,7 @@ #define ID_TIGERLAKE 0xa0a3 #define ID_TIGERLAKE2 0x43a3 #define ID_GEMINILAKE 0x31d4 +#define ID_ICELAKE 0x34a3 #define ID_ALDERLAKE 0x7aa3 #define ID_ALDERLAKE2 0x51a3 #define ID_ALDERLAKE3 0x54a3 @@ -203,6 +204,8 @@ static const struct pci_device_table ichsmb_devices[] = { PCI_DESCR("Intel Tiger Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_GEMINILAKE), PCI_DESCR("Intel Gemini Lake SMBus controller") }, + { PCI_DEV(PCI_VENDOR_INTEL, ID_ICELAKE), + PCI_DESCR("Intel Ice Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE), PCI_DESCR("Intel Alder Lake SMBus controller") }, { PCI_DEV(PCI_VENDOR_INTEL, ID_ALDERLAKE2), From nobody Tue Dec 19 20:32:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvpKJ1R6Yz54sVF; Tue, 19 Dec 2023 20:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvpKJ0WFrz4dQn; Tue, 19 Dec 2023 20:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DYVykXZDwOkaDFD6auK5kSWzlqtdQD3LHfW4XwTdLs=; b=yTS5yJd+uaD2qC5/Sg4th7Dkq+1cGwmpnT5+ejh+fTV4Aws4CblNQYPB3wGAhhbpCeZzzV wpEMsAC2WES5LHnAJmlEV22ltCgLmCOhI7IucT6KriUSyoVNB3G3LPoTKvdXlKbtzjns6f 3iSUOAM515PD9xeTP5Bl8gjvSpvY8Ai67rDXxl7NXs2wq9Iu6wYJm6QcxFsDFeeRTQy27C MC5TRJfOnn0U8XaXwnmpXPJbf8UkMriiJFnaXkqD1YaJPEbezzz1KFXN52g/1ABwUaGnIV j0SNL7xLHXmZYjo/1LDBmwh2KRp0UYqwdWzzAaT/HglcXyOvlnktpaKhfdnIQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703017956; a=rsa-sha256; cv=none; b=YYQWlQw2I4pnLx28hgzTB13bb1eq2GbX3vFtcBdeERd3h5wRaBHigdXMUq8X7qzu5XXz0Y fHaxW1njtIPLpWJYr3g9TGs9733E5rbwVsNS3rrL0RuoYajvTutSAo14shUcLLK62dKj1x wwAvqhvbRnfnZcqr5RQJKFqGFnoZM+FWIg9DI684kkJOUrkYk+kNFoGjOfc+xuwo/lLKyt u2SIJbApOEH65I9+pYm5xbOc2q3qXbhzHdgZLjhKM0Z7xyLULWqxUXyA27VgZVzHqjhOB9 sxzOIdPY1gJ2pawxThThdh/Ke17MF7Rgg/QdZ9mbAfTw9VfRQO/fwRqS8hnlug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703017956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DYVykXZDwOkaDFD6auK5kSWzlqtdQD3LHfW4XwTdLs=; b=catXqbgTJTh7aFCw2zs4uE1bYqdcY744P0qZqXSV20H4IltgdFMf6clyYk4oOjdblHDbLm Hw9DDDoz7MDJtquEZM9TUWdKLo6zFqkiXzkCyjGcYubmJ2MiXK8NZimYVMS1p31GVNVuw+ 6b/mgdIara5j3SSO4+ZNjV2wGbuXEPpUdePIRn3P8mtVcVQdjl5w7Az4LARIxewIJP+ntn HcXbiUejrZGQqt2qgxeij0jSym9ypibzP30qfIdXLDqRmSdkGhNdSc8nY1SutT1Zi/69be r4CeXlKiF/K4xsxz09wLKuZy1I4Afconeot4RW8g3J5dFroYvZ1vdCVgJ+v0zQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvpKH6jY1z5Rd; Tue, 19 Dec 2023 20:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKWZcP033368; Tue, 19 Dec 2023 20:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKWZMg033365; Tue, 19 Dec 2023 20:32:35 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:32:35 GMT Message-Id: <202312192032.3BJKWZMg033365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 45835894bd98 - main - pchtherm(4): Add PCI ID for Wellsburg Thermal Subsystem List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45835894bd980c7cd77213a238b6dc7264c76de0 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=45835894bd980c7cd77213a238b6dc7264c76de0 commit 45835894bd980c7cd77213a238b6dc7264c76de0 Author: Dmitry Luhtionov AuthorDate: 2023-12-19 20:32:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-19 20:32:01 +0000 pchtherm(4): Add PCI ID for Wellsburg Thermal Subsystem MFC after: 2 weeks --- sys/dev/intel/pchtherm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/intel/pchtherm.c b/sys/dev/intel/pchtherm.c index f4eecefffcdf..d6df17c95dda 100644 --- a/sys/dev/intel/pchtherm.c +++ b/sys/dev/intel/pchtherm.c @@ -102,6 +102,8 @@ static const struct pci_device_table pchtherm_devices[] = PCI_DESCR("CometLake-H Thermal Subsystem")}, { PCI_DEV(0x8086, 0xa1b1), PCI_DESCR("Lewisburg Thermal Subsystem")}, + { PCI_DEV(0x8086, 0x8d24), + PCI_DESCR("Wellsburg Thermal Subsystem")}, }; static int pchtherm_probe(device_t dev) From nobody Tue Dec 19 20:48:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Svpgb2G43z54vGg; Tue, 19 Dec 2023 20:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvpgZ5V3Jz3GCl; Tue, 19 Dec 2023 20:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703018906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O+WF5FCF/X7trkRTxMaEJQP+vd7xX7F8Qe6B41doLjg=; b=iXfvEMkglZsIDr7V0qsWTA3gVFVY8PAK09WUb6VxuymM+fqsLh9ZoEXDApLD8TNsB8Gv2g 4P1mBujkdqmhk0EjlSiPjJYTmSCcQw4dCDVfhYdyTT2gS1hg3+Yl5FMUm0JIorMdM+Xld+ NwnOA3x86MlL4teuF9rtPmr+a2QvmI9iAUWe7eoRtsbWLy0aX8zH00nLIAyKcAD7aFeiat TgCHvdr7VhviHw8KrymApXCJ6nMTmIfR/6UyZ78zGO52cF59G4OR7bvKzV7I+QljCkfgsM uyB8VV0SBAsqQgp6dQKUw6+5XsnxztfjNY+ByH8BleDLa6OUUwTtLkTWpnYkIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703018906; a=rsa-sha256; cv=none; b=hzR2yhqbKwupf2XD9Mi0UBDshndT+IW2nsPzHpqbmazPr57EKpCPHmVQwNqy5bCbDN/B/t aiNfhekpCWADyIm+7xOPvQYDqKbk32wCZ1PZKh7rVJqu0VE4/oMKlOiwikTNr9BncFSduK qa6b7Broknm7GB1/UvpLoWG1zdK91w/ValxmAcz2vdHHCbz26ChLlGf6YO4P5GwI5aZ3nu V/YU8kezAnBRaiZTjjg60Kwo6zb11F2milyaF9yV/Wk8WAAiJE3tObLLFqUC0hzsil6Rop G2jDBumhZj2fMojC3RcuFdUTg/yxl2KyQ2zjhYNUURetgmSYG0Dcpa3iWz87yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703018906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O+WF5FCF/X7trkRTxMaEJQP+vd7xX7F8Qe6B41doLjg=; b=ZtVnGdL1fMzfjbJDuF7v/RaF0vvdLLHWyQHJfTgmnlIIOlt6xQi3fCZ5Nw1i1N9xj6vonF J3+p+VAdKD9laHixGIXeEZ7uBPcCOOuqzPsMJvffFpdSUC5NnYJOhhdd8jQdi06GkVXRMg 1YkHe+7gEt5oHs+lfiv20f82z7LtShywyrdPKNHHJ20UZt0WCF01faCRwqlwtW5lZianUE knKXOwEIKTJc8xOlvJSmkm3OmnsmRGcIeaETQPVDnhe93mRnPK2c3gtVVeb42azPXz3ypX al5aoBbWoIArTxx9nHNWwfl69tJdDsFo6B6xa3ghlOES1jDkZMS6o+Xq8eFz8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvpgZ4SHNz5P0; Tue, 19 Dec 2023 20:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKmQ6x050573; Tue, 19 Dec 2023 20:48:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKmQAd050570; Tue, 19 Dec 2023 20:48:26 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:48:26 GMT Message-Id: <202312192048.3BJKmQAd050570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 36d6a456547c - stable/14 - ig4: Add PCI IDs for Intel Ice Lake I2C controller. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 36d6a456547cfe2a565bc60990e9cf421d267d07 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=36d6a456547cfe2a565bc60990e9cf421d267d07 commit 36d6a456547cfe2a565bc60990e9cf421d267d07 Author: Vladimir Kondratyev AuthorDate: 2023-11-27 15:25:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-19 20:34:56 +0000 ig4: Add PCI IDs for Intel Ice Lake I2C controller. PR: 275115 Tested by: Sam --- sys/dev/ichiic/ig4_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index bb4b75c0c6d1..9f12e713cdeb 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -119,6 +119,12 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_COMETLAKE_V_I2C_1 0xa3e18086 #define PCI_CHIP_COMETLAKE_V_I2C_2 0xa3e28086 #define PCI_CHIP_COMETLAKE_V_I2C_3 0xa3e38086 +#define PCI_CHIP_ICELAKE_LP_I2C_0 0x34e88086 +#define PCI_CHIP_ICELAKE_LP_I2C_1 0x34e98086 +#define PCI_CHIP_ICELAKE_LP_I2C_2 0x34ea8086 +#define PCI_CHIP_ICELAKE_LP_I2C_3 0x34eb8086 +#define PCI_CHIP_ICELAKE_LP_I2C_4 0x34c58086 +#define PCI_CHIP_ICELAKE_LP_I2C_5 0x34c68086 #define PCI_CHIP_TIGERLAKE_H_I2C_0 0x43d88086 #define PCI_CHIP_TIGERLAKE_H_I2C_1 0x43e88086 #define PCI_CHIP_TIGERLAKE_H_I2C_2 0x43e98086 @@ -225,6 +231,12 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_COMETLAKE_V_I2C_1, "Intel Comet Lake-V I2C Controller-1", IG4_CANNONLAKE}, { PCI_CHIP_COMETLAKE_V_I2C_2, "Intel Comet Lake-V I2C Controller-2", IG4_CANNONLAKE}, { PCI_CHIP_COMETLAKE_V_I2C_3, "Intel Comet Lake-V I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_0, "Intel Ice Lake-LP I2C Controller-0", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_1, "Intel Ice Lake-LP I2C Controller-1", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_2, "Intel Ice Lake-LP I2C Controller-2", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_3, "Intel Ice Lake-LP I2C Controller-3", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_4, "Intel Ice Lake-LP I2C Controller-4", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_5, "Intel Ice Lake-LP I2C Controller-5", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_0, "Intel Tiger Lake-H I2C Controller-0", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_1, "Intel Tiger Lake-H I2C Controller-1", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_2, "Intel Tiger Lake-H I2C Controller-2", IG4_TIGERLAKE}, From nobody Tue Dec 19 20:54:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvppP5ZTkz54vSL; Tue, 19 Dec 2023 20:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvppP4kQwz3NbY; Tue, 19 Dec 2023 20:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703019261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qN7CELDxjYukSvpAH+Vneey/SLbDjzcSscfhntv/QI8=; b=NaCiwHh1+kQIi4PMTfBfQplIm31Un+pX/C03S08oogW99cGithWDteSchydGvRzFR/b6YH YN+ZusdbIiWdtA3/qPeb98C4FOVAGMrvdfSwMzjM8ax1KrMKJ7B3xSHn2gga2yyU5gCU2y KKq5ddFOIt/r15muyNXH3KdTRxlHV/fSf8a2jWkBYAy42m8yyWqnKHMdYQN06JggFCXx9m o3SYSySQq1IvaG1dCgCOes5EGJ/KfwUrUDFOKZZOwlAnHlbAEOztX0T1/ZllrYUudUGxbC JN1caGbNcnCtcT1qZok/DkOKwQo5Ra2MTOpqD6o70mNLFgIoSRr3BItRcnAOig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703019261; a=rsa-sha256; cv=none; b=m/qLsdfrLsLKUIW4j5N823S5fKjM7WC4JcSSJQKxLuYv8QfLxqYhaVgAe3ELRW7yP1KM4c FIUdzN9pZ2E1FMajyeTIVGbZfNahQiXwTLlMGmov6NErFoFZo7yN2qeVYobBvZhHHyqzzB 6eu7/T2hbxbr1fSNRZeBA10SEnkLymMEJR9+aOh/KHQo6ukwpzNqf1dXuX6vQXlWGvSAzn jY03vOZs/qp/XxoKlTALJOfkKpBlUUMu3CmYY+DeRVLRMpaFRgy/HUIu+skDJXW6pMXUJ+ BB7Uf/DuTnU5/OaVZK0uVgV4ipOyl2ADyPJ5dlrzKPqt1DXozplZRZAcE2tJ5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703019261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qN7CELDxjYukSvpAH+Vneey/SLbDjzcSscfhntv/QI8=; b=NDM6SKbjUiMtQ1lNQd4uFo1Orz1o9cicNh0Qiq91G2Pc9kI4a15Zrcl6xunTpNofiylwa7 ZRmWbaKjxepgTCv0vUG2dDXz648OIBDwzOSUla0Wrb9Es5kuqosfwh8HVv2p8W5Sh+QWh2 GHk9AIQhQrL9z2EOqo9dyt9i4WSlYQ8LvYb5SON2a6A/YtittTVyObXXJJ5NxEBxSwOlnP 5dLl4qZ591Yc5OY1gnv3V5zqXm0x6Ui012n1rbefEzQ2apdbJSKoYrmltPbz7AbC6fI+FX b/jQg282qX7o9fGuXg+q/In288tCuihjb7ZotX0nJqgZPsvUKTXWAAWHtLRALA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvppP21QQz5vD; Tue, 19 Dec 2023 20:54:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJKsL9v066953; Tue, 19 Dec 2023 20:54:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJKsLSb066950; Tue, 19 Dec 2023 20:54:21 GMT (envelope-from git) Date: Tue, 19 Dec 2023 20:54:21 GMT Message-Id: <202312192054.3BJKsLSb066950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 2cbd132986a7 - stable/13 - ig4: Add PCI IDs for Intel Ice Lake I2C controller. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2cbd132986a782f689e169f4bf47793e1fc8a147 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=2cbd132986a782f689e169f4bf47793e1fc8a147 commit 2cbd132986a782f689e169f4bf47793e1fc8a147 Author: Vladimir Kondratyev AuthorDate: 2023-11-27 15:25:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-19 20:53:48 +0000 ig4: Add PCI IDs for Intel Ice Lake I2C controller. PR: 275115 Tested by: Sam (cherry picked from commit 789ffce392946d2f71a51bbac60db16dcdea2928) --- sys/dev/ichiic/ig4_pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/dev/ichiic/ig4_pci.c b/sys/dev/ichiic/ig4_pci.c index a3504659f700..06ee3a7c9845 100644 --- a/sys/dev/ichiic/ig4_pci.c +++ b/sys/dev/ichiic/ig4_pci.c @@ -119,6 +119,12 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_COMETLAKE_V_I2C_1 0xa3e18086 #define PCI_CHIP_COMETLAKE_V_I2C_2 0xa3e28086 #define PCI_CHIP_COMETLAKE_V_I2C_3 0xa3e38086 +#define PCI_CHIP_ICELAKE_LP_I2C_0 0x34e88086 +#define PCI_CHIP_ICELAKE_LP_I2C_1 0x34e98086 +#define PCI_CHIP_ICELAKE_LP_I2C_2 0x34ea8086 +#define PCI_CHIP_ICELAKE_LP_I2C_3 0x34eb8086 +#define PCI_CHIP_ICELAKE_LP_I2C_4 0x34c58086 +#define PCI_CHIP_ICELAKE_LP_I2C_5 0x34c68086 #define PCI_CHIP_TIGERLAKE_H_I2C_0 0x43d88086 #define PCI_CHIP_TIGERLAKE_H_I2C_1 0x43e88086 #define PCI_CHIP_TIGERLAKE_H_I2C_2 0x43e98086 @@ -225,6 +231,12 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { { PCI_CHIP_COMETLAKE_V_I2C_1, "Intel Comet Lake-V I2C Controller-1", IG4_CANNONLAKE}, { PCI_CHIP_COMETLAKE_V_I2C_2, "Intel Comet Lake-V I2C Controller-2", IG4_CANNONLAKE}, { PCI_CHIP_COMETLAKE_V_I2C_3, "Intel Comet Lake-V I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_0, "Intel Ice Lake-LP I2C Controller-0", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_1, "Intel Ice Lake-LP I2C Controller-1", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_2, "Intel Ice Lake-LP I2C Controller-2", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_3, "Intel Ice Lake-LP I2C Controller-3", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_4, "Intel Ice Lake-LP I2C Controller-4", IG4_TIGERLAKE}, + { PCI_CHIP_ICELAKE_LP_I2C_5, "Intel Ice Lake-LP I2C Controller-5", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_0, "Intel Tiger Lake-H I2C Controller-0", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_1, "Intel Tiger Lake-H I2C Controller-1", IG4_TIGERLAKE}, { PCI_CHIP_TIGERLAKE_H_I2C_2, "Intel Tiger Lake-H I2C Controller-2", IG4_TIGERLAKE}, From nobody Tue Dec 19 22:14:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvrbK3y4lz5571H for ; Tue, 19 Dec 2023 22:14: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvrbK3SP2z3XH1; Tue, 19 Dec 2023 22:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703024093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QADurZVQLENzmdZWYmGxGkHX9GDAhvgFxuYtApd5/7w=; b=PFDQR9VDLofKem04A7CXPeNpofEjaKgpXEPGzHIq8x0Pt3Ed+nXg2CBsas++D6J+RJVbwj GqxyZadA5dGCLEJyea98k0Zhgr7nlgLfdVRkvCz7cjBy9Z9plAW27plZAQSlH5m+z2rbYS h8+g0mHfULtHzK0TYQqq3v2CRPI+dRmUCzE5Tj54W5bnrBTEEjg9W146vOKKv8UPnk9QEr 7dX/2o8jQtFWguZ/3/HqrKEo29JoSf0tjVonpQokkEfFrC93ou6fJ6hvrKWXHOio0kv3Xr ZFndBLCCq3SYDSVYUf2WzBOaHfQ51XSQtuFHzvBENaeyOrp/Mbf1SVhbWtVUPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703024093; a=rsa-sha256; cv=none; b=m77QVKDwAXNsFuBcUoWLTtiPZV0gPD4nE50B6XhXcJhktPMLTQ4ooUhjGnDbT7fR2vR4Hx 6QoGPvZayW3f4BsANnNwq68jzaA78JHnpqBrTiqPKV+/7oyLfZvvLiNRH+MFAGMubhX/UG O6SUScLbmHrgCPfaMl3YidyVxFcTGagbfYAzgMpCoyEsvm7X/7ovuvE4uu/kWObET30BaF lZUSPDiCrKPktmQVd/4xcxL/Weg6r9gNYsRJ63XBaZ4LXC629evPmaLiP3QMr1naBQ5TjA KDZXX7DjSJNfVhn5zYxIDVEfzdY6JFnhVfPGh/VEKpnOuL/M2yddPLWfs79nKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703024093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QADurZVQLENzmdZWYmGxGkHX9GDAhvgFxuYtApd5/7w=; b=N57XNoKPYBMBY4zqFSbj//ZaD+usNeW+OOW8pPUr8J1VcygUaIJpLKLNGPyp/tnNGnI4Nl Q4z9VOsvvedmf05t811/wWULSeibo8EVGbxYgthsNu4K/gBu6EjDRZsla/xoR3DvT/32pa k9ic9q7kJC9/yvEs3BX1fo4UmGeuHAnaFLr+xrU+TJrYqRW6lDwU938HEippBt636CIka3 l9WVVf+/T/7KDZ1KJfwxGALiGhl5deOpUNfQ5e/nPgptw8L5x3knISUlTUJwg+kjTNPbC4 2E+SIeK6seYmZVjrlxGbXddRHSt+531VBx/P9bUf/ZWnziBCWgzHeVDf91RWRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvrbK2G9Xz7vX; Tue, 19 Dec 2023 22:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJMErMQ001339; Tue, 19 Dec 2023 22:14:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJMErod001338; Tue, 19 Dec 2023 22:14:53 GMT (envelope-from git) Date: Tue, 19 Dec 2023 22:14:53 GMT Message-Id: <202312192214.3BJMErod001338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 86e115e21e5b..dbda45160ffa - vendor/openzfs/master - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: dbda45160ffa43e5ecf0498a609230f1afee7b3f X-Git-Oldrev: 86e115e21e5bdeee73c88c5a1a73a29d9637380a X-Git-Newrev: dbda45160ffa43e5ecf0498a609230f1afee7b3f Auto-Submitted: auto-generated The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=86e115e21e5b..dbda45160ffa 9b1677fb5a08 dmu: Allow buffer fills to fail dbda45160ffa Test LWB buffer overflow for block cloning From nobody Tue Dec 19 22:42:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvsCN3tzLz55C45; Tue, 19 Dec 2023 22:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvsCN0C0Pz3LRj; Tue, 19 Dec 2023 22:42:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703025760; h=from:from:reply-to:subject:subject: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/aENv0XN1eVbhoXLUHIwzcXLG2QwbHIdljgOIg9Hv4=; b=QrDzL+cWj4eKxhTHOOnKxR5Fz6W/BnYqiHacjNczATmU/rMuxD/zWjQm1yXTRu/G4tDp9m Gu/COVNFJN4cdn+RYAO9dSCrSRelmtlEQTDtTmHTtfwPuJMoS6pA3g5IU6PwjWGCvQ8tkP rqDt5c11NZlAuMi2/hOQ0NHXhQJAkWjfnDr6PnkbgaLqSNfk6SwLyf2T7J8IeZWpwMWWac ERd+9NDu+Tm7qKFXseEIqGk2szR9ANv3/zBgCjO0HyGaeKX52kkkbcOUWo8Mt8SxpZStjW I8VD/gxrmCdXF2fQibADWZAoBept4KvY1OIkkGabfPmE0/g0ZMZrnIBmgmOMfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703025760; a=rsa-sha256; cv=none; b=IfPhLz/U7WOZ5b06J87YD6OqMukqUoASYiy5E1MOg2Oz4PuQrcqVgMyqpDjA+md8TEJKkF A1Q8LvEhTFo3hUdmTVH4CuvifJH17EtZL0n3n/TImQVaqfRpBY32UeWe2ZJUHacOwoTpp2 WamcZqAMCLupY8lr+MNC3N+yHfXNQ26PPy8fAPVgJgWo78wkALZzGis0wrQJ/YMd7lZala Wll7L7uFfSUC3obC5XeazO7vDS8/t5L4bcLw4R6FRZQNrbE7WKBttKTZx07ebpQceHBljF GEhlI5KtRFDbmaBsWiL+/YSPULWJYA/DBZtJb/aIPaQzCYwR5aMKPPv75gIy/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703025760; h=from:from:reply-to:subject:subject: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/aENv0XN1eVbhoXLUHIwzcXLG2QwbHIdljgOIg9Hv4=; b=Azm+C8bZwrt2LjFwPyaX0y4DAD+CbqngYyq/dWJ/uBPoZkzdpT2KXH2d8cFNL+gow2qE1F zrqFcJR4yPeDf1CCUj0R0JInm/MW7eHGhgPK+5A9wnsKppvx/yiwQdkn+Gm80kEtswMjB4 qT4ahkG/ipuSgP9vHn8kqfXusPs07KmCbJn5CJDBRcRT5GRihWU8kGsowi/rrSv8joWmer pLleJ+lBvzHa7fUvqx13hDfINQHW9nJSEGXCIcFy/mPPwOc3OEvb1EI8n3AQUA/CnDGX0n uRK5lIiYtDNbenrjcJbrRLeeIct4aoehtXz70hH5xwCB/kvMrVrvW0o1YTHfmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SvsCM5w9rz8r3; Tue, 19 Dec 2023 22:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BJMgd91051079; Tue, 19 Dec 2023 22:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BJMgdIb051076; Tue, 19 Dec 2023 22:42:39 GMT (envelope-from git) Date: Tue, 19 Dec 2023 22:42:39 GMT Message-Id: <202312192242.3BJMgdIb051076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 188408da9f7c - main - zfs: merge openzfs/zfs@dbda45160 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 188408da9f7c19f476c1afe9becb0d373088da31 Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=188408da9f7c19f476c1afe9becb0d373088da31 commit 188408da9f7c19f476c1afe9becb0d373088da31 Merge: 45835894bd98 dbda45160ffa Author: Martin Matuska AuthorDate: 2023-12-19 22:17:48 +0000 Commit: Martin Matuska CommitDate: 2023-12-19 22:19:48 +0000 zfs: merge openzfs/zfs@dbda45160 Notable upstream pull request merges: #15665 9b1677fb5 dmu: Allow buffer fills to fail Obtained from: OpenZFS OpenZFS commit: dbda45160ffa43e5ecf0498a609230f1afee7b3f .../openzfs/include/os/freebsd/spl/sys/uio.h | 2 +- sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 2 +- sys/contrib/openzfs/include/sys/dbuf.h | 4 +- sys/contrib/openzfs/lib/libspl/include/sys/uio.h | 2 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 4 +- sys/contrib/openzfs/module/zfs/dbuf.c | 33 +++++--- sys/contrib/openzfs/module/zfs/dmu.c | 21 +++-- sys/contrib/openzfs/module/zfs/dmu_recv.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 2 +- sys/contrib/openzfs/tests/runfiles/linux.run | 3 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 2 + .../openzfs/tests/zfs-tests/tests/Makefile.am | 1 + .../block_cloning_lwb_buffer_overflow.ksh | 89 ++++++++++++++++++++++ sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 15 files changed, 139 insertions(+), 34 deletions(-) diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh index 000000000000,0ae76b7e54a5..0ae76b7e54a5 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh diff --cc sys/modules/zfs/zfs_config.h index b6e93c8eadf7,000000000000..f6b8ad1fc472 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1152 -1,0 +1,1152 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* Define to 1 if you have the `execvpe' function. */ +/* #undef HAVE_EXECVPE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* 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_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* user_namespace->ns.inum exists */ +/* #undef HAVE_USER_NS_COMMON_INUM */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* fops->clone_file_range() is available */ +/* #undef HAVE_VFS_CLONE_FILE_RANGE */ + +/* fops->copy_file_range() is available */ +/* #undef HAVE_VFS_COPY_FILE_RANGE */ + +/* fops->dedupe_file_range() is available */ +/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* file_operations_extend takes .copy_file_range() and .clone_file_range() */ +/* #undef HAVE_VFS_FILE_OPERATIONS_EXTEND */ + +/* generic_copy_file_range() is available */ +/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ *** 222 LINES SKIPPED *** From nobody Wed Dec 20 06:27:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw3Wz1LQrz554lM; Wed, 20 Dec 2023 06:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw3Wz0gt5z4QBC; Wed, 20 Dec 2023 06:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703053663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSGyza+XESnl7yE5rAZvSMOyCHMvyX91i3l5fb+fmb0=; b=KttE1ajheZpIYNYwAzYcEnNsiXMwKn9AzM00kBUz5Dw2rg5YhetJP35ymqPRcusDlSUsvO aIzXIKAfueq9Zp0dIrc4r+IMBFj75ND34dXNgKYTJMUHOIkdL/EW9qG4y7EWdHfxDV5cQe QtxorDvZWB3HfR3wy0XP5mIgRor2EgxaxTMLw7lDL4cYXu/4VycirGIG+VHfNGU3NQnfo/ cXQKSAYI24/SLOQrMNsIdxQ29D624pcqogFKZfi/+/I4t49BbEQwqD70pxNe3SYofJBkFp WiX7kafvt8TCdwNy70AXX2vNTE3xYkqspkOMQtexjpE4ggWoo5UF7Zc1J8v7uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703053663; a=rsa-sha256; cv=none; b=RI9OW2FkC3ZPpYBHKxu5Cvct/DSzvAInUCAxNX1/2YS9/UBOxgErGZmzjZYTsRoqq+OqYT GzX2LuhNkVsjN8lkQIh5bYsCHxx3rCIW0zRIezRq1fTUukpWqJIxfO33CHHG/9KCh/tHZN 33YkLzY0WDfYHXeKP7EnP0QZIxtn/zwaOtK/Xoi4sSM6umD2lssFfXGa2I5IGjt/egqoLa skTN4Z6SgWz0gFU6jFX040f155R+dVLfJyMQqsPbBpicL/TRi5MqIoWS0B1Gw7RvTDe40E gf9ukNQ3RDV8lx7fE5dFHErv9+3uIv/I623Q5Ekm/d02QvEnVIedU8vw53ZUkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703053663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RSGyza+XESnl7yE5rAZvSMOyCHMvyX91i3l5fb+fmb0=; b=M1Ng1IBxVibkggocdfqYxeBxr/BAZ6Mmu7YCoMzmexfpJgLHppGWlP8rmSE/bc27Ey6e1S KdIRX1+0gDpA7zQNfICDtfvk/UbEcLBlNnw3i2kLjbPRRVV1gT/hdYdoRCrIAin4D18Id+ pLe1tvHL/ZFb4nHoqKmaXkvJk0ck82pE1/4NvHxdnareg4F4S5kF0N1YQAs8m0p+Zeadoy HbGtWC0SOdVqEgSiHbXRk1g3O3BcStRofYK0tB6FnNHbpfYtItrH/HWCBKgt8IDf1nTub/ vst3oKSILfSgEUrxaDAvzj8K30J8oe/HcEVv/ajb+ljD/QLxWdeIqio1yIeJdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw3Wy6p2rzdQk; Wed, 20 Dec 2023 06:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK6Rg5a021781; Wed, 20 Dec 2023 06:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK6Rgv4021778; Wed, 20 Dec 2023 06:27:42 GMT (envelope-from git) Date: Wed, 20 Dec 2023 06:27:42 GMT Message-Id: <202312200627.3BK6Rgv4021778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: a4a9d2a64a4d - main - locale: regenerate SJIS charmap from CLDR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4a9d2a64a4ded0adf27cbc1af82669112c41887 Auto-Submitted: auto-generated The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=a4a9d2a64a4ded0adf27cbc1af82669112c41887 commit a4a9d2a64a4ded0adf27cbc1af82669112c41887 Author: Yuri Pankov AuthorDate: 2023-11-30 09:04:55 +0000 Commit: Yuri Pankov CommitDate: 2023-12-20 06:24:22 +0000 locale: regenerate SJIS charmap from CLDR There are some noticable differences affecting the '\' and '~' characters between our current charmap and latest CLDR version. PR: 264299, 275444 Reviewed by: bapt Tested by: uratan@miomio.jp Differential Revision: https://reviews.freebsd.org/D42848 --- tools/tools/locale/etc/final-maps/map.SJIS | 18682 ++++++++++----------------- 1 file changed, 7185 insertions(+), 11497 deletions(-) diff --git a/tools/tools/locale/etc/final-maps/map.SJIS b/tools/tools/locale/etc/final-maps/map.SJIS index 9660417ca05e..3b3ab012e0ec 100644 --- a/tools/tools/locale/etc/final-maps/map.SJIS +++ b/tools/tools/locale/etc/final-maps/map.SJIS @@ -1,11500 +1,7188 @@ +###################### +# POSIX charmap +# Generated automatically from the Unicode Character Database and Common Locale Data Repository +# see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html +# charset: SJIS +###################### +################################################################################################# +# Copyright © 1991-2023 Unicode, Inc. +# For terms of use, see http://www.unicode.org/copyright.html +# SPDX-License-Identifier: Unicode-DFS-2016 +# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) + "SJIS" - 1 - 2 + 1 + 2 + CHARMAP - \x00 - \x00 - \x01 - \x01 - \x02 - \x02 - \x03 - \x03 - \x04 - \x04 - \x05 - \x05 - \x06 - \x06 - \x07 - \x07 - \x08 - \x08 - \x09 - \x09 - \x0a - \x0a - \x0b - \x0b - \x0c - \x0c - \x0d - \x0d - \x0e - \x0e - \x0f - \x0f - \x10 - \x10 - \x11 - \x11 - \x12 - \x12 - \x13 - \x13 - \x14 - \x14 - \x15 - \x15 - \x16 - \x16 - \x17 - \x17 - \x18 - \x18 - \x19 - \x19 - \x1a - \x1a - \x1b - \x1b - \x1c - \x1c - \x1d - \x1d - \x1e - \x1e - \x1f - \x1f - \x20 - \x20 - \x21 - \x22 - \x23 - \x24 - \x25 - \x26 - \x27 - \x28 - \x29 - \x2a - \x2b - \x2c - \x2d - \x2e - \x2f - \x30 - \x30 - \x31 - \x31 - \x32 - \x32 - \x33 - \x33 - \x34 - \x34 - \x35 - \x35 - \x36 - \x36 - \x37 - \x37 - \x38 - \x38 - \x39 - \x39 - \x3a - \x3b - \x3c - \x3d - \x3e - \x3f - \x40 - \x41 - \x41 - \x42 - \x42 - \x43 - \x43 - \x44 - \x44 - \x45 - \x45 - \x46 - \x46 - \x47 - \x47 - \x48 - \x48 - \x49 - \x49 - \x4a - \x4a - \x4b - \x4b - \x4c - \x4c - \x4d - \x4d - \x4e - \x4e - \x4f - \x4f - \x50 -

\x70 - \x71 - \x71 - \x72 - \x72 - \x73 - \x73 - \x74 - \x74 - \x75 - \x75 - \x76 - \x76 - \x77 - \x77 - \x78 - \x78 - \x79 - \x79 - \x7a - \x7a - \x7b - \x7c - \x7d - \x7e - \x7f - \x7f - \x81\x40 - \x81\x41 - \x81\x42 - \x81\x43 - \x81\x44 - \x81\x45 - \x81\x46 - \x81\x47 - \x81\x48 - \x81\x49 - \x81\x4a - \x81\x4b - \x81\x4c - \x81\x4d - \x81\x4e - \x81\x4f - \x81\x50 - \x81\x51 - \x81\x52 - \x81\x53 - \x81\x54 - \x81\x55 - \x81\x56 - \x81\x57 - \x81\x58 - \x81\x59 - \x81\x5a - \x81\x5b - \x81\x5c - \x81\x5d - \x81\x5e - \x81\x5f - \x81\x60 - \x81\x61 - \x81\x62 - \x81\x63 - \x81\x64 - \x81\x65 - \x81\x66 - \x81\x67 - \x81\x68 - \x81\x69 - \x81\x6a - \x81\x6b - \x81\x6c - \x81\x6d - \x81\x6e - \x81\x6f - \x81\x70 - \x81\x71 - \x81\x72 - \x81\x73 - \x81\x74 - \x81\x75 - \x81\x76 - \x81\x77 - \x81\x78 - \x81\x79 - \x81\x7a - \x81\x7b - \x81\x7c - \x81\x7d - \x81\x7e - \x81\x80 - \x81\x81 - \x81\x82 - \x81\x83 - \x81\x84 - \x81\x85 - \x81\x86 - \x81\x87 - \x81\x88 - \x81\x89 - \x81\x8a - \x81\x8b - \x81\x8c - \x81\x8d - \x81\x8e - \x81\x8f - \x81\x90 - \x81\x91 - \x81\x92 - \x81\x93 - \x81\x94 - \x81\x95 - \x81\x96 - \x81\x97 - \x81\x98 - \x81\x99 - \x81\x9a - \x81\x9b - \x81\x9c - \x81\x9d - \x81\x9e - \x81\x9f - \x81\xa0 - \x81\xa1 - \x81\xa2 - \x81\xa3 - \x81\xa4 - \x81\xa5 - \x81\xa6 - \x81\xa7 - \x81\xa8 - \x81\xa9 - \x81\xaa - \x81\xab - \x81\xac - \x81\xad - \x81\xae - \x81\xaf - \x81\xb0 - \x81\xb1 - \x81\xb2 - \x81\xb3 - \x81\xb4 - \x81\xb5 - \x81\xb6 - \x81\xb7 - \x81\xb8 - \x81\xb9 - \x81\xba - \x81\xbb - \x81\xbc - \x81\xbd - \x81\xbe - \x81\xbf - \x81\xc0 - \x81\xc1 - \x81\xc2 - \x81\xc3 - \x81\xc4 - \x81\xc5 - \x81\xc6 - \x81\xc7 - \x81\xc8 - \x81\xc9 - \x81\xca - \x81\xcb - \x81\xcc - \x81\xcd - \x81\xce - \x81\xcf - \x81\xd0 - \x81\xd1 - \x81\xd2 - \x81\xd3 - \x81\xd4 - \x81\xd5 - \x81\xd6 - \x81\xd7 - \x81\xd8 - \x81\xd9 - \x81\xda - \x81\xdb - \x81\xdc - \x81\xdd - \x81\xde - \x81\xdf - \x81\xe0 - \x81\xe1 - \x81\xe2 - \x81\xe3 - \x81\xe4 - \x81\xe5 - \x81\xe6 - \x81\xe7 - \x81\xe8 - \x81\xe9 - \x81\xea - \x81\xeb - \x81\xec - \x81\xed - \x81\xee - \x81\xef - \x81\xf0 - \x81\xf1 - \x81\xf2 - \x81\xf3 - \x81\xf4 - \x81\xf5 - \x81\xf6 - \x81\xf7 - \x81\xf8 - \x81\xf9 - \x81\xfa - \x81\xfb - \x81\xfc - \x82\x40 - \x82\x41 - \x82\x42 - \x82\x43 - \x82\x44 - \x82\x45 - \x82\x46 - \x82\x47 - \x82\x48 - \x82\x49 - \x82\x4a - \x82\x4b - \x82\x4c - \x82\x4d - \x82\x4e - \x82\x4f - \x82\x50 - \x82\x51 - \x82\x52 - \x82\x53 - \x82\x54 - \x82\x55 - \x82\x56 - \x82\x57 - \x82\x58 - \x82\x59 - \x82\x5a - \x82\x5b - \x82\x5c - \x82\x5d - \x82\x5e - \x82\x5f - \x82\x60 - \x82\x61 - \x82\x62 - \x82\x63 - \x82\x64 - \x82\x65 - \x82\x66 - \x82\x67 - \x82\x68 - \x82\x69 - \x82\x6a - \x82\x6b - \x82\x6c - \x82\x6d - \x82\x6e - \x82\x6f - \x82\x70 - \x82\x71 - \x82\x72 - \x82\x73 - \x82\x74 - \x82\x75 - \x82\x76 - \x82\x77 - \x82\x78 - \x82\x79 - \x82\x7a - \x82\x7b - \x82\x7c - \x82\x7d - \x82\x7e - \x82\x80 - \x82\x81 - \x82\x82 - \x82\x83 - \x82\x84 - \x82\x85 - \x82\x86 - \x82\x87 - \x82\x88 - \x82\x89 - \x82\x8a - \x82\x8b - \x82\x8c - \x82\x8d - \x82\x8e - \x82\x8f - \x82\x90 - \x82\x91 - \x82\x92 - \x82\x93 - \x82\x94 - \x82\x95 - \x82\x96 - \x82\x97 - \x82\x98 - \x82\x99 - \x82\x9a - \x82\x9b - \x82\x9c - \x82\x9d - \x82\x9e - \x82\x9f - \x82\xa0 - \x82\xa1 - \x82\xa2 - \x82\xa3 - \x82\xa4 - \x82\xa5 - \x82\xa6 - \x82\xa7 - \x82\xa8 - \x82\xa9 - \x82\xaa - \x82\xab - \x82\xac - \x82\xad - \x82\xae - \x82\xaf - \x82\xb0 - \x82\xb1 - \x82\xb2 - \x82\xb3 - \x82\xb4 - \x82\xb5 - \x82\xb6 - \x82\xb7 - \x82\xb8 - \x82\xb9 - \x82\xba - \x82\xbb - \x82\xbc - \x82\xbd - \x82\xbe - \x82\xbf - \x82\xc0 - \x82\xc1 - \x82\xc2 - \x82\xc3 - \x82\xc4 - \x82\xc5 - \x82\xc6 - \x82\xc7 - \x82\xc8 - \x82\xc9 - \x82\xca - \x82\xcb - \x82\xcc - \x82\xcd - \x82\xce - \x82\xcf - \x82\xd0 - \x82\xd1 - \x82\xd2 - \x82\xd3 - \x82\xd4 - \x82\xd5 - \x82\xd6 - \x82\xd7 - \x82\xd8 - \x82\xd9 - \x82\xda - \x82\xdb - \x82\xdc - \x82\xdd - \x82\xde - \x82\xdf - \x82\xe0 - \x82\xe1 - \x82\xe2 - \x82\xe3 - \x82\xe4 - \x82\xe5 - \x82\xe6 - \x82\xe7 - \x82\xe8 - \x82\xe9 - \x82\xea - \x82\xeb - \x82\xec - \x82\xed - \x82\xee - \x82\xef - \x82\xf0 - \x82\xf1 - \x82\xf2 - \x82\xf3 - \x82\xf4 - \x83\x40 - \x83\x41 - \x83\x42 - \x83\x43 - \x83\x44 - \x83\x45 - \x83\x46 - \x83\x47 - \x83\x48 - \x83\x49 - \x83\x4a - \x83\x4b - \x83\x4c - \x83\x4d - \x83\x4e - \x83\x4f - \x83\x50 - \x83\x51 - \x83\x52 - \x83\x53 - \x83\x54 - \x83\x55 - \x83\x56 - \x83\x57 - \x83\x58 - \x83\x59 - \x83\x5a - \x83\x5b - \x83\x5c - \x83\x5d - \x83\x5e - \x83\x5f - \x83\x60 - \x83\x61 - \x83\x62 - \x83\x63 - \x83\x64 - \x83\x65 - \x83\x66 - \x83\x67 - \x83\x68 - \x83\x69 - \x83\x6a - \x83\x6b - \x83\x6c - \x83\x6d - \x83\x6e - \x83\x6f - \x83\x70 - \x83\x71 - \x83\x72 - \x83\x73 - \x83\x74 - \x83\x75 - \x83\x76 - \x83\x77 - \x83\x78 - \x83\x79 - \x83\x7a - \x83\x7b - \x83\x7c - \x83\x7d - \x83\x7e - \x83\x80 - \x83\x81 - \x83\x82 - \x83\x83 - \x83\x84 - \x83\x85 - \x83\x86 - \x83\x87 - \x83\x88 - \x83\x89 - \x83\x8a - \x83\x8b - \x83\x8c - \x83\x8d - \x83\x8e - \x83\x8f - \x83\x90 - \x83\x91 - \x83\x92 - \x83\x93 - \x83\x94 - \x83\x95 - \x83\x96 - \x83\x9f - \x83\xa0 - \x83\xa1 - \x83\xa2 - \x83\xa3 - \x83\xa4 - \x83\xa5 - \x83\xa6 - \x83\xa7 - \x83\xa8 - \x83\xa9 - \x83\xaa - \x83\xab - \x83\xac - \x83\xad - \x83\xae - \x83\xaf - \x83\xb0 - \x83\xb1 - \x83\xb2 - \x83\xb3 - \x83\xb4 - \x83\xb5 - \x83\xb6 - \x83\xb7 - \x83\xb8 - \x83\xb9 - \x83\xba - \x83\xbb - \x83\xbc - \x83\xbd - \x83\xbe - \x83\xbf - \x83\xc0 - \x83\xc1 - \x83\xc2 - \x83\xc3 - \x83\xc4 - \x83\xc5 - \x83\xc6 - \x83\xc7 - \x83\xc8 - \x83\xc9 - \x83\xca - \x83\xcb - \x83\xcc - \x83\xcd - \x83\xce - \x83\xcf - \x83\xd0 - \x83\xd1 - \x83\xd2 - \x83\xd3 - \x83\xd4 - \x83\xd5 - \x83\xd6 - \x83\xd7 - \x83\xd8 - \x83\xd9 - \x83\xda - \x83\xdb - \x83\xdc - \x83\xdd - \x83\xde - \x83\xdf - \x83\xe0 - \x83\xe1 - \x83\xe2 - \x83\xe3 - \x83\xe4 - \x83\xe5 - \x83\xe6 - \x83\xe7 - \x83\xe8 - \x83\xe9 - \x83\xea - \x83\xeb - \x83\xec - \x83\xed - \x83\xee - \x83\xef - \x83\xf0 - \x83\xf1 - \x83\xf2 - \x83\xf3 - \x83\xf4 - \x83\xf5 - \x83\xf7 - \x83\xf8 - \x83\xf9 - \x83\xfa - \x83\xfb - \x83\xfc - \x84\x40 - \x84\x41 - \x84\x42 - \x84\x43 - \x84\x44 - \x84\x45 - \x84\x46 - \x84\x47 - \x84\x48 - \x84\x49 - \x84\x4a - \x84\x4b - \x84\x4c - \x84\x4d - \x84\x4e - \x84\x4f - \x84\x50 - \x84\x51 - \x84\x52 - \x84\x53 - \x84\x54 - \x84\x55 - \x84\x56 - \x84\x57 - \x84\x58 - \x84\x59 - \x84\x5a - \x84\x5b - \x84\x5c - \x84\x5d - \x84\x5e - \x84\x5f - \x84\x60 - \x84\x61 - \x84\x62 - \x84\x63 - \x84\x64 - \x84\x65 - \x84\x66 - \x84\x67 - \x84\x68 - \x84\x69 - \x84\x6a - \x84\x6b - \x84\x6c - \x84\x6d - \x84\x6e - \x84\x6f - \x84\x70 - \x84\x71 - \x84\x72 - \x84\x73 - \x84\x74 - \x84\x75 - \x84\x76 - \x84\x77 - \x84\x78 - \x84\x79 - \x84\x7a - \x84\x7b - \x84\x7c - \x84\x7d - \x84\x7e - \x84\x80 - \x84\x81 - \x84\x82 - \x84\x83 - \x84\x84 - \x84\x85 - \x84\x86 - \x84\x87 - \x84\x88 - \x84\x89 - \x84\x8a - \x84\x8b - \x84\x8c - \x84\x8d - \x84\x8e - \x84\x8f - \x84\x90 - \x84\x91 - \x84\x92 - \x84\x93 - \x84\x94 - \x84\x95 - \x84\x96 - \x84\x97 - \x84\x98 - \x84\x99 - \x84\x9a - \x84\x9b - \x84\x9c - \x84\x9d - \x84\x9e - \x84\x9f - \x84\xa0 - \x84\xa1 - \x84\xa2 - \x84\xa3 - \x84\xa4 - \x84\xa5 - \x84\xa6 - \x84\xa7 - \x84\xa8 - \x84\xa9 - \x84\xaa - \x84\xab - \x84\xac - \x84\xad - \x84\xae - \x84\xaf - \x84\xb0 - \x84\xb1 - \x84\xb2 - \x84\xb3 - \x84\xb4 - \x84\xb5 - \x84\xb6 - \x84\xb7 - \x84\xb8 - \x84\xb9 - \x84\xba - \x84\xbb - \x84\xbc - \x84\xbd - \x84\xbe - \x84\xbf - \x84\xc0 - \x84\xc1 - \x84\xc2 - \x84\xc3 - \x84\xc4 - \x84\xc5 - \x84\xc6 - \x84\xc7 - \x84\xc8 - \x84\xc9 - \x84\xca - \x84\xcb - \x84\xcc - \x84\xcd - \x84\xce - \x84\xcf - \x84\xd0 - \x84\xd1 - \x84\xd2 - \x84\xd3 - \x84\xd4 - \x84\xd5 - \x84\xd6 - \x84\xd7 - \x84\xd8 - \x84\xd9 - \x84\xda - \x84\xdb - \x84\xdc - \x84\xe5 - \x84\xe6 - \x84\xe7 - \x84\xe8 - \x84\xe9 - \x84\xea - \x84\xeb - \x84\xec - \x84\xed - \x84\xee - \x84\xef - \x84\xf0 *** 17727 LINES SKIPPED *** From nobody Wed Dec 20 07:15:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw4b33PGfz55BsS; Wed, 20 Dec 2023 07:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw4b32qPqz4X7v; Wed, 20 Dec 2023 07:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703056527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGmGXuVan4QovVLJahPuid1SgdAiKz3W84OYebUBXMI=; b=Qft2iuyZnciHq8hV2Xp2QgcROSLop58sChGM3aPiRNAcv48hwUyC9TMP20agLtTc+3fuQ7 /lhTlmxAR6I2CmNsuvSeApcoh3pSbi+2jrs2m9lU9HGfwvcFVlPnc24HyiWILgsNHdQRkk ZJ/2uLSMUCj9w86D8gIYMICFANF/oMwkDdPg13rsK2AetmY0G7gcMYcUdTnOLIMJZkjhGy yEreIjiBxTb2sBgzRHSwqfdj/rkpMUQ+xGGwNJ7pnBmiS57dtSumAcrnV+LKXLXSR7be/5 b2ZuTS/DefQXto0zN2ZKPURak295gwPj3t6hsvxuksjRyZxkXeKl+/fve6a3dw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703056527; a=rsa-sha256; cv=none; b=VfSSr9TWhvXW1Y2g4ffX9dM+nTLS8W1qZGomyNaK5vPXzRzqzlBXx7r1kKusGdBVxFVJbv 3gHU11X2Jj5jbc+aweI7HcjJMyYzOtoIiFOA4diposqbpi8FxDi1YaxBB7nhnnGcCXC+YN noDXIIBfG5cP7+2LtYe2hoSYFQQz4AC44Z5Tto6C1jTYWu1ZFAyYZ+5qewbBd0iaGq7w6R vGx6j4atnekLJ5ENMncnHiaBHKNZCc8uu9n1tX297Qe/TbUoxvwBP8U7GleJMIVMb4Mwpk g9K1GLb2xXRW6l5uitfXMA2W7tRUantARR8ssp+oampkRZdJHCsWELKZmwmwJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703056527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IGmGXuVan4QovVLJahPuid1SgdAiKz3W84OYebUBXMI=; b=gc+Ia/zqTUNFA29/9tnFFh+mQ7qVoNPTEuKWt3H3LTRdSJGUiejep+qq/KDL740ckWAaP7 vieP6f6qIPRcGqI3yMPk8msNuWFNM1WEyUTl56vZRhhJ+0qUK63eGMAnux3B0Yh8AxHZm1 vi8WlvoDJvPDFMSt4yeW2X28/BtCNfmmksNhd5Ejg4eNWq6FQf0gmyEvMuaqLqq7C7yOM/ duJ1Zn0MLkVO1Nl3gnFEVsEK1IjhrupkOl05Y7Mtr+Qo7bQ2x9TCXuRffGw6xoVpKzcaKG HhIIXWv3sL4q2W0tK8Lf6nmNK+BMY3+bypi0aPmDVUSUaI/Cerm8UwScEaqfLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw4b31qt4zfyY; Wed, 20 Dec 2023 07:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK7FRcS005740; Wed, 20 Dec 2023 07:15:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK7FQfA005737; Wed, 20 Dec 2023 07:15:26 GMT (envelope-from git) Date: Wed, 20 Dec 2023 07:15:26 GMT Message-Id: <202312200715.3BK7FQfA005737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: 7d413ee80522 - main - Revert "locale: regenerate SJIS charmap from CLDR" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d413ee805224ff5e93e9ef117207f19b70d0522 Auto-Submitted: auto-generated The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=7d413ee805224ff5e93e9ef117207f19b70d0522 commit 7d413ee805224ff5e93e9ef117207f19b70d0522 Author: Yuri Pankov AuthorDate: 2023-12-20 07:14:27 +0000 Commit: Yuri Pankov CommitDate: 2023-12-20 07:14:27 +0000 Revert "locale: regenerate SJIS charmap from CLDR" ...as it broke colldef build. This reverts commit a4a9d2a64a4ded0adf27cbc1af82669112c41887. --- tools/tools/locale/etc/final-maps/map.SJIS | 18682 +++++++++++++++++---------- 1 file changed, 11497 insertions(+), 7185 deletions(-) diff --git a/tools/tools/locale/etc/final-maps/map.SJIS b/tools/tools/locale/etc/final-maps/map.SJIS index 3b3ab012e0ec..9660417ca05e 100644 --- a/tools/tools/locale/etc/final-maps/map.SJIS +++ b/tools/tools/locale/etc/final-maps/map.SJIS @@ -1,7188 +1,11500 @@ -###################### -# POSIX charmap -# Generated automatically from the Unicode Character Database and Common Locale Data Repository -# see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html -# charset: SJIS -###################### -################################################################################################# -# Copyright © 1991-2023 Unicode, Inc. -# For terms of use, see http://www.unicode.org/copyright.html -# SPDX-License-Identifier: Unicode-DFS-2016 -# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) - "SJIS" - 1 - 2 - + 1 + 2 CHARMAP - \x00 - \x00 - \x01 - \x01 - \x02 - \x02 - \x03 - \x03 - \x04 - \x04 - \x05 - \x05 - \x06 - \x06 - \x07 - \x07 - \x08 - \x08 - \x09 - \x09 - \x0A - \x0A - \x0B - \x0B - \x0C - \x0C - \x0D - \x0D - \x0E - \x0E - \x0F - \x0F - \x10 - \x10 - \x11 - \x11 - \x12 - \x12 - \x13 - \x13 - \x14 - \x14 - \x15 - \x15 - \x16 - \x16 - \x17 - \x17 - \x18 - \x18 - \x19 - \x19 - \x1A - \x1A - \x1B - \x1B - \x1C - \x1C - \x1D - \x1D - \x1E - \x1E - \x1F - \x1F - \x20 - \x20 - \x21 - \x22 - \x23 - \x24 - \x25 - \x26 - \x27 - \x28 - \x29 - \x2A - \x2B - \x2C - \x2D - \x2E - \x2F - \x30 - \x30 - \x31 - \x31 - \x32 - \x32 - \x33 - \x33 - \x34 - \x34 - \x35 - \x35 - \x36 - \x36 - \x37 - \x37 - \x38 - \x38 - \x39 - \x39 - \x3A - \x3B - \x3C - \x3D - \x3E - \x3F - \x40 - \x41 - \x41 - \x42 - \x42 - \x43 - \x43 - \x44 - \x44 - \x45 - \x45 - \x46 - \x46 - \x47 - \x47 - \x48 - \x48 - \x49 - \x49 - \x4A - \x4A - \x4B - \x4B - \x4C - \x4C - \x4D - \x4D - \x4E - \x4E - \x4F - \x4F - \x50 -

\x50 - \x51 - \x51 - \x52 - \x52 - \x53 - \x53 - \x54 - \x54 - \x55 - \x55 - \x56 - \x56 - \x57 - \x57 - \x58 - \x58 - \x59 - \x59 - \x5A - \x5A - \x5B - \x5C - \x5D - \x5E - \x5F - \x60 - \x61 - \x61 - \x62 - \x62 - \x63 - \x63 - \x64 - \x64 - \x65 - \x65 - \x66 - \x66 - \x67 - \x67 - \x68 - \x68 - \x69 - \x69 - \x6A - \x6A - \x6B - \x6B - \x6C - \x6C - \x6D - \x6D - \x6E - \x6E - \x6F - \x6F - \x70 -

\x70 - \x71 - \x71 - \x72 - \x72 - \x73 - \x73 - \x74 - \x74 - \x75 - \x75 - \x76 - \x76 - \x77 - \x77 - \x78 - \x78 - \x79 - \x79 - \x7A - \x7A - \x7B - \x7C - \x7D - \x7E - \x7F - \x7F - \x81\x40 - \x81\x41 - \x81\x42 - \x81\x43 - \x81\x44 - \x81\x45 - \x81\x46 - \x81\x47 - \x81\x48 - \x81\x49 - \x81\x4A - \x81\x4B - \x81\x4C - \x81\x4D - \x81\x4E - \x81\x4F - \x81\x50 - \x81\x51 - \x81\x52 - \x81\x53 - \x81\x54 - \x81\x55 - \x81\x56 - \x81\x57 - \x81\x58 - \x81\x59 - \x81\x5A - \x81\x5B - \x81\x5C - \x81\x5D - \x81\x5E - \x81\x5F - \x81\x60 - \x81\x61 - \x81\x62 - \x81\x63 - \x81\x64 - \x81\x65 - \x81\x66 - \x81\x67 - \x81\x68 - \x81\x69 - \x81\x6A - \x81\x6B - \x81\x6C - \x81\x6D - \x81\x6E - \x81\x6F - \x81\x70 - \x81\x71 - \x81\x72 - \x81\x73 - \x81\x74 - \x81\x75 - \x81\x76 - \x81\x77 - \x81\x78 - \x81\x79 - \x81\x7A - \x81\x7B - \x81\x7C - \x81\x7D - \x81\x7E - \x81\x80 - \x81\x81 - \x81\x82 - \x81\x83 - \x81\x84 - \x81\x85 - \x81\x86 - \x81\x87 - \x81\x88 - \x81\x89 - \x81\x8A - \x81\x8B - \x81\x8C - \x81\x8D - \x81\x8E - \x81\x8F - \x81\x90 - \x81\x91 - \x81\x92 - \x81\x93 - \x81\x94 - \x81\x95 - \x81\x96 - \x81\x97 - \x81\x98 - \x81\x99 - \x81\x9A - \x81\x9B - \x81\x9C - \x81\x9D - \x81\x9E - \x81\x9F - \x81\xA0 - \x81\xA1 - \x81\xA2 - \x81\xA3 - \x81\xA4 - \x81\xA5 - \x81\xA6 - \x81\xA7 - \x81\xA8 - \x81\xA9 - \x81\xAA - \x81\xAB - \x81\xAC - \x81\xB8 - \x81\xB9 - \x81\xBA - \x81\xBB - \x81\xBC - \x81\xBD - \x81\xBE - \x81\xBF - \x81\xC8 - \x81\xC9 - \x81\xCA - \x81\xCB - \x81\xCC - \x81\xCD - \x81\xCE - \x81\xDA - \x81\xDB - \x81\xDC - \x81\xDD - \x81\xDE - \x81\xDF - \x81\xE0 - \x81\xE1 - \x81\xE2 - \x81\xE3 - \x81\xE4 - \x81\xE5 - \x81\xE6 - \x81\xE7 - \x81\xE8 - \x81\xF0 - \x81\xF1 - \x81\xF2 - \x81\xF3 - \x81\xF4 - \x81\xF5 - \x81\xF6 - \x81\xF7 - \x81\xFC - \x82\x4F - \x82\x50 - \x82\x51 - \x82\x52 - \x82\x53 - \x82\x54 - \x82\x55 - \x82\x56 - \x82\x57 - \x82\x58 - \x82\x60 - \x82\x61 - \x82\x62 - \x82\x63 - \x82\x64 - \x82\x65 - \x82\x66 - \x82\x67 - \x82\x68 - \x82\x69 - \x82\x6A - \x82\x6B - \x82\x6C - \x82\x6D - \x82\x6E - \x82\x6F - \x82\x70 - \x82\x71 - \x82\x72 - \x82\x73 - \x82\x74 - \x82\x75 - \x82\x76 - \x82\x77 - \x82\x78 - \x82\x79 - \x82\x81 - \x82\x82 - \x82\x83 - \x82\x84 - \x82\x85 - \x82\x86 - \x82\x87 - \x82\x88 - \x82\x89 - \x82\x8A - \x82\x8B - \x82\x8C - \x82\x8D - \x82\x8E - \x82\x8F - \x82\x90 - \x82\x91 - \x82\x92 - \x82\x93 - \x82\x94 - \x82\x95 - \x82\x96 - \x82\x97 - \x82\x98 - \x82\x99 - \x82\x9A - \x82\x9F - \x82\xA0 - \x82\xA1 - \x82\xA2 - \x82\xA3 - \x82\xA4 - \x82\xA5 - \x82\xA6 - \x82\xA7 - \x82\xA8 - \x82\xA9 - \x82\xAA - \x82\xAB - \x82\xAC - \x82\xAD - \x82\xAE - \x82\xAF - \x82\xB0 - \x82\xB1 - \x82\xB2 - \x82\xB3 - \x82\xB4 - \x82\xB5 - \x82\xB6 - \x82\xB7 - \x82\xB8 - \x82\xB9 - \x82\xBA - \x82\xBB - \x82\xBC - \x82\xBD - \x82\xBE - \x82\xBF - \x82\xC0 - \x82\xC1 - \x82\xC2 - \x82\xC3 - \x82\xC4 - \x82\xC5 - \x82\xC6 - \x82\xC7 - \x82\xC8 - \x82\xC9 - \x82\xCA - \x82\xCB - \x82\xCC - \x82\xCD - \x82\xCE - \x82\xCF - \x82\xD0 - \x82\xD1 - \x82\xD2 - \x82\xD3 - \x82\xD4 - \x82\xD5 - \x82\xD6 - \x82\xD7 - \x82\xD8 - \x82\xD9 - \x82\xDA - \x82\xDB - \x82\xDC - \x82\xDD - \x82\xDE - \x82\xDF - \x82\xE0 - \x82\xE1 - \x82\xE2 - \x82\xE3 - \x82\xE4 - \x82\xE5 - \x82\xE6 - \x82\xE7 - \x82\xE8 - \x82\xE9 - \x82\xEA - \x82\xEB - \x82\xEC - \x82\xED - \x82\xEE - \x82\xEF - \x82\xF0 - \x82\xF1 - \x83\x40 - \x83\x41 - \x83\x42 - \x83\x43 - \x83\x44 - \x83\x45 - \x83\x46 - \x83\x47 - \x83\x48 - \x83\x49 - \x83\x4A - \x83\x4B - \x83\x4C - \x83\x4D - \x83\x4E - \x83\x4F - \x83\x50 - \x83\x51 - \x83\x52 - \x83\x53 - \x83\x54 - \x83\x55 - \x83\x56 - \x83\x57 - \x83\x58 - \x83\x59 - \x83\x5A - \x83\x5B - \x83\x5C - \x83\x5D - \x83\x5E - \x83\x5F - \x83\x60 - \x83\x61 - \x83\x62 - \x83\x63 - \x83\x64 - \x83\x65 - \x83\x66 - \x83\x67 - \x83\x68 - \x83\x69 - \x83\x6A - \x83\x6B - \x83\x6C - \x83\x6D - \x83\x6E - \x83\x6F - \x83\x70 - \x83\x71 - \x83\x72 - \x83\x73 - \x83\x74 - \x83\x75 - \x83\x76 - \x83\x77 - \x83\x78 - \x83\x79 - \x83\x7A - \x83\x7B - \x83\x7C - \x83\x7D - \x83\x7E - \x83\x80 - \x83\x81 - \x83\x82 - \x83\x83 - \x83\x84 - \x83\x85 - \x83\x86 - \x83\x87 - \x83\x88 - \x83\x89 - \x83\x8A - \x83\x8B - \x83\x8C - \x83\x8D - \x83\x8E - \x83\x8F - \x83\x90 - \x83\x91 - \x83\x92 - \x83\x93 - \x83\x94 - \x83\x95 - \x83\x96 - \x83\x9F - \x83\xA0 - \x83\xA1 - \x83\xA2 - \x83\xA3 - \x83\xA4 - \x83\xA5 - \x83\xA6 - \x83\xA7 - \x83\xA8 - \x83\xA9 - \x83\xAA - \x83\xAB - \x83\xAC - \x83\xAD - \x83\xAE - \x83\xAF - \x83\xB0 - \x83\xB1 - \x83\xB2 - \x83\xB3 - \x83\xB4 - \x83\xB5 - \x83\xB6 - \x83\xBF - \x83\xC0 - \x83\xC1 - \x83\xC2 - \x83\xC3 - \x83\xC4 - \x83\xC5 - \x83\xC6 - \x83\xC7 - \x83\xC8 - \x83\xC9 - \x83\xCA - \x83\xCB - \x83\xCC - \x83\xCD - \x83\xCE - \x83\xCF - \x83\xD0 - \x83\xD1 - \x83\xD2 - \x83\xD3 - \x83\xD4 - \x83\xD5 - \x83\xD6 - \x84\x40 - \x84\x41 - \x84\x42 - \x84\x43 - \x84\x44 - \x84\x45 - \x84\x46 - \x84\x47 - \x84\x48 - \x84\x49 - \x84\x4A - \x84\x4B - \x84\x4C - \x84\x4D - \x84\x4E - \x84\x4F - \x84\x50 - \x84\x51 - \x84\x52 - \x84\x53 - \x84\x54 - \x84\x55 - \x84\x56 - \x84\x57 - \x84\x58 - \x84\x59 - \x84\x5A - \x84\x5B - \x84\x5C - \x84\x5D - \x84\x5E - \x84\x5F - \x84\x60 - \x84\x70 - \x84\x71 - \x84\x72 - \x84\x73 - \x84\x74 - \x84\x75 - \x84\x76 - \x84\x77 - \x84\x78 - \x84\x79 - \x84\x7A - \x84\x7B - \x84\x7C - \x84\x7D - \x84\x7E - \x84\x80 - \x84\x81 - \x84\x82 - \x84\x83 - \x84\x84 - \x84\x85 - \x84\x86 - \x84\x87 - \x84\x88 - \x84\x89 - \x84\x8A - \x84\x8B - \x84\x8C - \x84\x8D - \x84\x8E - \x84\x8F - \x84\x90 - \x84\x91 - \x84\x9F - \x84\xA0 - \x84\xA1 - \x84\xA2 - \x84\xA3 - \x84\xA4 - \x84\xA5 - \x84\xA6 - \x84\xA7 - \x84\xA8 - \x84\xA9 - \x84\xAA - \x84\xAB - \x84\xAC - \x84\xAD - \x84\xAE - \x84\xAF - \x84\xB0 - \x84\xB1 - \x84\xB2 - \x84\xB3 - \x84\xB4 - \x84\xB5 - \x84\xB6 - \x84\xB7 - \x84\xB8 - \x84\xB9 - \x84\xBA - \x84\xBB - \x84\xBC - \x84\xBD - \x84\xBE - \x88\x9F - \x88\xA0 - \x88\xA1 - \x88\xA2 - \x88\xA3 - \x88\xA4 - \x88\xA5 - \x88\xA6 - \x88\xA7 - \x88\xA8 - \x88\xA9 - \x88\xAA - \x88\xAB - \x88\xAC - \x88\xAD - \x88\xAE - \x88\xAF - \x88\xB0 - \x88\xB1 - \x88\xB2 - \x88\xB3 - \x88\xB4 - \x88\xB5 - \x88\xB6 - \x88\xB7 - \x88\xB8 - \x88\xB9 - \x88\xBA - \x88\xBB - \x88\xBC - \x88\xBD - \x88\xBE - \x88\xBF - \x88\xC0 - \x88\xC1 - \x88\xC2 - \x88\xC3 - \x88\xC4 - \x88\xC5 - \x88\xC6 - \x88\xC7 - \x88\xC8 - \x88\xC9 - \x88\xCA - \x88\xCB - \x88\xCC - \x88\xCD - \x88\xCE - \x88\xCF - \x88\xD0 - \x88\xD1 - \x88\xD2 - \x88\xD3 - \x88\xD4 - \x88\xD5 - \x88\xD6 - \x88\xD7 - \x88\xD8 - \x88\xD9 - \x88\xDA - \x88\xDB - \x88\xDC - \x88\xDD - \x88\xDE - \x88\xDF - \x88\xE0 - \x88\xE1 - \x88\xE2 - \x88\xE3 - \x88\xE4 - \x88\xE5 - \x88\xE6 - \x88\xE7 - \x88\xE8 - \x88\xE9 - \x88\xEA - \x88\xEB - \x88\xEC - \x88\xED - \x88\xEE - \x88\xEF - \x88\xF0 - \x88\xF1 - \x88\xF2 - \x88\xF3 - \x88\xF4 - \x88\xF5 - \x88\xF6 - \x88\xF7 - \x88\xF8 - \x88\xF9 - \x88\xFA - \x88\xFB - \x88\xFC - \x89\x40 - \x89\x41 - \x89\x42 - \x89\x43 - \x89\x44 - \x89\x45 - \x89\x46 - \x89\x47 - \x89\x48 - \x89\x49 - \x89\x4A - \x89\x4B - \x89\x4C - \x89\x4D - \x89\x4E - \x89\x4F - \x89\x50 - \x89\x51 - \x89\x52 - \x89\x53 - \x89\x54 - \x89\x55 - \x89\x56 - \x89\x57 - \x89\x58 - \x89\x59 - \x89\x5A - \x89\x5B - \x89\x5C - \x89\x5D - \x89\x5E - \x89\x5F - \x89\x60 - \x89\x61 - \x89\x62 - \x89\x63 - \x89\x64 - \x89\x65 - \x89\x66 - \x89\x67 - \x89\x68 - \x89\x69 - \x89\x6A - \x89\x6B - \x89\x6C - \x89\x6D - \x89\x6E - \x89\x6F - \x89\x70 - \x89\x71 - \x89\x72 - \x89\x73 - \x89\x74 - \x89\x75 - \x89\x76 - \x89\x77 - \x89\x78 - \x89\x79 - \x89\x7A - \x89\x7B - \x89\x7C - \x89\x7D - \x89\x7E - \x89\x80 - \x89\x81 - \x89\x82 - \x89\x83 - \x89\x84 - \x89\x85 - \x89\x86 - \x89\x87 - \x89\x88 - \x89\x89 - \x89\x8A - \x89\x8B - \x89\x8C - \x89\x8D - \x89\x8E - \x89\x8F - \x89\x90 - \x89\x91 - \x89\x92 - \x89\x93 - \x89\x94 - \x89\x95 - \x89\x96 - \x89\x97 - \x89\x98 - \x89\x99 - \x89\x9A - \x89\x9B - \x89\x9C - \x89\x9D - \x89\x9E - \x89\x9F - \x89\xA0 - \x89\xA1 - \x89\xA2 - \x89\xA3 - \x89\xA4 - \x89\xA5 *** 17723 LINES SKIPPED *** From nobody Wed Dec 20 07:35:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw52L6WB7z55F3B; Wed, 20 Dec 2023 07:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw52L1hF8z3TXY; Wed, 20 Dec 2023 07:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703057738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKHwtPXQam1xcBHFcw1EPPNrh8/b+M2Ctssd9jdgaJQ=; b=P2lAyQA789c2xz+TbE+b3CIcxrJB8uP4KVHelOaZSsExPY+VWBdpteWmKmCydvplt4Bv9n p4UM3s7cQw6kkZ5tydScPrtj+tDGr/BPB7s5YsNcnzAKq/LMIfedRXlEHu/6IOkvHnoZT+ MAIIlPTQUWhJyL3VWwY6wE7S6k961H67LNSNrlX/A+d71I5Ul777CFDdGwBxB9ylfNxqy1 TRMfAn0RBHx0gGf129Jr8aRd6OOHfAeSecvSfnZlqma1M5BplS/oPukCWGmza+QmIE8yC4 +v5Mxhx58WiMHBP5bOAf+44dFxfM4e9sBlk73f0iQ+UOtiFeQ48H75Sv/2GoaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703057738; a=rsa-sha256; cv=none; b=vXsVECqkakzMU6pJ5x3y5h530CLAxLj4vlXaCUs/KAsst2An9dMuN9eFyivk7r4dNaCpTK p3MSNtI0yDo5DXvZDRiJR74heARHgw/+MyCh5hSUUUKNqeCV9A8cRyLkX6QZNGULK0ZGOX 2/1CGQ0WcTxmJsJv4ftiCA3QO8Kp5CyAWGNasGptHxguIKMzMNMDdDwdD019ud2fJj3Dpa MNCc28v6IZDsULXQi7bxeGMxhY70I0n94bLLF4JVgvpvdyvWaj7oIj4S995cC6qeptx3Oe plGeiSrl03/GvSNpds9OSJjdr4vmM61Ldl0jnRhyktEYISZH9xa2pI9R7HdWgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703057738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKHwtPXQam1xcBHFcw1EPPNrh8/b+M2Ctssd9jdgaJQ=; b=MNQqPMRnf/PaIPy3V2FUZKt6RdjKrTiNYuNsYgykjLVwQzJGipDsCw96I9i2qag9uMI0Po uDegGgGI94fTLV5mbotlVA8zw5JNjwtoJMMsyPh4taRmWfoopdNXchMTDUk9m8Q4zUx+6T dBSoYOMfqF/H04vjp8cE2SfVkrlPOqwmCdJ7kop/7mfEqX0cf4g87hEcZ6cUFOfj78bE/o +Flcx8GJCJ0vE5zT56Y5u5jD4SfVyiRBBnbYSvupQcnGrgX+mgqS5GuYZ09s7dwSmfYdSY vbV6PP6mcRwNdQo66KUmSurGwG7uEd40fCeljdF1f0093BUB5nMttBsglgqhvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw52L0j16zgKK; Wed, 20 Dec 2023 07:35:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK7ZcQC039265; Wed, 20 Dec 2023 07:35:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK7ZcMi039262; Wed, 20 Dec 2023 07:35:38 GMT (envelope-from git) Date: Wed, 20 Dec 2023 07:35:38 GMT Message-Id: <202312200735.3BK7ZcMi039262@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: 2ad07dc6ceaf - stable/14 - qat: Fix two typos in source code 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 2ad07dc6ceafa2e2542448d5e938883f1a59aeb6 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=2ad07dc6ceafa2e2542448d5e938883f1a59aeb6 commit 2ad07dc6ceafa2e2542448d5e938883f1a59aeb6 Author: Gordon Bergling AuthorDate: 2023-12-17 14:18:57 +0000 Commit: Gordon Bergling CommitDate: 2023-12-20 07:35:25 +0000 qat: Fix two typos in source code comments - s/parmeters/parameters/ (cherry picked from commit ada4cd3f7710d9759e391e84ad21b7763062bdbc) --- sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h | 2 +- sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h index 934ad2520774..370b7e2397c4 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym.h @@ -1194,7 +1194,7 @@ cpaCySymSessionCtxGetSize(const CpaInstanceHandle instanceHandle, * minimum memory size needed to support all possible setup data parameter * combinations. cpaCySymSessionCtxGetDynamicSize() will return the * minimum memory size needed to support the specific session setup - * data parmeters provided. This size may be different for different setup + * data parameters provided. This size may be different for different setup * data parameters. * * @context diff --git a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h index 479cb72c2cf2..7f103ec98e51 100644 --- a/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h +++ b/sys/dev/qat/qat_api/include/lac/cpa_cy_sym_dp.h @@ -559,7 +559,7 @@ cpaCySymDpSessionCtxGetSize(const CpaInstanceHandle instanceHandle, * minimum memory size needed to support all possible setup data parameter * combinations. cpaCySymDpSessionCtxGetDynamicSize() will return the * minimum memory size needed to support the specific session setup - * data parmeters provided. This size may be different for different setup + * data parameters provided. This size may be different for different setup * data parameters. * * @context From nobody Wed Dec 20 08:30:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw6FW2ddSz54cNT; Wed, 20 Dec 2023 08:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw6FW1fhyz4LrW; Wed, 20 Dec 2023 08:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703061023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YZorguoJgwUPBCxVdE6P9FQY9hLCmTj5Tcz9P0M+Gf8=; b=F0fhGgTpOb+riIU/UbsmUH0ve4w5M5wuishPMcXQkIKBknHKnoRZLJT51a95rwjfaUJeLo AcxFRyz6gZZKdQ9KeT+ItvHlyfztltKsZZyx0p6EOztY8wJvh1iR3TDTUblhs3d3ypH4Lr DdYBJm6FhEDmLiJa0a0zCah0bLEondy8W0FhKcrZiOxLCAgYQ7flqYVVQRmq621UvmRHmy lmE7jpy3283fgrvkwjYifSsPnrCKPFS8tJ9Eqe/d0f+YvcSPlxsEceRVjccbXjm4kPmY1e v96UUHRiumPZKT5rXFOmm2NA5RjdcWj10TsIXc2LHTpEMJ3tReHKjF0ywc7u2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703061023; a=rsa-sha256; cv=none; b=ESGzr0kgP+PILfwCY3CewhEvQM37yap4UC7jE/B+wGrFxLJjVvGR3AQnO4dGFVWFoZpuFw 9m/x+k1Vsu2ibwu48HGLBD/KZp7f6Gs7LRykuTuFeBKDWhJsNwpYzaqvqjJEeDNUIPb6pC WGaguWfN56PIR9/ASYvT/EiocubqMlrk7w6mjU2KRTM+hH6u81LFEtAldWyM+NQqzax1lE MNu/OANCPpGQ8H/f9lQzFHwC3425/HObA7jhsp8dmtdXIC+LMv80YvdvKlBrqDo+ZeNsME xhnEHKqS3mfjfyWRC7S4sRc2UoYIFAhXEjFTNNuVIA6HdAJLXk4lEcU2LFDVFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703061023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YZorguoJgwUPBCxVdE6P9FQY9hLCmTj5Tcz9P0M+Gf8=; b=gLqCqRutuQ7LZH+YVzYPWpM6mjrSkNi9YlqL98Eeadfi+78GVizvqbLU4XnUudqGvroyJT Z2yrf5JvQGS8ozXcevPAsUNfVhIhLCn24koeHkyIDKCWnI9W82T/n6+6sJCdnGNxKCCPk4 nK1oFsHC+8oQWKenB/5nVutOeDnymyVCK/yzg6iqnhnouvU75wUuQwS1H+FEaGqiPxRk5j v5mTp8nq5sdbbjnireu5SDWXVcNBZPaSOj+UVF+m3RWzfkbnnh9zzSm3nPlVviSUrUHA4J EKCqxi9zjfDVxfiE2QlHKZdp3ZZGD/2OhqTNV7pxKCkI80C5WRhN1/ucB5iWdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw6FW0ZNjzhFf; Wed, 20 Dec 2023 08:30:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK8UMH4033524; Wed, 20 Dec 2023 08:30:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK8UMNx033521; Wed, 20 Dec 2023 08:30:22 GMT (envelope-from git) Date: Wed, 20 Dec 2023 08:30:22 GMT Message-Id: <202312200830.3BK8UMNx033521@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: ddb82f214f0c - stable/14 - ufs: do not leave around empty buffers shadowing disk content List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ddb82f214f0cd5171f9830a6d28b75e8ded98613 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ddb82f214f0cd5171f9830a6d28b75e8ded98613 commit ddb82f214f0cd5171f9830a6d28b75e8ded98613 Author: Konstantin Belousov AuthorDate: 2023-12-11 22:57:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-20 08:29:55 +0000 ufs: do not leave around empty buffers shadowing disk content (cherry picked from commit ca39f23347e1416a28dde13279bfe5841ad9a746) --- sys/ufs/ffs/ffs_vnops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 2b11a15c46c9..c14cb5e1ee66 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -981,8 +981,15 @@ ffs_write( * validated the pages. */ if (error != 0 && (bp->b_flags & B_CACHE) == 0 && - fs->fs_bsize == xfersize) - vfs_bio_clrbuf(bp); + fs->fs_bsize == xfersize) { + if (error == EFAULT && LIST_EMPTY(&bp->b_dep)) { + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + brelse(bp); + break; + } else { + vfs_bio_clrbuf(bp); + } + } vfs_bio_set_flags(bp, ioflag); From nobody Wed Dec 20 08:30:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw6FX2wDQz54cT1; Wed, 20 Dec 2023 08:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw6FX16WTz4LvN; Wed, 20 Dec 2023 08:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703061024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FfVNasyP9dbVtYqNJYKPCUZEYOSYFKqWlJt2JHLmofo=; b=oRao8jOHkIYRjJWyaMHUn6E99AuIRhCgNfXuAPPIoH4/pecqaDuii0BZOH0eWtDwd2QZ50 vxNbfDScPL1n7RV+z6FQ9n7H/7X0oZiXz3rBhRi68H2Asiemk5+WkoxMqaJG1PitwXNSz9 JXUtsokUJYgemhVEhHqCxksk9WTE4undfxGuk7INOMkuNWjEw0496uxDsxv8qOjy7ArdwG R3g8xyq/hIM9+4FWmbc07BVEScL2KfryUJ+QAPwgEN6sXlh7foeYMGy3TB+k8cv3DK3ECV 3P7dc4ArOcKOGEg5wMN96Jv0CGilaSVqwy3aE3YkbaLAdjMETspViaBRB0xRZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703061024; a=rsa-sha256; cv=none; b=RprO9ffAGrIIp/A2iBbz11H+9dAVzimeI0qzD1LAi25xxlzZIBmKFGa+8FFFajKSyoMHFf +waPdFcQeDJ+LJvtm10niqJnKJpTKef4/+/XhT1shYFuOwmZOA1rjvayc2m2YSA4/W0Qzb 2EWUQNfBr9NSVp3hrUcyFW+DUMDj+SPggID66ZKDMhGMDmsinWgLTYcyrESSWiYQoEqu3R 8DAxzDh2kOW5L6G0xE8nIsnqamn74BqoPdsSUHNtmMxbrszDFqRNzJlVkJh6y+/rAkJwPj nqBAfYyuQYKSu4jjhH35spjXoSgAXM9iTI9dnuha8+68G7gtPbP3Scb5tR5c5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703061024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FfVNasyP9dbVtYqNJYKPCUZEYOSYFKqWlJt2JHLmofo=; b=mteKtoijbSxHCxwbr8fvVMHUmoYK+olDDuH/rmMMCG4WP9zUNcXiFjuK8TLG166oKewbSH CnOAw75DfiIop5e/Z8yuCh7mWGZV5+vVAN1O4ysS40kIdkXnFu/2rMnE+BoyEI4Y11ItOT ZZKvjrJz4NpNO1ftha5Zqm5kUyMlhtTAPjUQLs4QFMBuoxtTUpDGm+RtWwfiHRQK6+8vFO QtxMiqP6IB9G3TKFFehOD9K3NYJ6ZivhuAosJaFd/P36oQeHScjVVhMDeaoPG0736kXxQN 4bZbxGNApcBnbbq9yrK95DCh84yGkfpb0U88MQn5f+kKrkjv33zYyUGXtXVB7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw6FX03F3zh66; Wed, 20 Dec 2023 08:30:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK8UNiM033585; Wed, 20 Dec 2023 08:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK8UNSM033582; Wed, 20 Dec 2023 08:30:23 GMT (envelope-from git) Date: Wed, 20 Dec 2023 08:30:23 GMT Message-Id: <202312200830.3BK8UNSM033582@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: e373880312fb - stable/14 - libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e373880312fb8ea09c501975e1fd23234a0df1e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e373880312fb8ea09c501975e1fd23234a0df1e3 commit e373880312fb8ea09c501975e1fd23234a0df1e3 Author: Peter Eriksson AuthorDate: 2023-12-17 22:03:13 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-20 08:29:55 +0000 libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3) PR: 275232 (cherry picked from commit 7aa375dcc61e48cc56da45c9d5a11371693c8043) --- lib/libc/posix1e/acl_to_text_nfs4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/posix1e/acl_to_text_nfs4.c b/lib/libc/posix1e/acl_to_text_nfs4.c index d901b1cf6b88..157215c9dd52 100644 --- a/lib/libc/posix1e/acl_to_text_nfs4.c +++ b/lib/libc/posix1e/acl_to_text_nfs4.c @@ -72,6 +72,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "user:%d", (unsigned int)*id); else snprintf(str, size, "user:%s", pwd->pw_name); + acl_free(id); break; case ACL_GROUP_OBJ: @@ -91,6 +92,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "group:%d", (unsigned int)*id); else snprintf(str, size, "group:%s", grp->gr_name); + acl_free(id); break; case ACL_EVERYONE: @@ -157,6 +159,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry) if (id == NULL) return (-1); snprintf(str, size, ":%d", (unsigned int)*id); + acl_free(id); } return (0); From nobody Wed Dec 20 09:06:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sw73D2M9yz54gGW; Wed, 20 Dec 2023 09:06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sw73D1lkbz3Wst; Wed, 20 Dec 2023 09:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703063192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zby8UlwFAeukf/GUpKo2CiIPJe3vkkGU2Ns1nDyQEEI=; b=L7NB/F10VGef60p0sHiwzIegPQCqHmORZFz+jvzSBvJtU3E42nm0SY0adLmfz1SDLVRcXC LO1AgtSu8XegbPw2iiF2JGtOf3zSt2DjIQHP5roPutmY873oVovz5/ob/vNZJd9J4AgivO NpmOC2mMRRBg2yTQyG4vQPgigmwp12MGD+E1z84uz34tqce+4yjL+uWPwrNTl7enisl6S2 S6dlHql83jmC1uMzpYCMJugHaq7g1hpoIgG/Ju9f3FHe8NEosCYEC0vYPBMZncNO0IaK0N h69rJm8HV7VNZCKWceeU0NKzBrnJTSxhiu4VOt60tEhPjk4+SfJBUDxQ7yZZxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703063192; a=rsa-sha256; cv=none; b=vSNGz/oxyxjqjmEBuEXLmYMlg4HTeOGU0VdJpKZomNgWsGFsUWy+TZ7g7ALTyr6hk6TCPh diNpY6Mg1y4iiwA6zl0Br9zu14w6lVYuJykaT0WJS9nLkv6H+yMS8fxdJhCnFQf7oEC4fS VTkNrRwWHFSoB9WJ1XwVQKSg7mXfNLPNVPRF7Xxy0B6w0gXOIS8cuOx155CmfKHRansOZX AHtGqWBo314SI2LT1ZqwXlhVuKgI8mVdgdrGobUKOSsQakjwGQugEBuJVaiATmHtA+nefQ xPyG6YDH8WiwImtm2/aUOTQwff4eVIDevSnBC2qqXMSiIsenu2B1osShKjtmhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703063192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zby8UlwFAeukf/GUpKo2CiIPJe3vkkGU2Ns1nDyQEEI=; b=Q/5yBrba5pVErniPUn9B29sKQaARM6ibXZEVGTVi9EKWi1lUASTYkjLA09Q1yd2pANsznz JMLSbS1KB+ILgmBif6F/xKkBd+HwgX+3emrzFx49ZhUg0QR0KHpc3gkqK3SoyghOAJWEjt APZWkqVsZCEMtPwo82VfvaRhCnaWL0Umcr0tD08J6oVkNpP5ba7WHiBhBANulveVkVRMy8 Tpo9RV90sKzEuhZluMBGIpa8AFJUEKBFcnXnc51Hmi8Aesdx90FdEpprscqRZBBPUCOsJX dmz5g3DgFliLKYYnclgHPWK8qigbvX4gAyLAxrJHdifqY0lXBdokfNC9EFECgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sw73D0qdgzjXV; Wed, 20 Dec 2023 09:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BK96WGp092298; Wed, 20 Dec 2023 09:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BK96Wkn092295; Wed, 20 Dec 2023 09:06:32 GMT (envelope-from git) Date: Wed, 20 Dec 2023 09:06:32 GMT Message-Id: <202312200906.3BK96Wkn092295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: fa826f64e1b7 - main - rtnetlink.4: Fix a typo in the manual pag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: fa826f64e1b7167dde2c3cb8cfc4df0d3e503542 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=fa826f64e1b7167dde2c3cb8cfc4df0d3e503542 commit fa826f64e1b7167dde2c3cb8cfc4df0d3e503542 Author: Gordon Bergling AuthorDate: 2023-12-20 09:06:08 +0000 Commit: Gordon Bergling CommitDate: 2023-12-20 09:06:08 +0000 rtnetlink.4: Fix a typo in the manual pag - s/constists/consists/ MFC after: 3 days --- share/man/man4/rtnetlink.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 95cfeea39f5b..720a9cc75ef2 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -236,7 +236,7 @@ Should be provided by userland at the nexthtop creation time. .It Dv NHA_GROUP This attribute designates the nexthtop group and contains all of its nexthtops and their relative weights. -The attribute constists of a list of +The attribute consists of a list of .Va nexthop_grp structures: .Bd -literal From nobody Wed Dec 20 15:42:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwHrY3Qx5z555BK; Wed, 20 Dec 2023 15:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwHrY2SfQz4gHQ; Wed, 20 Dec 2023 15:42:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703086973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IjTFNi6Kc58dNlWmJ+sI6QiHca8s/GimaQsd5Jc7lwc=; b=dV9S0ZOToaYB8FzjfsICdguogQ/4+FQaxcoifwb/CBXiuq/A1PDLg5TheduZjG5De3llxm rYPCnzpFlc5W75Algsfg3km5wIneYA2LtyODVcaM4nwKSLWWw0QbORgeu2GWlNISFii9uA N3Nqfl35KtFYX68Xwy3BLU/JAKEoNz5POVesOhS1CeG4AvU59cARQb1jr0T0jJlacXn6ag l4KjQdgBnvBDW08kRoV+dRC/PAxvwGam6Npb3kSvpmYkamPTWkyNvdTn4Q7Lkp18ik6Aqa wJd8bLQ4OuVPNGwucgKGW03KvNwxgWc2Rn4E4j1Ygwdt1e9XcwR1x6GozHODiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703086973; a=rsa-sha256; cv=none; b=sK4wuHULPQK2l773SefQX6SaQEq51JoX7Z8l1nxP0qGjtdyzuNwO+Ct4zBnqJaUjwpEMzl Us8Q5muFw1LZ6Rt4b8j+1nh4xAMV9pjYCMV7SM/WT6HscF/lPFBJEnyVBwZ9a5AoTcXFk7 dh32MXbolx34I/3YBQsn6RxVD0Ys2c+QcLdcP9GjISeDa5w9JQfKwwTYMe4QzL6AVAXa+Y d7JKuIre9a1C5C7PgFVFpUoE+l3tu4P/lpijVeR+CFPnPBv6TEQvU4pV7GcEzz1h/QDzPl VY3b62iY1hUFf2CWcYbwUxS/jT6DfbcnUneZYN0Qpb4GBUs0tICo3uCQ9DdS9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703086973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IjTFNi6Kc58dNlWmJ+sI6QiHca8s/GimaQsd5Jc7lwc=; b=d9fFyKyg7hinSIj0M0DxYFihmEdpp8E5ncrN/QBOsoACrbkJ6H2scu/qD5GyxK0cM++xuR YOd1gjX04BsnHvMwrDK7uI3yIdK4TXixOoGzpKQ9zTG7d/OZjfdUSQNKENwRaPA2wPyUsk 7dOm6aRzTFtnn7V7ZaDzPEw0iOCsXGBUlGLW7D2fk2FiAq4B1vsI9pvBgIR4n/nKkN1iWJ rJ67qMXM+2tBgNkOxGT+ZO5M+9TnSylmZca02hz74Gm7+WyhAn9ZzdAFz4JrK6Q9d+wtw4 gvAsxoQBda1tvCiEBeDeAi6NIwAvFcXxjSwocUL9lFnQB1MRj5ldnzPpaYZn0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwHrY1Wfmztq1; Wed, 20 Dec 2023 15:42:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKFgrEO064026; Wed, 20 Dec 2023 15:42:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKFgrHn064023; Wed, 20 Dec 2023 15:42:53 GMT (envelope-from git) Date: Wed, 20 Dec 2023 15:42:53 GMT Message-Id: <202312201542.3BKFgrHn064023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Kenneth D. Merry" Subject: git: 504e85ade103 - stable/14 - mpr, mps: Establish busdma boundaries for memory pools List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 504e85ade103b0c2cafefb2d9dea86e94aef779f Auto-Submitted: auto-generated The branch stable/14 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=504e85ade103b0c2cafefb2d9dea86e94aef779f commit 504e85ade103b0c2cafefb2d9dea86e94aef779f Author: Kenneth D. Merry AuthorDate: 2023-12-14 20:05:17 +0000 Commit: Kenneth D. Merry CommitDate: 2023-12-20 15:40:42 +0000 mpr, mps: Establish busdma boundaries for memory pools Most all of the memory used by the cards in the mpr(4) and mps(4) drivers is required, according to the specs and Broadcom developers, to be within a 4GB segment of memory. This includes: System Request Message Frames pool Reply Free Queues pool ReplyDescriptorPost Queues pool Chain Segments pool Sense Buffers pool SystemReply message pool We got a bug report from Dwight Engen, who ran into data corruption in the BAE port of FreeBSD: > We have a port of the FreeBSD mpr driver to our kernel and recently > I found an issue under heavy load where a DMA may go to the wrong > address. The test system is a Supermicro X10SRH-CLN4F with the > onboard SAS3008 controller setup with 2 enterprise Micron SSDs in > RAID 0 (striped). I have debugged the issue and narrowed down that > the errant DMA is one that has a segment that crosses a 4GB > physical boundary. There are more details I can provide if you'd > like, but with the attached patch in place I can no longer > re-create the issue. > I'm not sure if this is a known limit of the card (have not found a > datasheet/programming docs for the chip) or our system is just > doing something a bit different. Any helpful info or insight would > be welcome. > Anyway, just thought this might be helpful info if you want to > apply a similar fix to FreeBSD. You can ignore/discard the commit > message as it is my internal commit (blkio is our own tool we use > to write/read every block of a device with CRC verification which > is how I found the problem). The commit message was: > [PATCH 8/9] mpr: fix memory corrupting DMA when sg segment crosses > 4GB boundary > Test case was two SSD's in RAID 0 (stripe). The logical disk was > then partitioned into two partitions. One partition had lots of > filesystem I/O and the other was initially filled using blkio with > CRCable data and then read back with blkio CRC verify in a loop. > Eventually blkio would report a bad CRC block because the physical > page being read-ahead into didn't contain the right data. If the > physical address in the arq/segs was for example 0x500003000 the > data would actually be DMAed to 0x400003000. The original patch was against mpr(4) before busdma templates were introduced, and only affected the buffer pool (sc->buffer_dmat) in the mpr(4) driver. After some discussion with Dwight and the LSI/Broadcom developers and looking through the driver, it looks like most of the queues in the driver are ok, because they limit the memory used to memory below 4GB. The buffer queue and the chain frames seem to be the exceptions. This is pretty much the same between the mpr(4) and mps(4) drivers. So, apply a 4GB boundary limitation for the buffer and chain frame pools in the mpr(4) and mps(4) drivers. Reported by: Dwight Engen Reviewed by: imp Obtained from: Dwight Engen Differential Revision: (cherry picked from commit 264610a86e14f8e123d94c3c3bd9632d75c078a3) --- sys/dev/mpr/mpr.c | 6 ++++-- sys/dev/mps/mps.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 23f7ff0c3e9a..d5c02f9608ca 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -1500,7 +1500,8 @@ mpr_alloc_requests(struct mpr_softc *sc) rsize = sc->chain_frame_size * sc->num_chains; bus_dma_template_init(&t, sc->mpr_parent_dmat); BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(rsize), - BD_MAXSEGSIZE(rsize), BD_NSEGMENTS((howmany(rsize, PAGE_SIZE)))); + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS((howmany(rsize, PAGE_SIZE))), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1552,7 +1553,8 @@ mpr_alloc_requests(struct mpr_softc *sc) BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), - BD_LOCKFUNCARG(&sc->mpr_mtx)); + BD_LOCKFUNCARG(&sc->mpr_mtx), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index f358ab8a73a9..adad2450a3d4 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -1431,7 +1431,8 @@ mps_alloc_requests(struct mps_softc *sc) rsize = sc->reqframesz * sc->num_chains; bus_dma_template_clone(&t, sc->req_dmat); BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(rsize), BD_MAXSEGSIZE(rsize), - BD_NSEGMENTS(howmany(rsize, PAGE_SIZE))); + BD_NSEGMENTS(howmany(rsize, PAGE_SIZE)), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1473,7 +1474,8 @@ mps_alloc_requests(struct mps_softc *sc) BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_24BIT), BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), - BD_LOCKFUNCARG(&sc->mps_mtx)); + BD_LOCKFUNCARG(&sc->mps_mtx), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); From nobody Wed Dec 20 15:44:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwHtH5rYfz554yK; Wed, 20 Dec 2023 15:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwHtH55Vmz4gxh; Wed, 20 Dec 2023 15:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703087063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFxylETIIGNfsaEZGOgrkwqLmVCySxP3u7PiXKnEU4E=; b=C0UOSWcmjBfbZ/M1pqKDHv2kf2z5dSze6f/YPpa2wwIF8eDnlDj6CpoBOLmvqxIfeSYztz 109xRTTkuFRwKkaI432VOCT6xdQSrzHQVq7bY2IKJ3n/DmMBLVCZFnveLqynmcNOvNj0Xx 7XvxOXEl5DjT4UqjcQCwt57O9/oDn9p9OjvfDZQBge6QhQ5mJvhXIKE+Uk6IwYgAwIOt3c H/khcjvyXaT86sVy8ZffjvFNAGyV1LfvdyhmgBOJ2XTiN+92jD5PHxDhLDJ2v31mvcT/BW liWFSxSdnCVRvhFf0Ua03uv5bIuEw1FZmY2Z/zqGfaUoP0f+QEKwV8ulkyFDwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703087063; a=rsa-sha256; cv=none; b=XclxMoMU+cXj22ooZzwsprMUqXmtkYz53A1Ala9KSW6SjVkqwzYyAPTSy8h70VWk7lWvcY ymuz94VIVWtlrtQ+JKmivAedYxElVQwiwah8wO/p3ftlXwyERu6YZV/GbbgZZVBWrBV4Wr +vc8Gf0h3yNl76zbhtBhe9o32MtWabuMW9PAWvqCHecJJJYN8eVekhQBwp316ix5GQTJ8o 2Y1V5zh6ngZJm02K1ZxP6Wj9vEd09o4fc0wZ6Yej+YF53wSRtSINjaFrDSDmWafpwxkVJH WImsGa9fAt8XddYchecqDBfZJse+Dmu9NnU5dlTvJU6nIhQ7Su4pQhVv2BI/gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703087063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFxylETIIGNfsaEZGOgrkwqLmVCySxP3u7PiXKnEU4E=; b=GetAXpfyvhyGwqxR3g0jx8PE6SRLDg/YV22jiQ5xAwmCFjafz+w4elwewDedFGypBxZAYX Gn2suo2QkxfwBAUuH+hawy9cic+IK+g9cg4kp0iqTS6T+fw4WQX/suPqWY7ni0dhuDrcue dzxN0Fd+nzx6J8Sbp2t68342Yyb0AKHYsCCU/+ugJOGt/LzOp6uYejCUGzE6THVDgZtChd eE860xyh+5zBvKLPP4a4HAttWtsppvR1fr2cd85Y8gloyzh4E9jCFYP4faUcrfarFuxF50 K7HBhnKr2KT5RQD4drLNFXSwDdzJaU493VXDH5GQsJa7Vxt0/UytU8RRUOUBtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwHtH49B5ztvn; Wed, 20 Dec 2023 15:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKFiNPM064556; Wed, 20 Dec 2023 15:44:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKFiN4l064553; Wed, 20 Dec 2023 15:44:23 GMT (envelope-from git) Date: Wed, 20 Dec 2023 15:44:23 GMT Message-Id: <202312201544.3BKFiN4l064553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Kenneth D. Merry" Subject: git: 5ffcdc96ac71 - stable/13 - mpr, mps: Establish busdma boundaries for memory pools List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ken X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ffcdc96ac71a54e33b86a13fe5b53ebf303f3af Auto-Submitted: auto-generated The branch stable/13 has been updated by ken: URL: https://cgit.FreeBSD.org/src/commit/?id=5ffcdc96ac71a54e33b86a13fe5b53ebf303f3af commit 5ffcdc96ac71a54e33b86a13fe5b53ebf303f3af Author: Kenneth D. Merry AuthorDate: 2023-12-14 20:05:17 +0000 Commit: Kenneth D. Merry CommitDate: 2023-12-20 15:43:21 +0000 mpr, mps: Establish busdma boundaries for memory pools Most all of the memory used by the cards in the mpr(4) and mps(4) drivers is required, according to the specs and Broadcom developers, to be within a 4GB segment of memory. This includes: System Request Message Frames pool Reply Free Queues pool ReplyDescriptorPost Queues pool Chain Segments pool Sense Buffers pool SystemReply message pool We got a bug report from Dwight Engen, who ran into data corruption in the BAE port of FreeBSD: > We have a port of the FreeBSD mpr driver to our kernel and recently > I found an issue under heavy load where a DMA may go to the wrong > address. The test system is a Supermicro X10SRH-CLN4F with the > onboard SAS3008 controller setup with 2 enterprise Micron SSDs in > RAID 0 (striped). I have debugged the issue and narrowed down that > the errant DMA is one that has a segment that crosses a 4GB > physical boundary. There are more details I can provide if you'd > like, but with the attached patch in place I can no longer > re-create the issue. > I'm not sure if this is a known limit of the card (have not found a > datasheet/programming docs for the chip) or our system is just > doing something a bit different. Any helpful info or insight would > be welcome. > Anyway, just thought this might be helpful info if you want to > apply a similar fix to FreeBSD. You can ignore/discard the commit > message as it is my internal commit (blkio is our own tool we use > to write/read every block of a device with CRC verification which > is how I found the problem). The commit message was: > [PATCH 8/9] mpr: fix memory corrupting DMA when sg segment crosses > 4GB boundary > Test case was two SSD's in RAID 0 (stripe). The logical disk was > then partitioned into two partitions. One partition had lots of > filesystem I/O and the other was initially filled using blkio with > CRCable data and then read back with blkio CRC verify in a loop. > Eventually blkio would report a bad CRC block because the physical > page being read-ahead into didn't contain the right data. If the > physical address in the arq/segs was for example 0x500003000 the > data would actually be DMAed to 0x400003000. The original patch was against mpr(4) before busdma templates were introduced, and only affected the buffer pool (sc->buffer_dmat) in the mpr(4) driver. After some discussion with Dwight and the LSI/Broadcom developers and looking through the driver, it looks like most of the queues in the driver are ok, because they limit the memory used to memory below 4GB. The buffer queue and the chain frames seem to be the exceptions. This is pretty much the same between the mpr(4) and mps(4) drivers. So, apply a 4GB boundary limitation for the buffer and chain frame pools in the mpr(4) and mps(4) drivers. Reported by: Dwight Engen Reviewed by: imp Obtained from: Dwight Engen Differential Revision: (cherry picked from commit 264610a86e14f8e123d94c3c3bd9632d75c078a3) --- sys/dev/mpr/mpr.c | 6 ++++-- sys/dev/mps/mps.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 161914748e56..f042f71825b5 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -1500,7 +1500,8 @@ mpr_alloc_requests(struct mpr_softc *sc) rsize = sc->chain_frame_size * sc->num_chains; bus_dma_template_init(&t, sc->mpr_parent_dmat); BUS_DMA_TEMPLATE_FILL(&t, BD_ALIGNMENT(16), BD_MAXSIZE(rsize), - BD_MAXSEGSIZE(rsize), BD_NSEGMENTS((howmany(rsize, PAGE_SIZE)))); + BD_MAXSEGSIZE(rsize), BD_NSEGMENTS((howmany(rsize, PAGE_SIZE))), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1552,7 +1553,8 @@ mpr_alloc_requests(struct mpr_softc *sc) BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), - BD_LOCKFUNCARG(&sc->mpr_mtx)); + BD_LOCKFUNCARG(&sc->mpr_mtx), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 10aea28db9ee..ca037071c298 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -1428,7 +1428,8 @@ mps_alloc_requests(struct mps_softc *sc) rsize = sc->reqframesz * sc->num_chains; bus_dma_template_clone(&t, sc->req_dmat); BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(rsize), BD_MAXSEGSIZE(rsize), - BD_NSEGMENTS(howmany(rsize, PAGE_SIZE))); + BD_NSEGMENTS(howmany(rsize, PAGE_SIZE)), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); @@ -1470,7 +1471,8 @@ mps_alloc_requests(struct mps_softc *sc) BUS_DMA_TEMPLATE_FILL(&t, BD_MAXSIZE(BUS_SPACE_MAXSIZE_32BIT), BD_NSEGMENTS(nsegs), BD_MAXSEGSIZE(BUS_SPACE_MAXSIZE_24BIT), BD_FLAGS(BUS_DMA_ALLOCNOW), BD_LOCKFUNC(busdma_lock_mutex), - BD_LOCKFUNCARG(&sc->mps_mtx)); + BD_LOCKFUNCARG(&sc->mps_mtx), + BD_BOUNDARY(BUS_SPACE_MAXSIZE_32BIT+1)); if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); From nobody Wed Dec 20 16:13:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwJWV16WRz556HY; Wed, 20 Dec 2023 16:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwJWV0bL3z4kGr; Wed, 20 Dec 2023 16:13:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703088790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJT12pI0g3ElmrS+SwCyRTm/Ksg+NoPJtu+bGFvedBk=; b=k8SLeRaWzLFsT3UepNMXVh3TJiVxYqJQb8ixMsKEeVcgcyorx7lcRsH4MNQfdzMk6rAV2o uuOTQrGO9dhB0kW05SOBds6eC8OybjAFaEy0nmElv9DkBOPJ370JqFHBMpKiR/A0he0PyG XRrsbjrADHQWXXuJ6Yaq3MsMQSo7zFnvfeQK3PHrd52A0elEGUjV4H7j+pQ/qD+4BodRUZ cW4Vn/b6Hd6h2Eqh9ykn/HXTXrmVJBa4svk8XDb3uRaoKhms1/1Uf6y1ho6j0DGFyFqYTl j8OumE9lQE6vPxHVlhTGed7ibzGUiPn3kdWzC92yBCyJZFO2jbUsUEKJKCk1fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703088790; a=rsa-sha256; cv=none; b=t3rMeQY37sy7mSwUq5OHhzbFQrhY/Tyqw3ags24k6UatUp70FryjhOV4AOxpzXZ7fsr0r4 3TlDMKUnYYGqJwm1JZ8dqN08DLMkzzy8dumDpuIlj7FcEgpFPQeER6rSohQgPtzrmiphgp cDEcwBoc0/rx766j7xdFZh/UECEKj6SFrZw6N4nkJcCL5NiMTq6nM074Vg4AahynHxhtJX GZ3x3bjWsjSImod+i2RO2vxuHrxEImIwDs+734/XAyL8sEIaDDhKpX0aRQNbICObaK8+xP 5/c/IdShSkrzUbK0kmdhQ6uvHheVWEoJ0KrNz1iHqVWHwFERuw6WmeeT1kemHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703088790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJT12pI0g3ElmrS+SwCyRTm/Ksg+NoPJtu+bGFvedBk=; b=rNIT/fXdfB6wUXjYVzmCSGW4jg5U5ncBMCvUPfgoVf0s0wNVDdFBfkn1Kc7PgnL09eHwgp 6Swlk7BmfHphud9BScprtPNzGBg2xYTJgrjd7CEDuy/BpuyBgGl6+ZrTASEYE+0k58Th5u mCH6QzyCdXqFy/X4BQ7N3uds02vPe/LZAD7AnYIlqp1exqXNu8erWJjf8pBldEFlItxj/M jVcPq4YTzDmRhPzxJq71IsBExik8ltjWuWqNaZUsJHghY3xLIQK18Ewx/NGMF/n2CP9VCq uqCwLbTGA9m+mRGN6q8O0xitJ94mts8OvIcsHOM3oOq0VUjCZRE8wSfGRJdkzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwJWT6mHgzvkj; Wed, 20 Dec 2023 16:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKGD9Ld015418; Wed, 20 Dec 2023 16:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKGD9vH015415; Wed, 20 Dec 2023 16:13:09 GMT (envelope-from git) Date: Wed, 20 Dec 2023 16:13:09 GMT Message-Id: <202312201613.3BKGD9vH015415@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: 0c3af23961e1 - main - Add missing sources to libclang_rt Makefiles, clean up unneeded ones List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0c3af23961e170538f375c392b043903c1397780 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3af23961e170538f375c392b043903c1397780 commit 0c3af23961e170538f375c392b043903c1397780 Author: Dimitry Andric AuthorDate: 2023-12-20 16:08:26 +0000 Commit: Dimitry Andric CommitDate: 2023-12-20 16:08:26 +0000 Add missing sources to libclang_rt Makefiles, clean up unneeded ones During the llvm-17 merge, a few new source files were not added to the libclang_rt Makefiles, in particular sanitizer_thread_arg_retval.cpp which is now required for AddressSanitizer and MemorySanitizer. Also, MemorySanitizer now requires msan_dl.cpp. While here, clean out a number of source files that compile into nothing (because they only contain non-FreeBSD parts). Also, remove a duplicated instance of tsan_new_delete.cpp from libclang_rt.tsan, since it is only supposed to live in libclang_rt.tsan_cxx. PR: 275854 Reported by: jbeich MFC after: 1 month --- lib/libclang_rt/asan/Makefile | 3 +-- lib/libclang_rt/asan_dynamic/Makefile | 3 +-- lib/libclang_rt/cfi/Makefile | 2 +- lib/libclang_rt/cfi_diag/Makefile | 2 +- lib/libclang_rt/dd/Makefile | 2 +- lib/libclang_rt/msan/Makefile | 3 ++- lib/libclang_rt/safestack/Makefile | 1 - lib/libclang_rt/stats/Makefile | 1 + lib/libclang_rt/tsan/Makefile | 3 --- lib/libclang_rt/ubsan_standalone/Makefile | 2 +- lib/libclang_rt/xray/Makefile | 1 + 11 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/libclang_rt/asan/Makefile b/lib/libclang_rt/asan/Makefile index 02b5471afc91..6156371241da 100644 --- a/lib/libclang_rt/asan/Makefile +++ b/lib/libclang_rt/asan/Makefile @@ -19,7 +19,6 @@ SRCS+= asan/asan_memory_profile.cpp SRCS+= asan/asan_poisoning.cpp SRCS+= asan/asan_posix.cpp SRCS+= asan/asan_preinit.cpp -SRCS+= asan/asan_premap_shadow.cpp SRCS+= asan/asan_report.cpp SRCS+= asan/asan_rtl.cpp SRCS+= asan/asan_shadow_setup.cpp @@ -28,7 +27,6 @@ SRCS+= asan/asan_stats.cpp SRCS+= asan/asan_suppressions.cpp SRCS+= asan/asan_thread.cpp SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sancov_flags.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp @@ -66,6 +64,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/asan_dynamic/Makefile b/lib/libclang_rt/asan_dynamic/Makefile index 81b68d883ecc..1ba9840946b6 100644 --- a/lib/libclang_rt/asan_dynamic/Makefile +++ b/lib/libclang_rt/asan_dynamic/Makefile @@ -22,7 +22,6 @@ SRCS+= asan/asan_memory_profile.cpp SRCS+= asan/asan_poisoning.cpp SRCS+= asan/asan_posix.cpp SRCS+= asan/asan_preinit.cpp -SRCS+= asan/asan_premap_shadow.cpp SRCS+= asan/asan_report.cpp SRCS+= asan/asan_rtl.cpp SRCS+= asan/asan_shadow_setup.cpp @@ -31,7 +30,6 @@ SRCS+= asan/asan_stats.cpp SRCS+= asan/asan_suppressions.cpp SRCS+= asan/asan_thread.cpp SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sancov_flags.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp @@ -69,6 +67,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/cfi/Makefile b/lib/libclang_rt/cfi/Makefile index 85db642fdab8..604c3cd9a593 100644 --- a/lib/libclang_rt/cfi/Makefile +++ b/lib/libclang_rt/cfi/Makefile @@ -5,7 +5,6 @@ LIB= clang_rt.cfi-${CRTARCH} SRCS+= cfi/cfi.cpp SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp SRCS+= sanitizer_common/sanitizer_common.cpp @@ -29,6 +28,7 @@ SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp SRCS+= sanitizer_common/sanitizer_suppressions.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/cfi_diag/Makefile b/lib/libclang_rt/cfi_diag/Makefile index b2a0b5b7a38f..4f4bb9472bb7 100644 --- a/lib/libclang_rt/cfi_diag/Makefile +++ b/lib/libclang_rt/cfi_diag/Makefile @@ -5,7 +5,6 @@ LIB= clang_rt.cfi_diag-${CRTARCH} SRCS+= cfi/cfi.cpp SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sancov_flags.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp @@ -43,6 +42,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/dd/Makefile b/lib/libclang_rt/dd/Makefile index 80ae9037cfe6..80ed7e497797 100644 --- a/lib/libclang_rt/dd/Makefile +++ b/lib/libclang_rt/dd/Makefile @@ -4,7 +4,6 @@ LIB= clang_rt.dd-${CRTARCH} SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp SRCS+= sanitizer_common/sanitizer_common.cpp @@ -28,6 +27,7 @@ SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp SRCS+= sanitizer_common/sanitizer_suppressions.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/msan/Makefile b/lib/libclang_rt/msan/Makefile index 2771ac578bc3..474b08a640a7 100644 --- a/lib/libclang_rt/msan/Makefile +++ b/lib/libclang_rt/msan/Makefile @@ -4,10 +4,10 @@ LIB= clang_rt.msan-${CRTARCH} SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= msan/msan.cpp SRCS+= msan/msan_allocator.cpp SRCS+= msan/msan_chained_origin_depot.cpp +SRCS+= msan/msan_dl.cpp SRCS+= msan/msan_interceptors.cpp SRCS+= msan/msan_linux.cpp SRCS+= msan/msan_poisoning.cpp @@ -50,6 +50,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/safestack/Makefile b/lib/libclang_rt/safestack/Makefile index 75246a1295c6..bbf4a665c37f 100644 --- a/lib/libclang_rt/safestack/Makefile +++ b/lib/libclang_rt/safestack/Makefile @@ -4,7 +4,6 @@ LIB= clang_rt.safestack-${CRTARCH} SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= safestack/safestack.cpp .include diff --git a/lib/libclang_rt/stats/Makefile b/lib/libclang_rt/stats/Makefile index b2ba12ce0b6d..2fd929575123 100644 --- a/lib/libclang_rt/stats/Makefile +++ b/lib/libclang_rt/stats/Makefile @@ -38,6 +38,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/tsan/Makefile b/lib/libclang_rt/tsan/Makefile index d97d6592cfb6..f3f5bd41668c 100644 --- a/lib/libclang_rt/tsan/Makefile +++ b/lib/libclang_rt/tsan/Makefile @@ -4,7 +4,6 @@ LIB= clang_rt.tsan-${CRTARCH} SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sancov_flags.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp @@ -30,7 +29,6 @@ SRCS+= sanitizer_common/sanitizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_printf.cpp SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp -SRCS+= sanitizer_common/sanitizer_range.cpp SRCS+= sanitizer_common/sanitizer_stack_store.cpp SRCS+= sanitizer_common/sanitizer_stackdepot.cpp SRCS+= sanitizer_common/sanitizer_stacktrace.cpp @@ -62,7 +60,6 @@ SRCS+= tsan/rtl/tsan_interface_java.cpp SRCS+= tsan/rtl/tsan_md5.cpp SRCS+= tsan/rtl/tsan_mman.cpp SRCS+= tsan/rtl/tsan_mutexset.cpp -SRCS+= tsan/rtl/tsan_new_delete.cpp SRCS+= tsan/rtl/tsan_platform_linux.cpp SRCS+= tsan/rtl/tsan_platform_posix.cpp SRCS+= tsan/rtl/tsan_preinit.cpp diff --git a/lib/libclang_rt/ubsan_standalone/Makefile b/lib/libclang_rt/ubsan_standalone/Makefile index 584a32ca3d45..95d1c0405e2d 100644 --- a/lib/libclang_rt/ubsan_standalone/Makefile +++ b/lib/libclang_rt/ubsan_standalone/Makefile @@ -4,7 +4,6 @@ LIB= clang_rt.ubsan_standalone-${CRTARCH} SRCS+= interception/interception_linux.cpp -SRCS+= interception/interception_type_test.cpp SRCS+= sanitizer_common/sancov_flags.cpp SRCS+= sanitizer_common/sanitizer_allocator.cpp SRCS+= sanitizer_common/sanitizer_allocator_checks.cpp @@ -42,6 +41,7 @@ SRCS+= sanitizer_common/sanitizer_symbolizer_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp SRCS+= sanitizer_common/sanitizer_symbolizer_report.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp diff --git a/lib/libclang_rt/xray/Makefile b/lib/libclang_rt/xray/Makefile index fabaabca9646..91abbb743667 100644 --- a/lib/libclang_rt/xray/Makefile +++ b/lib/libclang_rt/xray/Makefile @@ -28,6 +28,7 @@ SRCS+= sanitizer_common/sanitizer_procmaps_bsd.cpp SRCS+= sanitizer_common/sanitizer_procmaps_common.cpp SRCS+= sanitizer_common/sanitizer_suppressions.cpp SRCS+= sanitizer_common/sanitizer_termination.cpp +SRCS+= sanitizer_common/sanitizer_thread_arg_retval.cpp SRCS+= sanitizer_common/sanitizer_thread_registry.cpp SRCS+= sanitizer_common/sanitizer_tls_get_addr.cpp SRCS+= sanitizer_common/sanitizer_type_traits.cpp From nobody Wed Dec 20 16:59:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwKYM2dBsz558Gv; Wed, 20 Dec 2023 16:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwKYM1wQFz4pSY; Wed, 20 Dec 2023 16:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703091591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LGWgCZEWmtqWNcSDxj4PwwkjbpJf3fqOgBF4vunWZ2I=; b=f+4L14LZ+swOZEI1tkhMNv/DbYXz5xE9N/QUrtu3EOU4Ly8reO2gRlnmbxWItFGcfeVDrM eY+yWvTxA/TQW/vJXCe1Cb5wZpmGWt+N1R/pNwK+o0BipNuO2ooujRVCkYk9q/8bG9LxoE hwA82WwFQwsfp+a6c9hAsB0kneQWQcawEgXeo4uUzodXutO2UqU+LwQnPobFfUYGASB0ok WwZFpkqRdNZHmQFYHET+tjkSk+s8HpcQHmGdorT5c88RJIvtOiUWJ5sxhJnujeSE3Q8shu KrQPsJ0CvCrPsae56DIxYaxAZAAxylNAWMyI9TEWOWLtSKVzoEJg8Etu2v+X7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703091591; a=rsa-sha256; cv=none; b=akz1byg05wV81dKNc387L4oChmT3S1sV27okN0NdHAsvSG6/WfL4JShC1GLtooJPBqI7k5 BK+KWcSPDN9+e8q1ubjwfE6aIChXlyHjWsoaQEUtdbR5dEJSv8aK2EA4q/8ZEcu+JK5CK2 1JZUW0ge3Uk610q/SdVQl5lgB9AtVK8Sue3KODwf32EM5XNfTWN7mC8FTyJzdrP0BgTZdm OTcLAldXXYSllEYqNZt7xXZZYOVgUWEYPDpyxZyeoKTB7Y9o2KFGot6KB+bnCKoxDBao4D 2p0ezXsEEnmrJkqQmwJOm/qzyw00ZcioCZ6153G+sCm5pAR/4LbN4Xyj/eTI5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703091591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LGWgCZEWmtqWNcSDxj4PwwkjbpJf3fqOgBF4vunWZ2I=; b=CIPnMzWKl2WUWj0UlPMk5QBV8pZhoQ5q7PXjnpQdFou/n+M+Q8amg70dDLl5bPuk5RQxM8 3VF0tZq0N/nBw88zteLxnIGhFPsW9W4AxeWa32XSOXWNH4+SxLjCCCTbUjvBu7Zvww0WUX OomNNBhDOnaeJiTvdUgOySPVe/H6ET8DPU0WAylUI5xxPgjt5XZFHJFJSOe0SXd6bMk6tv I9HezwzQKUnuurLV665R97EpdZ2Rx1bbFSTdA5vvxlz82I3M5KeSFtVDdvGMq/SmVVVIDN RqI5DfqM4SVdvaSUU1JoMb1bhJqL40skjEOlABRmd4Muoheju2QDddGSzNYEOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwKYM0sKvzwtN; Wed, 20 Dec 2023 16:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKGxo4D083635; Wed, 20 Dec 2023 16:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKGxopf083632; Wed, 20 Dec 2023 16:59:50 GMT (envelope-from git) Date: Wed, 20 Dec 2023 16:59:50 GMT Message-Id: <202312201659.3BKGxopf083632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: afdce0837014 - main - renice: Clean up the tests 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afdce0837014fb7a41fced959c9457f89e878052 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=afdce0837014fb7a41fced959c9457f89e878052 commit afdce0837014fb7a41fced959c9457f89e878052 Author: Dag-Erling Smørgrav AuthorDate: 2023-12-20 16:59:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-20 16:59:37 +0000 renice: Clean up the tests a bit. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: ngie, asomers Differential Revision: https://reviews.freebsd.org/D43087 --- usr.bin/renice/tests/renice_test.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.bin/renice/tests/renice_test.sh b/usr.bin/renice/tests/renice_test.sh index 8a4df7879ad4..7983eb594716 100755 --- a/usr.bin/renice/tests/renice_test.sh +++ b/usr.bin/renice/tests/renice_test.sh @@ -14,8 +14,9 @@ _renice() { atf_check_nice_value() { local pid=$1 - local nice=$2 - atf_check test "$(ps -o nice= -p $pid)" -eq "$nice" + local expected=$2 + local actual="$(ps -o nice= -p $pid)" + atf_check test "$actual" -eq "$expected" } atf_test_case renice_abs_pid @@ -57,7 +58,7 @@ renice_abs_pgid_head() { renice_abs_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -73,7 +74,7 @@ renice_rel_pgid_head() { renice_rel_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -90,7 +91,7 @@ renice_abs_user_head() { } renice_abs_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) -u $TEST_USER @@ -105,7 +106,7 @@ renice_rel_user_head() { } renice_rel_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice -u -n $incr $TEST_USER From nobody Wed Dec 20 19:19:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwNf242G4z55Fcp; Wed, 20 Dec 2023 19:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwNf23HFwz3HtL; Wed, 20 Dec 2023 19:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703099946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qe7D9CAF/o9idqRnWTp/0/k/GliX88M1iST4028IwQQ=; b=PPd+pYepRSUuutw8fn0a+5R1mYbhoW6h4z/OeWsSMSiBi+AE28E0iEGCqEIpcZKyxRMWl4 dStDGdCRnWtqPOIke/ABWU30HV6K83k1m3vdjLYKJEntPMY24ppLGqEKuQF22tqKdg03M7 I+NhrbEbjPiwoIFN3TJaESo1F0d0kKyEIQ16zpMLgdJ9VKjuXUjIN7rCZBnsoXniVJA+nx Hgb9GL8s9Or0SoCMRLaJPZuL/TpyA1F6YanQLPk+LZPZIyuZMmZ7LyxoPfKQFLKHSo70mh AiOIHCAGLe3yppy2COibh/mUSYmr+fPBE+qDvui6JgXPbNQeruLxx7h8RsV1Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703099946; a=rsa-sha256; cv=none; b=WUfmU5QqTi66hKgVXLnPYFcY6GaLUop3VAcwG4z3tB9Kg8fngOGRANufORNtlC1h8EeYdq KUOGSv4GbRPOabSDkSVURfOGQNhnk+kl+6WVhlbIBorSbSPVaAk8/OO1PZFE43augtKyoE xIzArwatg9OFMWXtZP30zIHMpHEz9gj2NN5JK+cAEvvfdULDtxWSi1r5O3Nu3fNb/F2+j8 LvUB+u/9nE0VzeerIPp3zAuxI2+GOEPFjsmTjOdY9Q6SV/a3QyyfBYxyfTsj7JMDaS+A/U pi2AFXXRp/Z2U5LBtgb2GT6VwnubCflrBwAs2xHzuuVnxwX7oCG/x2SIf5Y1OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703099946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qe7D9CAF/o9idqRnWTp/0/k/GliX88M1iST4028IwQQ=; b=WbpCIbrHLkYZVnopLe6GN+Y/HtyJRwhrOf1yIutrkwFuYz20uwaMtZWq9PZzWlTnac/IqE ySpj8LkSHbI2E2oSWx35sgQYMeCmdnWp3B8tq8c0pAaT4exopcVXOhwaUKgee8cR79++8P xvVzGO9GuGVDYuT07PZiPGUsvyuz7RnBOsDOw5k3F7MTdL55LUYuGKiC19ICxk1J40ih9T EOJV3gkU55n4rbLsFXv0YcoXmI6q3NufUe2cKxL25o9vAZ5K+6SpDGnXE+XD1ZBdxQyH8k sS3a2EH6lUkm2HRmYdmxKWarqc1FLX+KfxK3Z3qV2H+8Y5WehdqHamnGyCswKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwNf22K3zz11LH; Wed, 20 Dec 2023 19:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKJJ6cs018513; Wed, 20 Dec 2023 19:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKJJ6wd018510; Wed, 20 Dec 2023 19:19:06 GMT (envelope-from git) Date: Wed, 20 Dec 2023 19:19:06 GMT Message-Id: <202312201919.3BKJJ6wd018510@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: 87eea35e3f8b - main - Add missing /usr/include/c++/v1/__mdspan/mdspan.h header List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 87eea35e3f8bc559a5142d613826100b758c08fe Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=87eea35e3f8bc559a5142d613826100b758c08fe commit 87eea35e3f8bc559a5142d613826100b758c08fe Author: Dimitry Andric AuthorDate: 2023-12-20 19:13:47 +0000 Commit: Dimitry Andric CommitDate: 2023-12-20 19:16:57 +0000 Add missing /usr/include/c++/v1/__mdspan/mdspan.h header I missed this header while updating the Makefile for libc++ 17. PR: 273753 MFC after: 1 month --- lib/libc++/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile index b311b166c12f..937d73434b0f 100644 --- a/lib/libc++/Makefile +++ b/lib/libc++/Makefile @@ -867,6 +867,7 @@ MDS_HEADERS+= default_accessor.h MDS_HEADERS+= extents.h MDS_HEADERS+= layout_left.h MDS_HEADERS+= layout_right.h +MDS_HEADERS+= mdspan.h .for hdr in ${MDS_HEADERS} MDS+= ${HDRDIR}/__mdspan/${hdr} .endfor From nobody Wed Dec 20 21:43:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwRr434XCz55NbD; Wed, 20 Dec 2023 21:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwRr42PQNz3VLd; Wed, 20 Dec 2023 21:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703108580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gvd9IAyy/HNDwX4qxnqfzHhzklP1TSWCXneHDNDQWa4=; b=MhPOEZ4F09DMq5CKnEdIETUjfmEAiBxHUH6w+aVihnqp+c9gsdMj4eFXoON60mCWvidd0r 8hU5zNiUSJ2Uvf2JcH1Cd/RTNhFUiRju39tfbrsSGlHNO9JZIR2/mS12bF9EuaHv7lXix3 UNXQf4XH8EpWZaqmPlXWvecbnoRRxmQz5g5yoKEeoUPqzO9Yim3V6ZUSNDHjN8VqcTOg8h ykVD3La76lkxrxZQhnlzqee1Ei/jTNhV73GmkE2KdYyHp2vAM9FEnFZ1iZZIWh3hVX15Zj ixSMPx9bua7YasUZvPk4Ip3OV8hGdIGTUygFHOpV5k7EChmcL8Pbdo52N1AVLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703108580; a=rsa-sha256; cv=none; b=EAVqsFL3zqersOCuBD0MLNjO2GXFqEHJ4ZJF+45EoRAXa2TkgfmUYmGbWXRPF3Oh1QEo+8 SRPkpnKYDaP4wkZNWahhe8av290UuZ6DLFZ5YkFRwRXsv5qN+sQ392CcRrUUluBkW0CUx6 Z/G/ZlKBKDwfdDQJARqMB6GkSXbgNOXJYUXH6HxTl7nyqAOUXrxV65zQ9Rg/guQ5HpHifi XM3m+kjd52nbtDdPFOI+YcaZbg4HpEhXnQBHozRnH1mBKnFEimaTDtFnHBVJ0bumlU+IAU 2L+VBJjUSt1NtuplheEXODITLC+waI4SkEaGATGKDkKOuP6HZFkSZdDom7eVdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703108580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gvd9IAyy/HNDwX4qxnqfzHhzklP1TSWCXneHDNDQWa4=; b=xZDE0orrVhG5aT+kmgjRVjMfndM/2Oo3d+2bLWArRFAGA/2S9saWj6XmqRr/pad89os2dx J4MIDAeTeuDNR8nvyxmRGLV3pwagXw29Z0CngbIGrQ77GGrtycYX7Gl+kxGGAPzPq+PlLt 6do40a6YXAqr42GlLcEJdErwoVD1HUL/BFXWZlAps220MmGYQpf7v6FV2r43/jvPatz3ii EvWccAfTktlY/CY1g3OjQHLtgQ5EuBw5L58ft0TyiR811PtUdw4/JcxakzxQPHETEUbHzr zATPRR2zhbHSzAstzER7OgExl6uVFG9mwLSBLDqg9b6xmHO6CpGwf8O1utKvtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwRr41SSwz151p; Wed, 20 Dec 2023 21:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKLh0sA068007; Wed, 20 Dec 2023 21:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKLh0uE068004; Wed, 20 Dec 2023 21:43:00 GMT (envelope-from git) Date: Wed, 20 Dec 2023 21:43:00 GMT Message-Id: <202312202143.3BKLh0uE068004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fcaae06579bf - main - pwd_mkdb: Cosmetic nit. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcaae06579bfedbaadddb98c34985168e32cbc8e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fcaae06579bfedbaadddb98c34985168e32cbc8e commit fcaae06579bfedbaadddb98c34985168e32cbc8e Author: Dag-Erling Smørgrav AuthorDate: 2023-12-20 21:41:38 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-20 21:42:42 +0000 pwd_mkdb: Cosmetic nit. Sponsored by: Klara, Inc. --- usr.sbin/pwd_mkdb/pwd_mkdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 6e3cc6cf9604..3c27b40044e3 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -94,10 +94,11 @@ main(int argc, char *argv[]) uint32_t store; const char *t; char *p; - char buf[MAX(MAXPATHLEN, LINE_MAX * 2)], tbuf[1024]; + char buf[MAX(MAXPATHLEN, LINE_MAX * 2)]; char sbuf[MAX(MAXPATHLEN, LINE_MAX * 2)]; char buf2[MAXPATHLEN]; char sbuf2[MAXPATHLEN]; + char tbuf[1024]; char *username; u_int method, methoduid; int Cflag, dflag, iflag; From nobody Wed Dec 20 23:52:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwVjM5m01z55TXG; Wed, 20 Dec 2023 23:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwVjM5KC6z3fY9; Wed, 20 Dec 2023 23:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703116343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TffjocIOQYmyo5r9rCJ3H2d3lluPNAaw9+DZbyj3Sz0=; b=jodah89MvB+ZIWL3If8VdkjQwvbQtssm9ymzVDrIrr1XCjtYcv1HeX/X7M928zwRvzTx6C 7dJ0OMUrtPKU/I45zuvgSLg6AZjRwpZeqfKJH/SPUCONDBXoZ+Usp0nr+VfdMBr2uXQjSJ +QG1IeygnJp8N87TGPN1o3hOVMlxEvTrI40nsz09S7k0a8/W/5RdWIq0LUDobtFipEwijv MRF0vbc5afW9pwyYWA+PMYfWYVGq7eov5aUb6K8w1NBt9R0YiwZsIZrW3Po3X1J6t/LB2V yoPK/blHcQSmeytbBXuQdHnX0kwVIFVaGi8e3jW5+J8S+4/OeNJxI8jTAlQHtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703116343; a=rsa-sha256; cv=none; b=A5xRXq13RGxDtQ3b8w91isCcGXmakwablwWDm2Y7waBTlnMV532zs8GGywMFUcebTsoLDk cTxaOE2o5uFoN9qIgVX1dkff+7Rqx4UwQErfURT1+u1zAlysHMZAaaBPLOHTD4SPvCqgqh /yRG+7Q0WEsQ6l17EXhG0IqboaIMdI8ZBFInnJUWqAysIvmRkI/nVcNSfasqTVQPPV3mMj E8SFcXr2DwiGQjxlw8beWTuVKMwz248tUTPhvO/73JVw77E2f+nqQhf9nqAcTxoVq1jdck /hOLuEHDrwHG969CLYCdZnsxJzCkQmY03+L/Je+1y7VlV2bdDtiFDkqXPvuV1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703116343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TffjocIOQYmyo5r9rCJ3H2d3lluPNAaw9+DZbyj3Sz0=; b=qOF5Hq/AE7zaQYAxaeSXvA7wxe4tcSmA3+NuC+BE1t/GhCwwfvMG1ecJUpakiSTlPO1tPc 2bNJ5rMtxsw3N54ERrZGU0ouecrm1kB1mYFOIwjgxOD2rRZlDaerlite/yJ7AfBSbjRwxb scLukXLTdc8H1J7BcNhOgyRM5Q+aCgP0Py22QjCjHtNgHBKBtr//j6ulmIXmX+QACuk2YX BP4QXF7t5QoZ2TMBwIOW8r5jzktQsiJ0sL7SkCrbR6CHLN8KU+8F/xSUXkra0dnYPhQ/Zr 9edeHwdmYaYHeBJYJGSGxL2iwuND5BSjjM2Xu5TsG9PluwEMLFkZGq3nK5Clzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwVjM4Mmnz186s; Wed, 20 Dec 2023 23:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BKNqNgb085735; Wed, 20 Dec 2023 23:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKNqNhA085732; Wed, 20 Dec 2023 23:52:23 GMT (envelope-from git) Date: Wed, 20 Dec 2023 23:52:23 GMT Message-Id: <202312202352.3BKNqNhA085732@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: 7c8f16318499 - main - vmm.h: remove dup declaration List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 7c8f16318499d2b05e916abd66148e5409284a9d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7c8f16318499d2b05e916abd66148e5409284a9d commit 7c8f16318499d2b05e916abd66148e5409284a9d Author: Konstantin Belousov AuthorDate: 2023-12-20 23:40:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-20 23:51:47 +0000 vmm.h: remove dup declaration Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43139 --- sys/amd64/include/vmm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index abc7571187fa..273a1a46ba04 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -260,8 +260,6 @@ void *vm_gpa_hold(struct vcpu *vcpu, vm_paddr_t gpa, size_t len, int prot, void **cookie); void *vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, int prot, void **cookie); -void *vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, - int prot, void **cookie); void vm_gpa_release(void *cookie); bool vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa); From nobody Thu Dec 21 02:25:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwZ6225sYz548Kp; Thu, 21 Dec 2023 02:25: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwZ621chQz4PNj; Thu, 21 Dec 2023 02:25:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703125530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YCFBQJt/Dw2DHEoYgvNbDffFFNa0iN9HqpFWI1URbv4=; b=EAChcjwuDpVQoSBW8+Ur2wyoaAiJRdfLXPB2bF4ZCgz4gK63V24t8aEnRDF4DsK1ImV16O ShqSG0qmNkfozZgLQwx+Ny8ms2zdk1LmgvLf/bjr87V9NHUoIugTgnalme945Q/T18ngay 3V0ZBTnqpK8Cf/D2j0556BwSybYD0oUF3W+LBd9xvB/VDWlHWnZWo2qeTkuBq+TiTupIVn dCurAA7+EOhcn3efYPyfw3x2LDxr4we3ZBU2WP0Ot8uj1Sr4RfOIJAJB2mw4XqwOlpi8cx CfkiBhNkJnkvJnCR+pQOwRT3f9whoV7fd2z9xarVWLRAHHE4YVLxzd76fh+TyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703125530; a=rsa-sha256; cv=none; b=j1DERstRuIpR3DS9N5y9ne3NAD6puio0GFAPXOCdEihtAXvUJcFBVm8zh4k4BuyI6IM27N 4skfG24IfDEAyvJL/Hsj4g9Z/6MK/UlLQDH3hJ0wegxp8abP4KNYBXM0oxVVYToKS1ywZg o/1aP6AK2jpSkcBVYZQIk4YCTV4r1XVwRneg8Pt9lzr9iZkYbRBFxzs41t78FlRYqdJHcL CItyC4ER5pTa7XsJ8wErZKd0fKGrmjyN8VLQVhwLACjIjcuWWDPrByO65YAAjGQjZzddYy 5Uv4dRpXC5DQoS7p6sMBEyKWEKrfz1OnjVvlRAwmbh+DDSmYPibYm5xFyX6i+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703125530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YCFBQJt/Dw2DHEoYgvNbDffFFNa0iN9HqpFWI1URbv4=; b=WNWyP2hoKbKGjeaIbg1qQdX2hAkaiFezynC6lYR93DOjMVCuMbxG3b0dsiEOpFwyn9FvBZ Em1W/4InOAB8/aOK/X68Q6n/1oDxZQ6sDKSIM9V/FVM6DHPEMGGD94aQ98s4noEA7NV9Ae rx3Yz9ShtJbSdvGspnw1o8BwGGBCDDAx4scWHh/mF/fqHA3bRCgf9zcaxx+5VgEoAnSRAV JDtO7H3LJ13Uqkc6gwIIBYOHEVVpP+WaTQ4h29pC1yGCODUBuVMc37QeaUFlGdJDMeSHOZ atRhfeY9RjXdPSMzl+Cmu0l6UdP0XVPAVIqhiKJrXimUPq5529d436HbjNRXUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwZ620NZTzQ5; Thu, 21 Dec 2023 02:25:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL2PTs0037727; Thu, 21 Dec 2023 02:25:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL2PTDc037724; Thu, 21 Dec 2023 02:25:29 GMT (envelope-from git) Date: Thu, 21 Dec 2023 02:25:29 GMT Message-Id: <202312210225.3BL2PTDc037724@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: a0ecf2224ea3 - main - lib/libc/tests/string/strcspn_test.c: add test for correct match order List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: a0ecf2224ea35d029d33541878f0eee42f5fd84f Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ecf2224ea35d029d33541878f0eee42f5fd84f commit a0ecf2224ea35d029d33541878f0eee42f5fd84f Author: Robert Clausecker AuthorDate: 2023-12-19 16:27:24 +0000 Commit: Robert Clausecker CommitDate: 2023-12-21 02:16:57 +0000 lib/libc/tests/string/strcspn_test.c: add test for correct match order This new unit test verifies that if there are multiple matches, the first match is returned, ignoring later matches. Approved by: mjg (blanket, via IRC) MFC after: 1 week MFC to: stable/14 --- lib/libc/tests/string/strcspn_test.c | 51 +++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/string/strcspn_test.c b/lib/libc/tests/string/strcspn_test.c index 6cb2a04d3e64..293fc2bc8d4e 100644 --- a/lib/libc/tests/string/strcspn_test.c +++ b/lib/libc/tests/string/strcspn_test.c @@ -150,7 +150,7 @@ ATF_TC_BODY(set_alignments, tc) #ifndef STRSPN /* test all positions in which set could match buf */ static void -test_match_positions(char *buf, char *set, size_t buflen, size_t setlen) +test_match_positions(char *buf, char *set, size_t buflen, size_t setlen) { size_t i, j, outcome; @@ -206,6 +206,54 @@ ATF_TC_BODY(match_positions, tc) test_match_positions(buf, set, 16, 8); test_match_positions(buf, set, 8, 8); } + +/* if there are two matches, check that the earlier match is taken */ +static void +test_match_order(char *buf, char *set, size_t buflen, size_t setlen) +{ + size_t i, j, k, l, outcome; + + memset(buf, '-', buflen); + + for (i = 0; i < setlen; i++) + set[i] = 'A' + i; + + buf[buflen] = '\0'; + set[setlen] = '\0'; + + for (i = 0; i < setlen; i++) + for (j = 0; j < setlen; j++) + for (k = 0; k + 1 < buflen; k++) + for (l = k + 1; l < buflen; l++) { + buf[k] = set[i]; + buf[l] = set[j]; + outcome = strcspn(buf, set); + ATF_CHECK_EQ_MSG(k, outcome, + "strcspn(\"%s\", \"%s\") = %zu != %zu", + buf, set, outcome, k); + buf[k] = '-'; + buf[l] = '-'; + } +} + +ATF_TC_WITHOUT_HEAD(match_order); +ATF_TC_BODY(match_order, tc) +{ + char buf[33], set[65]; + + test_match_order(buf, set, 32, 64); + test_match_order(buf, set, 16, 64); + test_match_order(buf, set, 8, 64); + test_match_order(buf, set, 32, 32); + test_match_order(buf, set, 16, 32); + test_match_order(buf, set, 8, 32); + test_match_order(buf, set, 32, 16); + test_match_order(buf, set, 16, 16); + test_match_order(buf, set, 8, 16); + test_match_order(buf, set, 32, 8); + test_match_order(buf, set, 16, 8); + test_match_order(buf, set, 8, 8); +} #endif /* !defined(STRSPN) */ ATF_TP_ADD_TCS(tp) @@ -214,6 +262,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, set_alignments); #ifndef STRSPN ATF_TP_ADD_TC(tp, match_positions); + ATF_TP_ADD_TC(tp, match_order); #endif return (atf_no_error()); From nobody Thu Dec 21 02:25:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwZ633Cd9z548Hl; Thu, 21 Dec 2023 02:25: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwZ631zSFz4PT6; Thu, 21 Dec 2023 02:25:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703125531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUDMgwhT3LwxiESyq53zB9yNFayl6NSllpQNAltbr1Y=; b=JN2j+uPm/5nMyVDBAbjXZtJn2y4/rlHxaAWduHxN0MjllErI7iTnVGu3k9R7gTuQXNiX7o nqfKIfk1FQvxE0cjdk7mgmvKfobBTgvwSnCsLPu0G71mcXSfiJJOd+omIceqreY3AkZ5hU D+qeHtUIzCLv62tTb++IGJX07Jw0sm1tvuflNqz3jjCGeewfnJmqq5yv4tLQj6jCjybn4O k5Y6XXCPmJ++zBfR8XNNwERUlfES8r+zjb+7aAXdG+aDXEv8EMyFfl6PJE/gdsQx4gN36Q VIt5J4S93p9Tq3tRmsoEwSWGqr7K8gstD8jdPIpFsT6Al4A4TVcKpEdWKaOmZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703125531; a=rsa-sha256; cv=none; b=sG24H8isI+rtw0YzByrwWAsyEbg0paokxE05I5pAmg6k0j3+lmIf9DeQny9tMij1701Y5F owA8ntCWfZBMp8nqQ17FbgdkBGgH05sjt0FCjxSX0bkMIBCeglLCdV15BoUMSI4TGG919y kl19rRo08TFo923zetIyPk1uoDCmlJQWe54Oboig9/YH7X/zElSN4q8gz2gq1L+Dd+0+On GOQVoFihvs9kCIthHST7vMj7Qj5V12Hm+ouOZYJTGz3k6M+NwFYp/1R9NR+QMiZj+t5F1V qOTi3lnZJAOE2aG6WnQrMChQf3iEqcEOR0GvcG21tfd+SrWB6rLwOPuSplRQwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703125531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUDMgwhT3LwxiESyq53zB9yNFayl6NSllpQNAltbr1Y=; b=KamSm+ZfhcPf4o0IqHxfd3MmrW9O6b4AmBw/nZ69EkcbBi2qIhLLvMZfAfmhiijDBPriR/ OVQjgBldarhvw5SMDSi0Hss4/tqhO0YepqUKVhstsfDwVeme80FQrqFbOmbOxd4mJxMlT3 eQMyUHG7rag9mXsLGmXYuPaaz/ichqg7Q36UbTZAbjOg1FZ3rdk9f6esb4+iPkYeRe7RJ0 91Xt2+D4tLTce1uw5HTfrTtGt4HeEP0nk1zKbuV896QfH4H2ZueCaXnsq0vynXboK/5ixV jMFu+LgjswoGTvDT2l8pkYB8RGsQM+fK5b/bhAZKdAY70ZLDC1I+0ogEkIlMqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwZ6313kbzT9; Thu, 21 Dec 2023 02:25:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL2PVFA037784; Thu, 21 Dec 2023 02:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL2PVoR037781; Thu, 21 Dec 2023 02:25:31 GMT (envelope-from git) Date: Thu, 21 Dec 2023 02:25:31 GMT Message-Id: <202312210225.3BL2PVoR037781@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: c91cd7d03a9d - main - lib/libc/amd64/string/strcspn.S: always return earliest match in 17--32 char case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c91cd7d03a9dee649ba3a1b9b4014df9de111bb8 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=c91cd7d03a9dee649ba3a1b9b4014df9de111bb8 commit c91cd7d03a9dee649ba3a1b9b4014df9de111bb8 Author: Robert Clausecker AuthorDate: 2023-12-19 17:28:57 +0000 Commit: Robert Clausecker CommitDate: 2023-12-21 02:17:17 +0000 lib/libc/amd64/string/strcspn.S: always return earliest match in 17--32 char case When matching against a set of 17--32 characters, strcspn() uses two invocations of PCMPISTRI to match against the first 16 characters of the set and then the remaining characters. If a match was found in the first half of the set, the code originally immediately returned that match. However, it is possible for a match in the second half of the set to occur earlier in the vector, leading to that match being overlooked. Fix the code by checking if there is a match in the second half of the set and taking the earlier of the two matches. The correctness of the function has been verified with extended unit tests and test runs against the glibc test suite. Approved by: mjg (implicit, via IRC) MFC after: 1 week MFC to: stable/14 --- lib/libc/amd64/string/strcspn.S | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/libc/amd64/string/strcspn.S b/lib/libc/amd64/string/strcspn.S index 53100eeea9a5..648635529e5b 100644 --- a/lib/libc/amd64/string/strcspn.S +++ b/lib/libc/amd64/string/strcspn.S @@ -255,19 +255,28 @@ ARCHENTRY(strcspn, x86_64_v2) leave ret + /* match in first set half during head */ +.Lheadmatchv2first: + mov %ecx, %eax + pcmpistri $0, %xmm0, %xmm3 # match in second set half? + cmp %ecx, %eax # before the first half match? + cmova %ecx, %eax # use the earlier match + leave + ret + .Lgt16v2: movdqu 48(%rsp, %rcx, 1), %xmm3 # second part of set /* set is 17--32 bytes in size */ pcmpistri $0, %xmm0, %xmm2 # match in first set half? - jb .Lheadmatchv2 + jb .Lheadmatchv2first pcmpistri $0, %xmm0, %xmm3 # match in second set half or end of string? jbe .Lheadmatchv2 ALIGN_TEXT 0: movdqa (%rax), %xmm0 pcmpistri $0, %xmm0, %xmm2 - jb 2f # match in first set half? + jb 4f # match in first set half? pcmpistri $0, %xmm0, %xmm3 jbe 1f # match in second set half or end of string? movdqa 16(%rax), %xmm0 @@ -277,7 +286,8 @@ ARCHENTRY(strcspn, x86_64_v2) pcmpistri $0, %xmm0, %xmm3 ja 0b # neither match in 2nd half nor string end? -3: lea -16(%rax), %rax # go back to second half + /* match in second half or NUL */ + lea -16(%rax), %rax # go back to second half 1: jc 2f # jump if match found pxor %xmm1, %xmm1 pcmpeqb %xmm1, %xmm0 # where is the NUL byte? @@ -288,6 +298,17 @@ ARCHENTRY(strcspn, x86_64_v2) leave ret + /* match in first half */ +3: sub $16, %rax # go back to second half +4: sub %rdi, %rax # offset of %xmm0 from beginning of string + mov %ecx, %edx + pcmpistri $0, %xmm0, %xmm3 # match in second set half? + cmp %ecx, %edx # before the first half match? + cmova %ecx, %edx # use the earlier match + add %rdx, %rax # return full ofset + leave + ret + /* set is empty, degrades to strlen */ .Lstrlenv2: leave From nobody Thu Dec 21 03:42:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swbq23d5dz54DQF; Thu, 21 Dec 2023 03:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swbq2384Rz4TmT; Thu, 21 Dec 2023 03:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703130158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j89ygOW3pYeEVx+0VQ3RlJSqq88leN6aKInIZ2XgqMQ=; b=oSgu1f7vFxPK3OMjdUnbh8nRRVlabXWzxX0yPFI5TkCCPFgeD6kIldTBPXIM2cHxyY9S3E Aul8d8Oz54pB3kmpvAZ6EJ2Ht3w2fihuC4/WW2c3T0vI80C/p/myq/VIjbkfTGuxU2PSDv BPaw+PS7t/zYFRZDy5oeSpRv3xJqW3UzgOiYNhRTQqfGUjcNpe68Irk4mMeNWTHNsavLdX tJF0L3anGsKXNX/ueG7HcxtPadQ10RQnlv4PM5jWUd4BuWm40f0/KWF9w0GMdTf/pn3oGG qVBGpAV5288qCFIvxCKiZnDRtTI085GzmF2hj9D1fMfkvwp+YP5kVSmGGcAiNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703130158; a=rsa-sha256; cv=none; b=ttBv6/oKj48wgn0gMLnzrSEIRhr8zw3lpe66aVPPL7Y+F4QJOIHWyVyCrpVvycP3G5VSTL JaxYs2WjPGsyJPjrewKFcVjKfQ6fyYue5tbvrsbG/jFfpa2pjPFOjygew26PGpQnIrNDma /XNL9lGogRQ/6//p8plYHczr9SjXKEZLexZoa/6l6zjyPOzySuiDGkD380bucU7piE1f/a AH1xAPtKLKmR5p7MsZHB609y/g8vCiq/V+x366c3W8y6M4hH5coflmWvIdnO7zC1oIpEqR cWwTFAe+YENqO+U7A8VjzksFuMnDGYgzikrW+urXHUTnGsjDTrCq+TrqFEuWTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703130158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j89ygOW3pYeEVx+0VQ3RlJSqq88leN6aKInIZ2XgqMQ=; b=Q1vrcAGpzMD6DOThwyMuCuW+I8MIr7QzHCR26ACG7Vo7cyLNCiLWLt3vK4V3FVl/9BSnn8 IOOIgkgIlOtoJVrltENkM7eRxC0u1Fyjp3jB6fi8KApqJTbE/Jo9I4uyEyhYDHfdyWyZgZ zNO1jG8p7n/4vrpBbFEe7+6XPGErPVB+e/tzUy0INTBdSGv23h6WppTRg9f243/Y1Z37L/ 7ZS3uoQCcXgMnmCpkSU+rYfA0n7Cu72vPFPKo3OX6U3ORxELR5M9r44PLv6aXzXeISSOa1 Qjuyqv6fC0fvtlNy5VJp/+Vz1gvFM9gkvc3HXclJrmoCAWzBT/0jiiocxQocnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swbq22Ccqz2PW; Thu, 21 Dec 2023 03:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL3gcWa072201; Thu, 21 Dec 2023 03:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL3gcmN072198; Thu, 21 Dec 2023 03:42:38 GMT (envelope-from git) Date: Thu, 21 Dec 2023 03:42:38 GMT Message-Id: <202312210342.3BL3gcmN072198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 6dd15b7a233a - main - vm_phys; fix uncalled free_contig List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dd15b7a233a87d0895cb6806ae13cfaf814b44c Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6dd15b7a233a87d0895cb6806ae13cfaf814b44c commit 6dd15b7a233a87d0895cb6806ae13cfaf814b44c Author: Doug Moore AuthorDate: 2023-12-21 03:37:47 +0000 Commit: Doug Moore CommitDate: 2023-12-21 03:37:47 +0000 vm_phys; fix uncalled free_contig Function vm_phys_free_contig does not always free memory properly when the npages parameter is less than max block size. Change it so that it does. Note that this function is not currently invoked, and this error was not triggered in earlier versions of the code. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42891 --- sys/vm/vm_phys.c | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index cd75ed092691..8c15f107c2f9 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1169,24 +1169,6 @@ vm_phys_free_pages(vm_page_t m, int order) vm_freelist_add(fl, m, order, 1); } -/* - * Return the largest possible order of a set of pages starting at m. - */ -static int -max_order(vm_page_t m) -{ - - /* - * Unsigned "min" is used here so that "order" is assigned - * "VM_NFREEORDER - 1" when "m"'s physical address is zero - * or the low-order bits of its physical address are zero - * because the size of a physical address exceeds the size of - * a long. - */ - return (min(ffsll(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, - VM_NFREEORDER - 1)); -} - /* * Free a contiguous, arbitrarily sized set of physical pages, without * merging across set boundaries. @@ -1211,7 +1193,7 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) fl = (*seg->free_queues)[m->pool]; m_end = m + npages; /* Free blocks of increasing size. */ - lo = VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT; + lo = atop(VM_PAGE_TO_PHYS(m)); if (m < m_end && (diff = lo ^ (lo + npages - 1)) != 0) { order = min(flsll(diff) - 1, VM_NFREEORDER - 1); @@ -1239,18 +1221,22 @@ vm_phys_enqueue_contig(vm_page_t m, u_long npages) void vm_phys_free_contig(vm_page_t m, u_long npages) { - int order_start, order_end; + vm_paddr_t lo; vm_page_t m_start, m_end; + unsigned max_order, order_start, order_end; vm_domain_free_assert_locked(vm_pagequeue_domain(m)); + lo = atop(VM_PAGE_TO_PHYS(m)); + max_order = min(flsll(lo ^ (lo + npages)) - 1, VM_NFREEORDER - 1); + m_start = m; - order_start = max_order(m_start); - if (order_start < VM_NFREEORDER - 1) + order_start = ffsll(lo) - 1; + if (order_start < max_order) m_start += 1 << order_start; m_end = m + npages; - order_end = max_order(m_end); - if (order_end < VM_NFREEORDER - 1) + order_end = ffsll(lo + npages) - 1; + if (order_end < max_order) m_end -= 1 << order_end; /* * Avoid unnecessary coalescing by freeing the pages at the start and @@ -1258,9 +1244,9 @@ vm_phys_free_contig(vm_page_t m, u_long npages) */ if (m_start < m_end) vm_phys_enqueue_contig(m_start, m_end - m_start); - if (order_start < VM_NFREEORDER - 1) + if (order_start < max_order) vm_phys_free_pages(m, order_start); - if (order_end < VM_NFREEORDER - 1) + if (order_end < max_order) vm_phys_free_pages(m_end, order_end); } From nobody Thu Dec 21 04:21:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swch02Lc0z54GHC; Thu, 21 Dec 2023 04:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swch01sTMz4Xwv; Thu, 21 Dec 2023 04:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcsRhMwjFCn6nNkXS27v5hvUspedk38B8DscCH78Oi8=; b=X9482wm2vzlBtzGVTrssuytVJ8+mm8MrZNrdLRD7YSrztA9qWDYiiUZx87dWyglR+fVs7e K06D3GqHRE7kk1opuybrSkCWmSGZu/CMCw/9BQy77sd3T/lOCeGJzMPneea/O5xAlmj2WI 24CAjv3U52OFkLAmhPhsqZzzsl/jj0ICSHWvNG+nsVE5/tmGsjRc5Y2wyG65zGpI+7ttRw HJyy7KRO5eTThihPPPpPKe1m+u9BDz7LUDjY6gLFEa0EPlr+RbbX5CV2wfLGOgtzaAUoaX EDZrGVZsbvQuz0HiaduypWDX20xiwGNhVPl/O/5OU0JT+WiJMOZLwXTqCZz/Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703132496; a=rsa-sha256; cv=none; b=CdUdZYtjeD53dOjyGdWfUHU2YtwoFHrwKQw9ee9h8xxt8Dj7zLfS2ktk8CcM0jCuNa0ydv 6DOSvQs0+S8XCoN0CFrWxI9Wa1444TwQyFTfnPLl8kJPcxA7rTK/+7U38LGkzbU2fp7dZT 0thep1HfFpRCF17Xla1vPMGNUXPeZfrGbPiST53fylEtGjAGm42Lz2FiTVVrq/6kDz6VXe F+lybn5t0GCgUHMpOawXMFEPfDM+GVDAisayjGvdiv3DYOlvDXyEHGZpE0QjEZsQ8KJxEd 3HXadCk3221OwfKhUbIYaRSWkJf+9t5KiqemrWjMAmad4XMK5ZqTv8uEulWRAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bcsRhMwjFCn6nNkXS27v5hvUspedk38B8DscCH78Oi8=; b=YVpK4v9O4vvV61/qbrLp8G+7DGWfywa5xn6giA1Lumicxy/mbYRN0iN69/uwfKt59t/tbf +eZbzAGwSEidL1PxqrhALwgUQfOgCmcb6+Oda7HrnIrzLNroGmBzcnQf2HcuB0hjc4vUQB r3fFhc6ZZKhq/H10jPvLcMZC4N3XdgpCJDzHadfxl4VTgfYofiZTKewZrqQOPeU/fLHYS/ 4G7a7V0isd2r1VVDdAzueKoLGTlFrBZ7hmMPIrnLN4ga8mXJWQBGFBMwrSR2mkoYQoPpWS P2QNZO9EcSalj4mIJ/j7kI1Qi73iBu3PKaJYAlYKEeDu6JQZ3VTtINKdIqEwww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swch00wNSz37N; Thu, 21 Dec 2023 04:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL4LaG6036256; Thu, 21 Dec 2023 04:21:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL4LaRR036253; Thu, 21 Dec 2023 04:21:36 GMT (envelope-from git) Date: Thu, 21 Dec 2023 04:21:36 GMT Message-Id: <202312210421.3BL4LaRR036253@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: 486ee36440e1 - main - rl: 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 486ee36440e19060a8c405fb2ba68cfdfa17d63e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=486ee36440e19060a8c405fb2ba68cfdfa17d63e commit 486ee36440e19060a8c405fb2ba68cfdfa17d63e Author: Warner Losh AuthorDate: 2023-12-20 16:55:06 +0000 Commit: Warner Losh CommitDate: 2023-12-21 04:16:29 +0000 rl: Fix typo 'or' should be 'of' here Sponsored by: Netflix --- sys/dev/rl/if_rlreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/rl/if_rlreg.h b/sys/dev/rl/if_rlreg.h index 7de7e2fcc585..6339b12472b6 100644 --- a/sys/dev/rl/if_rlreg.h +++ b/sys/dev/rl/if_rlreg.h @@ -545,7 +545,7 @@ /* * The RealTek doesn't use a fragment-based descriptor mechanism. - * Instead, there are only four register sets, each or which represents + * Instead, there are only four register sets, each of which represents * one 'descriptor.' Basically, each TX descriptor is just a contiguous * packet buffer (32-bit aligned!) and we place the buffer addresses in * the registers so the chip knows where they are. From nobody Thu Dec 21 04:21:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swch13Z6Rz54G36; Thu, 21 Dec 2023 04:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swch12tz6z4YLc; Thu, 21 Dec 2023 04:21:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuboWrEbypGChhBZkZuGyP1kkmJniQreQoT9xwTCvvk=; b=jreZSnwOMO1m0eyaE45DJHAnTZm/Qna/L/e9ZAgi5gJpoSQ4GQxoSKMqaHf6ieXtpvfDhq 29cUZ3FNQcBgxE4/MoVQo/Gz/DyTRnZR2Mm8UjiPrtUT6V1r2FpadoFjfYlX70LDAbiADY hinFW5Guw7fSZ8dR+uRpn6zyj3GGfcjEvcbGn63gci8t3JurSGNX5GiunIHO9w7HWAs21p VpSJF6j+QQv4717ISL2LAe9YC4fGU9uO4IF3/DKG69tltTsukLXsm3b2GpJPbe2ReyVNoN U092+vv2lSVW685w58pQGjNPsmRyOZD6SmL/i7BpMYRJUG/k7t21Jutnpv+TtQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703132497; a=rsa-sha256; cv=none; b=aUnXOu4xpTPvEVZZZpyOYonRCzHasK7zzMOmrstLFmNdI5UPluA8EXNAMviykLhkO7yXt6 dHIXxWwcFg4EkMnjj57IFmPGLV+SVARZzscQp7XVDjAkTPPluTg+z0AioqE1ZZyI56lgcL XJLemDjtXljKSb4WiRT9yW2UygiLY3Y0QleZxuKRf45HQmVdlHUQyr7ifSW7pH0IUUJgHe YRdXJhoOdLMNBfBn4AeSfsGF3ZNN4WSlWlPEVZLoOBO+XHzlKA2CT9AmlylZOllI19Dyix e9BRT+5uE+5hGmMPzasJobfyzjaL5fq8y9HtUO8Q+Q2Gl7C1GfXRf3PUSAGmsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuboWrEbypGChhBZkZuGyP1kkmJniQreQoT9xwTCvvk=; b=xYEfqV9zAwYnj7liYjPM/Jl0v05FDl51Umttl2rPyOTLGnaa7cM1g+v9EGYXCq5SQSvhvH ldil6S5yOY6sGBrgNXEWptlr5DxIO8A8rdUxY44kPpGTzPNWKLEd3c1V9HSNzunyxrWFSO le8JYMuZnNoXmMz0CJra2fzl0bNGtkUrIUppiJAHqk2fazc0gkmo+R35u5q+zPoVI2r7Ci VWShE7KJg4q0aVtVtu5lH92xKKz5/OVtEaYtJrTx8oKtaZI4FzWWHpqQ9TLQfrtpP5uLe1 3HoN+Crkh43MwnePPIgLeOU509uF2J9l+ckhwECJpGm36VPAJVBrLrc7DFFNPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swch11wCpz3MH; Thu, 21 Dec 2023 04:21:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL4Lb92036320; Thu, 21 Dec 2023 04:21:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL4Lb9T036317; Thu, 21 Dec 2023 04:21:37 GMT (envelope-from git) Date: Thu, 21 Dec 2023 04:21:37 GMT Message-Id: <202312210421.3BL4Lb9T036317@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: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 Author: Warner Losh AuthorDate: 2023-12-20 19:09:09 +0000 Commit: Warner Losh CommitDate: 2023-12-21 04:16:45 +0000 vtnet: Adjust rx buffer so IP header 32-bit aligned Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them. This improves performance everywhere, and allows armv7 to work at all. PR: 271288 (PR had a different fix than I wound up with) MFC After: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43136 --- sys/dev/virtio/network/if_vtnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 287af7751066..360176e4f845 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) m_freem(m_head); return (NULL); } - m->m_len = size; + m_adj(m, ETHER_ALIGN); if (m_head != NULL) { m_tail->m_next = m; m_tail = m; From nobody Thu Dec 21 04:21:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swch25PWNz54GHM; Thu, 21 Dec 2023 04:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swch2402Yz4Xtk; Thu, 21 Dec 2023 04:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9P/l7buNB/0S9G+Km3gHxX/go2VmkI0+7iqdYZhSSE=; b=hJSyHVuLR5Np8tRYf10FSNFWh8jibOl20DmrGB2Mrt+g3GqC2UtAoMKPY43dJi6w+umHhE R8Iy9con9saS6a/31XeZL64lANgJ9Yt7Vzl3kOytzhff9UzyFn7KLGmI0cTMeaYuz8/336 C0mh1c4qVHTZG9w3fv70I/rGf+50OgM/DoPpCOPFD7+fkBq+9QK19RancrKfnGdOnpEBxN P17MG1y3O3Wyoy3P3rwpfa3eKXdGO/0uGD/MOrgt3LQ8LGiE02POGbl9kjCx20yjotRwhD uhe38nPml8ML5qr4CoTpz9ftfTCvxoszbxDj1spHfvzGby0Lv7euztWVYB6nlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703132498; a=rsa-sha256; cv=none; b=mCAf8UioqVWtS7NKy3uzwdTVvECtGaqZ2ciqKjPnX3JAqHLUn02Soz5DclIZdtDpx0mRDj 5i7RIox0w4FHLCbf0o6CP8yLLVxyDVc0hEkjFFV1h6EIuW9qo9vMUVcuvD2l1SwTgq12k5 yJKtS8accelEv3P/cinH7NWlLkWdZsDtL/QmYAaM2O6v7bzfdCEmA6LzWBU+yEwjARFzbu i2biSLhnnBY3lmyY7IrcH8BhLW9nGvl0R3658IKOSelOrRY9EhAPQCArQZe5FKlxPr4Hg6 QrMf0sjROSi+Q0LpTvULwbtbvmt7wlOrTkJ3WBPETE5GQR8a9CJQ13h8ZCTtxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703132498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b9P/l7buNB/0S9G+Km3gHxX/go2VmkI0+7iqdYZhSSE=; b=I6tRtvmzJC7KapQ74vuo22Zm9t6oov1kdkcnBkPuF2fpE+ubAGbTv9Jzd+EJhxGNE9te3F TfIzZp7SJ23pnrbJA0ihw89ustlZMdpUscoGvlnOy4a/oDElWlcB2EDxHCqw7HhbcVUQnt +4tdiHBI+ftSfDA/PdyXpP9GG+nRHAAEEdswbgUHIpUFk3OEn4dm7vGkPyxElDvLeFA+gU B/ujstUxw2S1KRXXR+esqoCs1cxyL9XXHRy6++P8/5mQj+bVRMVuPguvnDFZI5hGtaHHD/ IuiHi8XFZO0nFjtbAEmMzU0YuGxs9y1/hGuEJqpLWi3sPWahG7E43IQQS/+c6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swch22wdXz3C3; Thu, 21 Dec 2023 04:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL4LchM036375; Thu, 21 Dec 2023 04:21:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL4LcEV036372; Thu, 21 Dec 2023 04:21:38 GMT (envelope-from git) Date: Thu, 21 Dec 2023 04:21:38 GMT Message-Id: <202312210421.3BL4LcEV036372@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: 64db9a0f8286 - main - Add kenv .Xr in kldload(8) and loader.conf(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac commit 64db9a0f82863d212ac0bcd49bc0254ccb9dd1ac Author: Warner Losh AuthorDate: 2023-12-21 04:15:42 +0000 Commit: Warner Losh CommitDate: 2023-12-21 04:17:38 +0000 Add kenv .Xr in kldload(8) and loader.conf(5) Sponsored by: Netflix --- sbin/kldload/kldload.8 | 3 ++- stand/defaults/loader.conf.5 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/kldload/kldload.8 b/sbin/kldload/kldload.8 index 4140f845b5e2..0dea7838d75c 100644 --- a/sbin/kldload/kldload.8 +++ b/sbin/kldload/kldload.8 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 11, 2021 +.Dd December 20, 2023 .Dt KLDLOAD 8 .Os .Sh NAME @@ -114,6 +114,7 @@ Only those modules necessary for booting the system, including those required for mounting the root filesystem, should be handled by .Xr loader.conf 5 . .Sh SEE ALSO +.Xr kenv 1 , .Xr kldload 2 , .Xr loader.conf 5 , .Xr rc.conf 5 , diff --git a/stand/defaults/loader.conf.5 b/stand/defaults/loader.conf.5 index 195b34e75fdd..8b7508c8a5b2 100644 --- a/stand/defaults/loader.conf.5 +++ b/stand/defaults/loader.conf.5 @@ -21,7 +21,7 @@ .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. -.Dd July 31, 2021 +.Dd December 20, 2023 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -431,6 +431,7 @@ user defined settings written in lua. machine-specific settings for sites with a common loader.conf. .El .Sh SEE ALSO +.Xr kenv 1 , .Xr loader.conf.lua 5 , .Xr rc.conf 5 , .Xr boot 8 , From nobody Thu Dec 21 09:36:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swlg52fHNz54ZXQ; Thu, 21 Dec 2023 09:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swlg515jmz3SmG; Thu, 21 Dec 2023 09: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=1703151377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slPtuKXpR8uFRvG5yEZfpQ4f7LVBwv69hUJdj0mIFZM=; b=ugkGJkg8HsWqyaFzCyutnafw9Ug8Ddk3X1FdazHeutywJxxYLyGz4dSTmf2QTstshMHZJN GCUzkC49rNss6KYmVu8GFw94OyrdgBTwve1U9jpeSBpnP+B1wBa2QfTdXM64FCScEzYVFb E+BCqUoFrWEDP3gOpOUY2uknbSY6vCfKWMj/nyXTAT/jRBOlF26gz5Y8j7+yvnzUAXhntw CTdcx2F0rmM+IpRcFihMJKFJOB2EZmTx+QzQUf/o4L6jIGvAXe0kSaQiI94cLKclYnOVEp NRb5xf4jQCP66lng1Me3/3QgvKPEVAoFk47l3pBp1W3Kv9tqAFPfovCvQPAZgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703151377; a=rsa-sha256; cv=none; b=fwFOHbD+t+j7yHThyb6FcEzcfZV2FzwrJYiwhC2alAsbclSgviX4DtjAP4bBYzR2sdCD8d bTGF9ix71kZ5hTe/7v8qfqynxB+wWfBD9sN7UMlPR/zvQtBrQaKlL3SuWKwP2Vc1tz1bSd YUQraCrm8qHKgPeI3L/mvfwPaSvHL+LcwLuS+2Oz7Frhn8PbcFKcU7qmDB92Qp8jp0ZM+/ UQg6psv1gBxcI2OCSsD89UA1OAY8W+lFNiNvMOjxcf8Muste7HQmnYhKzUQA3TPD3kmzzO cfrDS9wLpNlS3ZUR0cZHMURpWSOznIGvF06sh/+hVbV9fku0JwLF+WZEZBIthQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703151377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slPtuKXpR8uFRvG5yEZfpQ4f7LVBwv69hUJdj0mIFZM=; b=cFiEf5bMvfcVWHOGjV+9NN9+9Pom6RQO6dP9qYZqzW0zf+R5ETJPFsql33nYYv64H4lxy5 zmL/XNihI32PRf6KH9slElTmxTHOWBU9K3D3cyaZ81J0C59YnN/71TU5qlZIV6rIANdGET u+v/oyE5uPAFHL6tKxHLPC7swdXD6P92BeQ2mR7d+XA7cSLMoBRWb77uV7YU4sQ+STwLvY 0mPBaiQ9X7Un5bj4OOrJiGapT+NVBFSB26noH2n0RJHB+LL+wQitSQSYEh01uoeRLLJl1s sOTdQK2xuBGr7LwvysvQr/cbWKZiJ4JmgUjIKSI9COBVVM9NSwggHPs0s97QsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swlg4714BzCF1; Thu, 21 Dec 2023 09:36:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BL9aGkQ060868; Thu, 21 Dec 2023 09:36:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BL9aGjF060865; Thu, 21 Dec 2023 09:36:16 GMT (envelope-from git) Date: Thu, 21 Dec 2023 09:36:16 GMT Message-Id: <202312210936.3BL9aGjF060865@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: f6d8ea893bb2 - stable/14 - pf tests: fix typos in the abort_v6 test case head / cleanup function name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f6d8ea893bb228dcd8e5ece6f52b6e6cec5c2061 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f6d8ea893bb228dcd8e5ece6f52b6e6cec5c2061 commit f6d8ea893bb228dcd8e5ece6f52b6e6cec5c2061 Author: Kristof Provost AuthorDate: 2023-12-14 09:22:26 +0000 Commit: Kristof Provost CommitDate: 2023-12-21 09:35:51 +0000 pf tests: fix typos in the abort_v6 test case head / cleanup function name MFC after: 1 week (cherry picked from commit 8fab83d2c5c5e801105dbf25c28252fc97935b00) --- tests/sys/netpfil/pf/sctp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 86356128bb7e..66225e132d1c 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -240,7 +240,7 @@ abort_v4_cleanup() } atf_test_case "abort_v6" "cleanup" -abort_v4_head() +abort_v6_head() { atf_set descr 'Test sending ABORT messages over IPv6' atf_set require.user root @@ -292,7 +292,7 @@ abort_v6_body() fi } -abort_v4_cleanup() +abort_v6_cleanup() { pft_cleanup } From nobody Thu Dec 21 13:43:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws896N7Sz54pfT; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws895nXhz4NFF; Thu, 21 Dec 2023 13:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xw1PYDei69F4QvfYVJuLjMLr7Md4CdU5J3KKt2m/syk=; b=Lc8mkcFSWptHHfn22jZrT18oypanCkrh+bhLQjPUH+DM4WMP1Jvn/oGXgV4hRCjkHDUqpr PFZKMU7aemsI+PgXdgL8yO8rYJSCwlOBAR56h2RVURotEUJ5s+UTz9T6yKRPpVTOFjg39S 6+gvKAziEXLxVfmQhb2316MbDyGmlrK+LaGmcOePWqysKkHuK64KgsRZrPKXFPjHLWAX17 CgJNScvVyP08KEYYR/T4dJxjdZXcgu12ZVGH5PSpgK+xPolZrLvp6bdcck0btOqSwhmlrG va1lZsdD1+mRDZqo0OVMJoaJRiUxg2bNnGF4e2n/WeyoO2VY3wJBGSobCNn0Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166201; a=rsa-sha256; cv=none; b=d2tusZNxchnBDg5qS3Bl8OLJX5db3X7MUkt5YMtLoNcj5Io1LGQiuXdvoeLluWgUNJmiVb 8djBJiM/kqtCZBZVRiiau0ZeMQPxOBNKLFMwDUNbYKgTCQgh1Ofdd97lV1L64PciEjS70f I0SzEjXCM5Dd+zHcDIfL+2PB+hqVZfXrZbKXQHxEafjj+pfg1DkSJtXJDntOkWeK+qb4VZ KRuBf9IGNgfNWCF2EqnzTpqvZWv/bWG8+r/F+LfHK75QWUfYMdJ6a6WbmNUKxGcXOXQF0Q RbIMKIKjsY/nyyjDGZY/K+dt/AiEp75KwgMA31FU/buXdeEbnCUYg+Amn+j77A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xw1PYDei69F4QvfYVJuLjMLr7Md4CdU5J3KKt2m/syk=; b=ZcIXV9qTllFpWx4AC542TfWb6WEBBb9sfdVzLgORq8kxN5tc8cqpdklPYx0BkaAoTa1sGk XRJWv1EcL6sLmG5pbSWPuaNqrQbzwrwSUGTe6CWD8FPBc6ziVdTG4+ry9oKRJcDg4D3or+ 8oysG1/GP2wVT5qF4Zb2Gxeg4OVK9b43kwV+yEXho94mAiet2KUoLRquWFLvfR5wgqM3iH q+rkJtnbtdOVWa6L0VKpCuSXNPcD4rMC5XKhgIEfDQn12/yiycc6DsBv/ccTHo+JHsWN6g GtSdSiM4+T+BAYrKuWAuSaROA76p4GtckVKXiYRsoaEYt00YjdEJe+Y2dZC2Pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws894rfVzZmG; Thu, 21 Dec 2023 13:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhLQA078530; Thu, 21 Dec 2023 13:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhLH8078527; Thu, 21 Dec 2023 13:43:21 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:21 GMT Message-Id: <202312211343.3BLDhLH8078527@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: 7552dce04702 - stable/13 - x86: AMD Zen2: Zenbleed chicken bit mitigation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 7552dce0470201fc150b0fc7a2c1b5c452dc35ca Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7552dce0470201fc150b0fc7a2c1b5c452dc35ca commit 7552dce0470201fc150b0fc7a2c1b5c452dc35ca Author: Olivier Certner AuthorDate: 2023-09-11 14:18:30 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:35:48 +0000 x86: AMD Zen2: Zenbleed chicken bit mitigation Applies only to bare-metal Zen2 processors. The system currently automatically applies it to all of them. Tunable/sysctl 'machdep.mitigations.zenbleed.enable' can be used to forcibly enable or disable the mitigation at boot or run-time. Possible values are: 0: Mitigation disabled 1: Mitigation enabled 2: Run the automatic determination. Currently, value 2 is the default and has identical effect as value 1. This might change in the future if we choose to take into account microcode revisions in the automatic determination process. The tunable/sysctl value is simply ignored on non-applicable CPU models, which is useful to apply the same configuration on a set of machines that do not all have Zen2 processors. Trying to set it to any integer value not listed above is silently equivalent to setting it to value 2 (automatic determination). The current mitigation state can be queried through sysctl 'machdep.mitigations.zenbleed.state', which returns "Not applicable", "Mitigation enabled" or "Mitigation disabled". Note that this state is not guaranteed to be accurate in case of intervening modifications of the corresponding chicken bit directly via cpuctl(4) (this includes the cpucontrol(8) utility). Resetting the desired policy through 'machdep.mitigations.zenbleed.enable' (possibly to its current value) will reset the hardware state and ensure that the reported state is again coherent with it. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41817 (cherry picked from commit ebaea1bcd2eb0aa90937637ed305184b6fedc69b) Approved by: markj (mentor) --- sys/amd64/acpica/acpi_wakeup.c | 1 + sys/amd64/amd64/initcpu.c | 3 + sys/amd64/amd64/machdep.c | 4 ++ sys/dev/cpuctl/cpuctl.c | 1 + sys/x86/include/specialreg.h | 1 + sys/x86/include/x86_var.h | 3 + sys/x86/x86/cpu_machdep.c | 123 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 136 insertions(+) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index 3b21935255cb..0f9f987b6590 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -306,6 +306,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, amd64_syscall_ret_flush_l1d_recalc(); hw_ssb_recalculate(true); x86_rngds_mitg_recalculate(true); + zenbleed_check_and_apply(true); AcpiSetFirmwareWakingVector(0, 0); } else { diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index eb699a4f90fc..20ac7f7c6be1 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -193,6 +193,9 @@ init_amd(void) hw_lower_amd64_sharedpage = 1; } } + + /* Zenbleed. See the comments in 'cpu_machdep.c'. */ + zenbleed_check_and_apply(false); } /* diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index d4de3c0fd679..eef11f0bdddd 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1493,6 +1493,10 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("machdep.mitigations.rngds.enable", &x86_rngds_mitg_enable); + TUNABLE_INT_FETCH("machdep.mitigations.zenbleed.enable", + &zenbleed_enable); + zenbleed_sanitize_enable(); + finishidentcpu(); /* Final stage of CPU initialization */ /* diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c index 9c56db1ad19a..1fa655342121 100644 --- a/sys/dev/cpuctl/cpuctl.c +++ b/sys/dev/cpuctl/cpuctl.c @@ -546,6 +546,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td) hw_mds_recalculate(); x86_taa_recalculate(); x86_rngds_mitg_recalculate(true); + zenbleed_check_and_apply(true); printcpuinfo(); return (0); } diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index f45990a056c8..4886430c84b6 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -1172,6 +1172,7 @@ /* MSR_DE_CFG */ #define DE_CFG_10H_12H_STACK_POINTER_JUMP_FIX_BIT 0x1 #define DE_CFG_ZEN_LOAD_STALE_DATA_FIX_BIT 0x2000 +#define DE_CFG_ZEN2_FP_BACKUP_FIX_BIT 0x200 /* VIA ACE crypto featureset: for via_feature_rng */ #define VIA_HAS_RNG 1 /* cpu has RNG */ diff --git a/sys/x86/include/x86_var.h b/sys/x86/include/x86_var.h index 5998998f0a5f..c938d96372d8 100644 --- a/sys/x86/include/x86_var.h +++ b/sys/x86/include/x86_var.h @@ -90,6 +90,7 @@ extern int hw_ssb_active; extern int x86_taa_enable; extern int cpu_flush_rsb_ctxsw; extern int x86_rngds_mitg_enable; +extern int zenbleed_enable; extern int cpu_amdc1e_bug; struct pcb; @@ -139,6 +140,8 @@ void hw_mds_recalculate(void); void hw_ssb_recalculate(bool all_cpus); void x86_taa_recalculate(void); void x86_rngds_mitg_recalculate(bool all_cpus); +void zenbleed_sanitize_enable(void); +void zenbleed_check_and_apply(bool all_cpus); void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame); void nmi_call_kdb_smp(u_int type, struct trapframe *frame); void nmi_handle_intr(u_int type, struct trapframe *frame); diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index 51928805a653..5b8ff03d721b 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -1482,6 +1482,129 @@ SYSCTL_PROC(_machdep_mitigations_rngds, OID_AUTO, state, sysctl_rngds_state_handler, "A", "MCU Optimization state"); + +/* + * Zenbleed. + * + * No corresponding errata is publicly listed. AMD has issued a security + * bulletin (AMD-SB-7008), entitled "Cross-Process Information Leak". This + * document lists (as of August 2023) platform firmware's availability target + * dates, with most being November/December 2023. It will then be up to + * motherboard manufacturers to produce corresponding BIOS updates, which will + * happen with an inevitable lag. Additionally, for a variety of reasons, + * operators might not be able to apply them everywhere due. On the side of + * standalone CPU microcodes, no plans for availability have been published so + * far. However, a developer appearing to be an AMD employee has hardcoded in + * Linux revision numbers of future microcodes that are presumed to fix the + * vulnerability. + * + * Given the stability issues encountered with early microcode releases for Rome + * (the only microcode publicly released so far) and the absence of official + * communication on standalone CPU microcodes, we have opted instead for + * matching by default all AMD Zen2 processors which, according to the + * vulnerability's discoverer, are all affected (see + * https://lock.cmpxchg8b.com/zenbleed.html). This policy, also adopted by + * OpenBSD, may be overriden using the tunable/sysctl + * 'machdep.mitigations.zenbleed.enable'. We might revise it later depending on + * official statements, microcode updates' public availability and community + * assessment that they actually fix the vulnerability without any instability + * side effects. + */ + +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, zenbleed, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Zenbleed OS-triggered prevention (via chicken bit)"); + +/* 2 is auto, see below. */ +int zenbleed_enable = 2; + +void +zenbleed_sanitize_enable(void) +{ + /* Default to auto (2). */ + if (zenbleed_enable < 0 || zenbleed_enable > 2) + zenbleed_enable = 2; +} + +static bool +zenbleed_chicken_bit_applicable(void) +{ + /* Concerns only bare-metal AMD Zen2 processors. */ + return (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) == 0x17 && + CPUID_TO_MODEL(cpu_id) >= 0x30 && + vm_guest == VM_GUEST_NO); +} + +static bool +zenbleed_chicken_bit_should_enable(void) +{ + /* + * Obey tunable/sysctl. + * + * As explained above, currently, the automatic setting (2) and the "on" + * one (1) have the same effect. In the future, we might additionally + * check for specific microcode revisions as part of the automatic + * determination. + */ + return (zenbleed_enable != 0); +} + +void +zenbleed_check_and_apply(bool all_cpus) +{ + bool set; + + if (!zenbleed_chicken_bit_applicable()) + return; + + set = zenbleed_chicken_bit_should_enable(); + + x86_msr_op(MSR_DE_CFG, + (set ? MSR_OP_OR : MSR_OP_ANDNOT) | + (all_cpus ? MSR_OP_RENDEZVOUS_ALL : MSR_OP_LOCAL), + DE_CFG_ZEN2_FP_BACKUP_FIX_BIT, NULL); +} + +static int +sysctl_zenbleed_enable_handler(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = zenbleed_enable; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + zenbleed_enable = val; + zenbleed_sanitize_enable(); + zenbleed_check_and_apply(true); + return (0); +} +SYSCTL_PROC(_machdep_mitigations_zenbleed, OID_AUTO, enable, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + sysctl_zenbleed_enable_handler, "I", + "Enable Zenbleed OS-triggered mitigation (chicken bit) " + "(0: Force disable, 1: Force enable, 2: Automatic determination)"); + +static int +sysctl_zenbleed_state_handler(SYSCTL_HANDLER_ARGS) +{ + const char *state; + + if (!zenbleed_chicken_bit_applicable()) + state = "Not applicable"; + else if (zenbleed_chicken_bit_should_enable()) + state = "Mitigation enabled"; + else + state = "Mitigation disabled"; + return (SYSCTL_OUT(req, state, strlen(state))); +} +SYSCTL_PROC(_machdep_mitigations_zenbleed, OID_AUTO, state, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_zenbleed_state_handler, "A", + "Zenbleed OS-triggered mitigation (chicken bit) state"); + + /* * Enable and restore kernel text write permissions. * Callers must ensure that disable_wp()/restore_wp() are executed From nobody Thu Dec 21 13:43:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8C0Xkbz54pTn; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8B6rVSz4NHr; Thu, 21 Dec 2023 13:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Xq5NMtSrOcpnM6SEF4N2/b67OU96Aw3TckktWXQoFs=; b=OqN4+ax9+Fmbl8ksipoE77ySVrQFZfmvjkPO9cBE3IgTEK4YRNQH2G276mnZNB4HPK2gAw gyY6OSp4HGCgvq4hC7a3uE8i2F7lQSDelgK4e0+z0KZJJg8vi+Wu7giYiusgGgF4eAeV+U FFEti5gUxPeYt3TIe7jQ8qV5RfAlFGNm1R4KdesImMSPUWfiIubYH/VqT/Q2fa+2LBdtMH 18Vrg3U7KUvnqGEwLbtHfZEBsQVtuisPCgjNfgvynQHrEanF48mB8yh6cdRHsgYYd1T7zp eD77xwp3E4kiO+oZ4WB6DgvmvqKMfQmQQu+l5hxyYOIv1AXBD3fqQNMpwtFeHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166203; a=rsa-sha256; cv=none; b=jCy9p1Lm4UIwbrb/jb1jKYb4W9Brk8n/JQ8xChpDICPwnwWYZjbjSDyz9wPw33XVp6DNto 4BE6KxL3zGG7lEKxiCU4XiEWnDg7nXlTyB5/oS5do2pvtSMCMp4Uq3w5Nc1ksX5ihGtnuX SI9pCa26p6CHXohoe5Jad+fvEHDk+NCaURBRlt2KpLgpkH+4Ld+YbT6E84+PuBHlJCwZqU KNYrx8veLOcm2/qAEYAyLH7KlVWfUFKeRw4EegHQkrtHr+4yFnQ79frfBIGyZZvdd6AylD BHRDv1L+08BG+rrKIliVk1s2nC7+xUMw30iXBJtHGD6R2iE4l6dFRSlzIZkh2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9Xq5NMtSrOcpnM6SEF4N2/b67OU96Aw3TckktWXQoFs=; b=wN0eRyFW/R65q5Kbji/2MkDxSzPXd/lH8bk2ZN2lUz8Ldnfmv6MaeY6RBNFz9n4FMiGsdq sdn70PGBpenggPsKjF+4BBnN+XkEqKX3te/ZoBUXVz1Gr/fAVkq82/Q9JvimOBI/NgXzPg G0X2eUeL/NCIF2Ksrd+TR3SdCfaNBBfXMR5/yGryOGxn0o3Qg/1ZgxTPmkDE/QRn/ZV9ne YeG4YGT8SxH0EBTs1dEYQyOkYvrgsfLXF0XS9t6RfpT2bWqfKQCKyGrpROeOn8ifuWNdjo 9VsMiXnUXO55q3eJ0hzEs83sMdmV1eLjOk7b9NInsMVj8H5oBapb2yqUQJpfPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8B5xp1zZmH; Thu, 21 Dec 2023 13:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhM4U078584; Thu, 21 Dec 2023 13:43:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhMYS078581; Thu, 21 Dec 2023 13:43:22 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:22 GMT Message-Id: <202312211343.3BLDhMYS078581@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: d40c6fa7db7d - stable/13 - cr_canseejailproc(): New privilege, no direct check for UID 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d40c6fa7db7d36d5c5f00648a73f17b273ab6bcb Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d40c6fa7db7d36d5c5f00648a73f17b273ab6bcb commit d40c6fa7db7d36d5c5f00648a73f17b273ab6bcb Author: Olivier Certner AuthorDate: 2023-08-17 23:54:37 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:00 +0000 cr_canseejailproc(): New privilege, no direct check for UID 0 Use priv_check_cred() with a new privilege (PRIV_SEEJAILPROC) instead of explicitly testing for UID 0 (the former has been the rule for almost 20 years). As a consequence, cr_canseejailproc() now abides by the 'security.bsd.suser_enabled' sysctl and MAC policies. Update the MAC policies Biba and LOMAC, and prison_priv_check() so that they don't deny this privilege. This preserves the existing behavior (the 'root' user is not restricted, even when jailed, unless 'security.bsd.suser_enabled' is not 0) and is consistent with what is done for the related policies/privileges (PRIV_SEEOTHERGIDS, PRIV_SEEOTHERUIDS). Reviewed by: emaste (earlier version), mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40626 (cherry picked from commit 7974ca1cdbee949f5e453eea112be265b425c407) Approved by: markj (mentor) --- sys/kern/kern_jail.c | 1 + sys/kern/kern_prot.c | 7 +++++-- sys/security/mac_biba/mac_biba.c | 1 + sys/security/mac_lomac/mac_lomac.c | 1 + sys/sys/priv.h | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index d03612e43c52..9a9371f8591d 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -3614,6 +3614,7 @@ prison_priv_check(struct ucred *cred, int priv) */ case PRIV_SEEOTHERGIDS: case PRIV_SEEOTHERUIDS: + case PRIV_SEEJAILPROC: /* * Jail implements inter-process debugging limits already, so diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index a405acfee433..8b56ba3f8846 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1428,9 +1428,12 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_jail_proc, CTLFLAG_RW, int cr_canseejailproc(struct ucred *u1, struct ucred *u2) { - if (u1->cr_uid == 0) + if (see_jail_proc || /* Policy deactivated. */ + u1->cr_prison == u2->cr_prison || /* Same jail. */ + priv_check_cred(u1, PRIV_SEEJAILPROC) == 0) /* Privileged. */ return (0); - return (!see_jail_proc && u1->cr_prison != u2->cr_prison ? ESRCH : 0); + + return (ESRCH); } /*- diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index b175e57b2812..2d0df254f94c 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -1924,6 +1924,7 @@ biba_priv_check(struct ucred *cred, int priv) */ case PRIV_SEEOTHERGIDS: case PRIV_SEEOTHERUIDS: + case PRIV_SEEJAILPROC: break; /* diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c index 8cd9fcf190c6..761214db07e4 100644 --- a/sys/security/mac_lomac/mac_lomac.c +++ b/sys/security/mac_lomac/mac_lomac.c @@ -1692,6 +1692,7 @@ lomac_priv_check(struct ucred *cred, int priv) */ case PRIV_SEEOTHERGIDS: case PRIV_SEEOTHERUIDS: + case PRIV_SEEJAILPROC: break; /* diff --git a/sys/sys/priv.h b/sys/sys/priv.h index e0e8d98f294a..9e6d876be874 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -105,6 +105,7 @@ #define PRIV_CRED_SETRESGID 58 /* setresgid. */ #define PRIV_SEEOTHERGIDS 59 /* Exempt bsd.seeothergids. */ #define PRIV_SEEOTHERUIDS 60 /* Exempt bsd.seeotheruids. */ +#define PRIV_SEEJAILPROC 61 /* Exempt from bsd.see_jail_proc. */ /* * Debugging privileges. From nobody Thu Dec 21 13:43:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8D1pmhz54pNq; Thu, 21 Dec 2023 13:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8D0nphz4N95; Thu, 21 Dec 2023 13:43:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hv51WFtqd268JW9XDM2mf4wfLd/FP6x2xHhv+VB2B+M=; b=yUHiuWngKCjbmlzD5LYE/A1EDh1tWTltf98IKKXfV+c8zfnkp7sblkgBIcJ+4KkzkwRKVE M142qTC/RiNmWdIs0bGP46A71GXz4XLkWtyndykAlhUMSHlNBW/c1fPymhF+DnaNnbAfh1 PSWYWEGwtPOCwqicYNoNE6dxhACcUN5TMrXMYwEUm49cQHA9oOHcSNw5e1jBZiFP8Qtn8w pHccfLJtZnjgy02jPimpQZy9lJSAg0g8Acws9QwPgpF90us3cJNGlVbtZYPpK7sC6ExcRz lgYObmHQHLwPLIO1sBBNf3fG4LUM2u+YTuyQAuxcj2DvYNzKhK1cFJk9HX/pPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166204; a=rsa-sha256; cv=none; b=DytpbCtbaURGPa2y0EzETBJJKUVAsluGsnqFmvOeuj2YLfEazNOEGjP9WcaKEzu9gYfcly KEbyoKxoIFLpowxX/9IEc2//ThOy7qZz5HFQxEyIzG7rIpUXATfBiCT8lb8nwx+bsz573Q LOkrri9nAezHdPrQne7W8F8LxE9TvZQIkNpM9Nr1zTKnC0k1wRYT6SlfGklIXrVU0LposT 7CiD0FJD42ngUTFQ3hdHKNbpoSBXReife5in3pseHHacg+lR3mjEkL1NVFUmTBi7WruQqI Ho6ihag0N5raNNUnudlM23FnOoH9fR0tXN6OTPMWHj9kqctzWmwZs4oigdjx+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hv51WFtqd268JW9XDM2mf4wfLd/FP6x2xHhv+VB2B+M=; b=JD67Lr3jTCQRpaN6PeeIl4KI9/XcxWvNDgE+DnBQQuDOR7+iDdLtJmCUuJr3OKMZa70TD6 sDNbRP77b5KvhhFLvI7dWSaAMA/xRX1UkQV/5nZBskUcoI6eYekph/fDiy4jvgt8fOrrfR Zlu6R++L2YugNR66JerdBQaIy+P/wHZOKu6LU7RmEqOtztayQ6YSi44JQ6kRlvsZdcZ+Dn oTWE+M1nDQ0toFE7uSg1b3kKG1b8AUpmKC4x+4V6eGlUQpOByoG/6OxIP7fpO5x6jH7r2s yeTaolM+h8umHCKGrLd8HcV/JuYkqBO3HjDOkdgf2sSiW0+AzG5BYZuDp8+M2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8C700jzb5p; Thu, 21 Dec 2023 13:43:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhN6E078638; Thu, 21 Dec 2023 13:43:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhNu0078635; Thu, 21 Dec 2023 13:43:23 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:23 GMT Message-Id: <202312211343.3BLDhNu0078635@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: 0dafeb5bc874 - stable/13 - New cr_bsd_visible(): Whether BSD policies deny seeing subjects/objects List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0dafeb5bc874d79907cc25b3c8dc14f9ed55b396 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0dafeb5bc874d79907cc25b3c8dc14f9ed55b396 commit 0dafeb5bc874d79907cc25b3c8dc14f9ed55b396 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:38 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:09 +0000 New cr_bsd_visible(): Whether BSD policies deny seeing subjects/objects This is a new helper function that leverages existing code: It calls successively cr_canseeotheruids(), cr_canseeothergids() and cr_canseejailproc() (as long as the previous didn't deny access). Will be used in a subsequent commit. Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40627 (cherry picked from commit e4a7b4f99cfd4931468c0866da4ae8b49cf5badb) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 19 +++++++++++++++++++ sys/sys/proc.h | 1 + 2 files changed, 20 insertions(+) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 8b56ba3f8846..8118afd4d366 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1436,6 +1436,25 @@ cr_canseejailproc(struct ucred *u1, struct ucred *u2) return (ESRCH); } +/* + * Helper for cr_cansee*() functions to abide by system-wide security.bsd.see_* + * policies. Determines if u1 "can see" u2 according to these policies. + * Returns: 0 for permitted, ESRCH otherwise + */ +int +cr_bsd_visible(struct ucred *u1, struct ucred *u2) +{ + int error; + + if ((error = cr_canseeotheruids(u1, u2))) + return (error); + if ((error = cr_canseeothergids(u1, u2))) + return (error); + if ((error = cr_canseejailproc(u1, u2))) + return (error); + return (0); +} + /*- * Determine if u1 "can see" the subject specified by u2. * Returns: 0 for permitted, an errno value otherwise diff --git a/sys/sys/proc.h b/sys/sys/proc.h index b279839dbf8d..a85ae239f46b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1095,6 +1095,7 @@ int pget(pid_t pid, int flags, struct proc **pp); void ast(struct trapframe *framep); struct thread *choosethread(void); +int cr_bsd_visible(struct ucred *u1, struct ucred *u2); int cr_cansee(struct ucred *u1, struct ucred *u2); int cr_canseesocket(struct ucred *cred, struct socket *so); int cr_canseeothergids(struct ucred *u1, struct ucred *u2); From nobody Thu Dec 21 13:43:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8F4Lc6z54pYv; Thu, 21 Dec 2023 13:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8F1zFrz4NLb; Thu, 21 Dec 2023 13:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTvT4jV8Q08wALJVO7oBXtRc17exElzc3JsBRjkWNl8=; b=WjfphLMo/C/1buWaf1GyR8p9TrR/jO1WDn+kFKxVNYsAVKc6MWRVu5lpIwB4KQPNSwiBfA WXAFnQkJxGUJ08A5ZZssvhvYgUCrdLn3og3q+SXHwG/FvxSl72EOP+41okRBJKC/FnoTfj BJCWaneeeZ1mOjSpbilpIxrezVcRsKEMvuMbm6MCpiIeLQ6XIrSUacXZG460/t0M38C6ps mceE6POn3ZANcZqUTaA1Owz8hYRLUdQGrJSTFLRLOi3wRHbZPYuC7jz8ycMxxM0NBLywxW zj/2cU/wGFTiCRjgVwEff2kZeULhylQBpYCntwmNuTHu744bCTBk/GDjX002LA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166205; a=rsa-sha256; cv=none; b=ch+8Ju7w6QOsfLrpgo5StQy/+YbGHAi7Q0YTLA8QKwFtcCcqc7Ftr3Z+wPhuoUxtOM7zDJ mNkYWFElm8r6qzmm4pcLTk10XgYg+JJNdqs/my7vV5RbZi7UOOIdZjZqJFMEV4Vd1W7WWB QF3QbmhGXZM9geZxqIsb9r4BE/eyTHP8Ebo2ONW6Oo/f0Tui0OdLHsQLAglexYH2lcb2WE JlekNqnn9BYwFMQxbxXLrbsEdBRudojbzXloCEuEtPMjy4XOAAE38LuOiyqQ7p4UaQDSqZ QGnVK23PVTsyIqrnsN6ICmbLfmg9aheGTOGEYFIb+zL0vV0tUNXwalF6LOPV6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTvT4jV8Q08wALJVO7oBXtRc17exElzc3JsBRjkWNl8=; b=s0loq3D8wdIJD+5gUbyu43SeUoI8XR94CC4/2EeJgGNdioRw7DK6yX9iKNCxodT8TCo0W0 HJA9y/4S1RjuYUBs3EtSr2huafLI5307V0R19WyUC+KyLlPjWcnqveYB5mMCONSWg1T6uf f9FcnVYDX3yZE8ZyAr5MMgFByntDJ//CyFVqd2M9Xoy/xjkGh3jvN6Upr2qxLlPPyLNZX3 +wwLI07kF8dmZaPNqHJbYs3phdSUzrC/TYWB8a4rpzEzh74ZNdfLqkFgewsj4eTdYNO6Vu kXAWZyVQlSvtL5GCAbkju2s7PyAaT6DDRXLfuI+epDER7kUTkYPZH7ynLIelqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8F0v3JzZRS; Thu, 21 Dec 2023 13:43:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhPGr078680; Thu, 21 Dec 2023 13:43:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhPiq078677; Thu, 21 Dec 2023 13:43:25 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:25 GMT Message-Id: <202312211343.3BLDhPiq078677@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: 9a4a7e5fb6e9 - stable/13 - Fix 'security.bsd.see_jail_proc' by using cr_bsd_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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9a4a7e5fb6e901e81c8e64a988358ad4b59464a5 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9a4a7e5fb6e901e81c8e64a988358ad4b59464a5 commit 9a4a7e5fb6e901e81c8e64a988358ad4b59464a5 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:38 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:17 +0000 Fix 'security.bsd.see_jail_proc' by using cr_bsd_visible() As implemented, this security policy would only prevent seeing processes in sub-jails, but would not prevent sending signals to, changing priority of or debugging processes in these, enabling attacks where unprivileged users could tamper with random processes in sub-jails in particular circumstances (conflated UIDs) despite the policy being enforced. PR: 272092 Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40628 (cherry picked from commit 5817169bc4a06a35aa5ef7f5ed18f6cb35037e18) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 25 +++++++------------------ sys/netinet/in_prot.c | 4 +--- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 8118afd4d366..7f196a446315 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1473,11 +1473,7 @@ cr_cansee(struct ucred *u1, struct ucred *u2) if ((error = mac_cred_check_visible(u1, u2))) return (error); #endif - if ((error = cr_canseeotheruids(u1, u2))) - return (error); - if ((error = cr_canseeothergids(u1, u2))) - return (error); - if ((error = cr_canseejailproc(u1, u2))) + if ((error = cr_bsd_visible(u1, u2))) return (error); return (0); } @@ -1538,9 +1534,7 @@ cr_cansignal(struct ucred *cred, struct proc *proc, int signum) if ((error = mac_proc_check_signal(cred, proc, signum))) return (error); #endif - if ((error = cr_canseeotheruids(cred, proc->p_ucred))) - return (error); - if ((error = cr_canseeothergids(cred, proc->p_ucred))) + if ((error = cr_bsd_visible(cred, proc->p_ucred))) return (error); /* @@ -1655,10 +1649,9 @@ p_cansched(struct thread *td, struct proc *p) if ((error = mac_proc_check_sched(td->td_ucred, p))) return (error); #endif - if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) - return (error); - if ((error = cr_canseeothergids(td->td_ucred, p->p_ucred))) + if ((error = cr_bsd_visible(td->td_ucred, p->p_ucred))) return (error); + if (td->td_ucred->cr_ruid != p->p_ucred->cr_ruid && td->td_ucred->cr_uid != p->p_ucred->cr_ruid) { error = priv_check(td, PRIV_SCHED_DIFFCRED); @@ -1725,9 +1718,7 @@ p_candebug(struct thread *td, struct proc *p) if ((error = mac_proc_check_debug(td->td_ucred, p))) return (error); #endif - if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) - return (error); - if ((error = cr_canseeothergids(td->td_ucred, p->p_ucred))) + if ((error = cr_bsd_visible(td->td_ucred, p->p_ucred))) return (error); /* @@ -1819,9 +1810,7 @@ cr_canseesocket(struct ucred *cred, struct socket *so) if (error) return (error); #endif - if (cr_canseeotheruids(cred, so->so_cred)) - return (ENOENT); - if (cr_canseeothergids(cred, so->so_cred)) + if (cr_bsd_visible(cred, so->so_cred)) return (ENOENT); return (0); @@ -1851,7 +1840,7 @@ p_canwait(struct thread *td, struct proc *p) #endif #if 0 /* XXXMAC: This could have odd effects on some shells. */ - if ((error = cr_canseeotheruids(td->td_ucred, p->p_ucred))) + if ((error = cr_bsd_visible(td->td_ucred, p->p_ucred))) return (error); #endif diff --git a/sys/netinet/in_prot.c b/sys/netinet/in_prot.c index 222e39c6bcd2..204f4f60456e 100644 --- a/sys/netinet/in_prot.c +++ b/sys/netinet/in_prot.c @@ -67,9 +67,7 @@ cr_canseeinpcb(struct ucred *cred, struct inpcb *inp) if (error) return (error); #endif - if (cr_canseeotheruids(cred, inp->inp_cred)) - return (ENOENT); - if (cr_canseeothergids(cred, inp->inp_cred)) + if (cr_bsd_visible(cred, inp->inp_cred)) return (ENOENT); return (0); From nobody Thu Dec 21 13:43:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8G5kGCz54pWx; Thu, 21 Dec 2023 13:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8G2tYmz4NJj; Thu, 21 Dec 2023 13:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eAJy7KqYLDbrFQkOwpJINrr9bN89+A7zVNnZM8gwdgY=; b=NBqefXCTuIKByR05FgeGo9YPZGQFdYrL8fToV492B4oMdlOD9gabqkn8/UTmfbsPgAFcZk WZF/ixai6sah5T5gmJIiEqfLBzJkj/6NdCaOk6sZxHAIgxkjhB1yVQckoUXKxJeTRdShtN 6aR8/0txhM2dw+anybYgCbb0xvDeshxJJWm7tPbGqzqh/XZ6o0ZKGfTXI9PanR4WOuakbH SAxyLujTSg62r2e/ziPNq/LnV3YC7OyIfmktbA4HJRIl3fAmwmLkmZA14AsoccFMl7FZ4I XorEZrCqj1NBk8ez2xl7ym2TlGNpeapB6BB7KyqP5vVT/MMCewLQpg6raIN2Uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166206; a=rsa-sha256; cv=none; b=TL+irgsDvH1z7ADfmY9QJbkvLo9dQFI+o/8lEmx4oRAUhFI7hXmaNFQNgT6se4V6zeq1of lFk0vm6P03iGC2gi9O98LpFxu7a9GX6nox0CP3huVZ/cYby2dzewJePOv+25cIj5MEalzV mI8cTVP7CBSFdvNRsHui3gwXvhZUMOs9ZsOII/VrXr0scmzEAum914u+WLEB8OLNVvErtK sysUEg5x5kqMvaO5IjPkNZDVm/kziICoUs9tjkFFHt+iifQ82TUJkROFy3uZQsUixCp/79 lkUP2mXLQQxwtcVo/HNXnOiyPj+D8P3mZRHqtPh47RioFJ1GZuhK8PBtK0Zi3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eAJy7KqYLDbrFQkOwpJINrr9bN89+A7zVNnZM8gwdgY=; b=JDy79P3wMptiR1i57JNtmRmI4SHdRmEg9vX3QRBlUBivPaZ5hF0YVUsz7QMa/IDidkBdR2 glmLC2xqPZQLYeJ046BJLOfVPEqTRy5qz5ilixeZTIz8xlB8qO4/UDvEzC+erKggEPuzha auNkxJJU4nLzbDk+yOGKSfk649ZlzMok7R98OXl5EHAyyBGKYsdWgOcPOAUzdXX9EkDURg vFmxcbrRKUdf9ZcbyJkp8tibFJIXHQhAp9cChKKtQaUnbjqXi6DeHl4TV2Gyp/zCiT0jH8 v4imxb9VkXsfNnvlG9J2+RSaA127q3ioLZdjBP+hpaov639q7fPxG0L1y5XIgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8G20PrzZtw; Thu, 21 Dec 2023 13:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhQIf078738; Thu, 21 Dec 2023 13:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhQT0078735; Thu, 21 Dec 2023 13:43:26 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:26 GMT Message-Id: <202312211343.3BLDhQT0078735@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: 29f208b78f53 - stable/13 - cr_canseeotheruids(), cr_canseeothergids(): Man pages: Impacts of rename List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 29f208b78f5369288dcb4f8ec991543bd3a50b33 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=29f208b78f5369288dcb4f8ec991543bd3a50b33 commit 29f208b78f5369288dcb4f8ec991543bd3a50b33 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:39 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:24 +0000 cr_canseeotheruids(), cr_canseeothergids(): Man pages: Impacts of rename When these functions were renamed 7 years ago, their man pages were not. Rename the latter in accordance and fix the names inside them. Fix references to them as well. Add the old man pages to the list of obsolete files. Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40630 (cherry picked from commit c59ab75c04fa32bc6d292596ff5e4593a05a6b1b) Approved by: markj (mentor) --- ObsoleteFiles.inc | 4 ++++ share/man/man9/Makefile | 4 ++-- share/man/man9/cr_cansee.9 | 8 ++++---- share/man/man9/{cr_seeothergids.9 => cr_canseeothergids.9} | 8 ++++---- share/man/man9/{cr_seeotheruids.9 => cr_canseeotheruids.9} | 8 ++++---- share/man/man9/p_candebug.9 | 8 ++++---- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index fd4e1d98e631..ce8ac946b2a7 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20230927: Man pages renamed to match the actual functions +OLD_FILES+=usr/share/man/man9/cr_seeothergids.9.gz +OLD_FILES+=usr/share/man/man9/cr_seeotheruids.9.gz + # 20230911: caroot bundle updated OLD_FILES+=usr/share/certs/trusted/E-Tugra_Certification_Authority.pem OLD_FILES+=usr/share/certs/trusted/E-Tugra_Global_Root_CA_ECC_v3.pem diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index f1c7c2622e86..5ce5a46c3a78 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -67,9 +67,9 @@ MAN= accept_filter.9 \ counter.9 \ cpuset.9 \ cr_cansee.9 \ + cr_canseeothergids.9 \ + cr_canseeotheruids.9 \ critical_enter.9 \ - cr_seeothergids.9 \ - cr_seeotheruids.9 \ crypto.9 \ crypto_asym.9 \ crypto_buffer.9 \ diff --git a/share/man/man9/cr_cansee.9 b/share/man/man9/cr_cansee.9 index 8e058eb4e3e5..4824a231170b 100644 --- a/share/man/man9/cr_cansee.9 +++ b/share/man/man9/cr_cansee.9 @@ -50,9 +50,9 @@ variables and .Va security.bsd.see_other_uids , as per the description in -.Xr cr_seeothergids 9 +.Xr cr_canseeothergids 9 and -.Xr cr_seeotheruids 9 +.Xr cr_canseeotheruids 9 respectively. .Sh RETURN VALUES This function returns zero if the object with credential @@ -84,7 +84,7 @@ does not belong to the same jail as The MAC subsystem denied visibility. .El .Sh SEE ALSO -.Xr cr_seeothergids 9 , -.Xr cr_seeotheruids 9 , +.Xr cr_canseeothergids 9 , +.Xr cr_canseeotheruids 9 , .Xr mac 9 , .Xr p_cansee 9 diff --git a/share/man/man9/cr_seeothergids.9 b/share/man/man9/cr_canseeothergids.9 similarity index 94% rename from share/man/man9/cr_seeothergids.9 rename to share/man/man9/cr_canseeothergids.9 index bd8eb5d2e9d9..79269533ae5c 100644 --- a/share/man/man9/cr_seeothergids.9 +++ b/share/man/man9/cr_canseeothergids.9 @@ -26,14 +26,14 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd November 11, 2003 -.Dt CR_SEEOTHERGIDS 9 +.Dt CR_CANSEEOTHERGIDS 9 .Os .Sh NAME -.Nm cr_seeothergids +.Nm cr_canseeothergids .Nd determine visibility of objects given their group memberships .Sh SYNOPSIS .Ft int -.Fn cr_seeothergids "struct ucred *u1" "struct ucred *u2" +.Fn cr_canseeothergids "struct ucred *u1" "struct ucred *u2" .Sh DESCRIPTION This function determines the visibility of objects in the kernel based on the group IDs in the credentials @@ -76,5 +76,5 @@ or .Er ESRCH otherwise. .Sh SEE ALSO -.Xr cr_seeotheruids 9 , +.Xr cr_canseeotheruids 9 , .Xr p_candebug 9 diff --git a/share/man/man9/cr_seeotheruids.9 b/share/man/man9/cr_canseeotheruids.9 similarity index 94% rename from share/man/man9/cr_seeotheruids.9 rename to share/man/man9/cr_canseeotheruids.9 index 2cefd0f9dc8e..80acc2d7a6ca 100644 --- a/share/man/man9/cr_seeotheruids.9 +++ b/share/man/man9/cr_canseeotheruids.9 @@ -26,14 +26,14 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd November 11, 2003 -.Dt CR_SEEOTHERUIDS 9 +.Dt CR_CANSEEOTHERUIDS 9 .Os .Sh NAME -.Nm cr_seeotheruids +.Nm cr_canseeotheruids .Nd determine visibility of objects given their user credentials .Sh SYNOPSIS .Ft int -.Fn cr_seeotheruids "struct ucred *u1" "struct ucred *u2" +.Fn cr_canseeotheruids "struct ucred *u1" "struct ucred *u2" .Sh DESCRIPTION This function determines the visibility of objects in the kernel based on the real user IDs in the credentials @@ -76,5 +76,5 @@ or .Er ESRCH otherwise. .Sh SEE ALSO -.Xr cr_seeothergids 9 , +.Xr cr_canseeothergids 9 , .Xr p_candebug 9 diff --git a/share/man/man9/p_candebug.9 b/share/man/man9/p_candebug.9 index ffa4fedb6172..e80d313de55c 100644 --- a/share/man/man9/p_candebug.9 +++ b/share/man/man9/p_candebug.9 @@ -113,9 +113,9 @@ Process is not visible to thread .Fa td as determined by -.Xr cr_seeotheruids 9 +.Xr cr_canseeotheruids 9 or -.Xr cr_seeothergids 9 . +.Xr cr_canseeothergids 9 . .It Bq Er ESRCH Thread .Fa td @@ -129,8 +129,8 @@ The MAC subsystem denied debuggability. .Sh SEE ALSO .Xr jail 2 , .Xr sysctl 8 , -.Xr cr_seeothergids 9 , -.Xr cr_seeotheruids 9 , +.Xr cr_canseeothergids 9 , +.Xr cr_canseeotheruids 9 , .Xr mac 9 , .Xr p_cansee 9 , .Xr prison_check 9 From nobody Thu Dec 21 13:43:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8J0GRxz54pX5; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8H3q47z4N9w; Thu, 21 Dec 2023 13:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDaVEwzYQHuvyUh8164h8ZwKYDYwLNqmasI0xhb0SWM=; b=PjXvX/NqwpUMcihTM6tnUHaDzGQM/NhKvjuDTzjA9QC53v5+7wGKc+M1/E17ShD3SZhrva szEQCAlJrkFHAHN6R33OHD7qedagjlxYciGWM+c5zPRWpkqRHnoGr38TfRgl4l/Ll4eMOb dLdm6uvzb+kENmepF2Ip7ksIKkhEogvZ4/Y3unZ3xIGAbmIxPjRfNXQHy2IoOdu/90Sls7 UJBzLsGODVDFoIxJEkoCUNH/Czpi9qQOJguiGmw5w2zzfLcQ6KON3rW2x+JsgOlaTxavwS KcM1jmsjhkqw404wZVxYMyfVTPYAXN7KidnVSLxzN3HK3DNmQeabzO7IxBhK4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166207; a=rsa-sha256; cv=none; b=dss/2L44Rm7d0oKCDeSH0gfMLf8Xgza0E+Pjjr00taZR0Xy5zCdwSGfPdN2mWPZNvqxjHX pDKQRNb/YgwqP7yS7rgUVu9Rm4qo+XwdV9RfljZcWIgUD6cbj33lJ/wQ4wHxU/2iRDcq66 oVz6jSdg5zxZ/ePJC48HtCiTrkQilv/IC+WLh9u2eYmxsjH24u4JBninrczb9SycHEZJcU cVRLyJX72ckPW8VQXOHkB7yfSAsuxPzHxavGVZEQ5s/r9f1JV1GUaEsYnNSGpjZKL0kn1D btdFrzNpKyTqqbrNbdYYKr3r64oRxuRMh4jw6QcCIFR2idMw9SirZ+Sa7yzihA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDaVEwzYQHuvyUh8164h8ZwKYDYwLNqmasI0xhb0SWM=; b=pbg48TEFRSmAPGKL85J4k/gzp8CgomJZid/Pb/iyDQD/0N3CAO5m1Y24qFb/USvieTzNel B44PZa1edhxCt94DeKt4u6rdBDiV2Kod23CVZGyQWiZnbuVUUaw8e3H4tmTpBigh1yneGs tReApMGJZfvsINSdzNYT5x+awNJ9jDzTZLKo2AW0at93YWdM53D1js1a3dGShYeBgJbCCo fSgGYfTykVaNIoxrhuQZNUY2OX36qMlOYTnvF4rNgjt0L2RuXhlJNeSfw0o9dum8rzKB9B aBYi1qjyMJ5v/fl7M8Rp4sujwoIMkcx3iZC0pDZxXq7fsAof+tjDSvGqHSSQiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8H2kSBzZmJ; Thu, 21 Dec 2023 13:43:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhRY9078777; Thu, 21 Dec 2023 13:43:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhRDB078774; Thu, 21 Dec 2023 13:43:27 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:27 GMT Message-Id: <202312211343.3BLDhRDB078774@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: 1e5500c6eba4 - stable/13 - cr_canseejailproc(9): New man 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 1e5500c6eba44f2f7eb6f516edcb518f13c5c42d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1e5500c6eba44f2f7eb6f516edcb518f13c5c42d commit 1e5500c6eba44f2f7eb6f516edcb518f13c5c42d Author: Olivier Certner AuthorDate: 2023-08-17 23:54:40 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:32 +0000 cr_canseejailproc(9): New man page Reviewed by: pauamma_gundo.com, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40631 (cherry picked from commit 29d863bb7ffc692998f21fa3e7a91afa1151cf1c) Approved by: markj (mentor) --- share/man/man9/Makefile | 1 + share/man/man9/cr_canseejailproc.9 | 81 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 5ce5a46c3a78..9d516b1f126a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -67,6 +67,7 @@ MAN= accept_filter.9 \ counter.9 \ cpuset.9 \ cr_cansee.9 \ + cr_canseejailproc.9 \ cr_canseeothergids.9 \ cr_canseeotheruids.9 \ critical_enter.9 \ diff --git a/share/man/man9/cr_canseejailproc.9 b/share/man/man9/cr_canseejailproc.9 new file mode 100644 index 000000000000..775c76722b05 --- /dev/null +++ b/share/man/man9/cr_canseejailproc.9 @@ -0,0 +1,81 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Olivier Certner +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd August 18, 2023 +.Dt CR_CANSEEJAILPROC 9 +.Os +.Sh NAME +.Nm cr_canseejailproc +.Nd determine if subjects may see entities in sub-jails +.Sh SYNOPSIS +.Ft int +.Fn cr_canseejailproc "struct ucred *u1" "struct ucred *u2" +.Sh DESCRIPTION +.Bf -emphasis +This function is internal. +Its functionality is integrated into the function +.Xr cr_bsd_visible 9 , +which should be called instead. +.Ef +.Pp +This function checks if a subject associated to credentials +.Fa u1 +is denied seeing a subject or object associated to credentials +.Fa u2 +by a policy that requires both credentials to be associated to the same jail. +This is a restriction to the baseline jail policy that a subject can see +subjects or objects in its own jail or any sub-jail of it. +.Pp +This policy is active if and only if the +.Xr sysctl 8 +variable +.Va security.bsd.see_jail_proc +is set to zero. +.Pp +As usual, the superuser (effective user ID 0) is exempt from this policy +provided that the +.Xr sysctl 8 +variable +.Va security.bsd.suser_enabled +is non-zero and no active MAC policy explicitly denies the exemption +.Po +see +.Xr priv_check_cred 9 +.Pc . +.Sh RETURN VALUES +The +.Fn cr_canseejailproc +function returns 0 if the policy is disabled, both credentials are associated to +the same jail, or if +.Fa u1 +has privilege exempting it from the policy. +Otherwise, it returns +.Er ESRCH . +.Sh SEE ALSO +.Xr cr_bsd_visible 9 , +.Xr priv_check_cred 9 +.Sh AUTHORS +This manual page was written by +.An Olivier Certner Aq Mt olce.freebsd@certner.fr . From nobody Thu Dec 21 13:43:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8K2bxnz54pNs; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8J54X0z4NKK; Thu, 21 Dec 2023 13:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iahmYMFqd32tokgQwfOeMMOI3ppSh+Y2VRyR+HCOLh8=; b=oiZCMTqfIHNIBcfMTzNaFKPTHk2K1p8+HEp21I0LP4mlDuOjV1dlJJKQMOaX1iemE5HlUQ /n3LnwOREvHnyvF/R5u8ibZMMLTY2ihbFSOzlkv0vkNrtttCib8XunrNVWryUOiVNwJxkd xG+jDNHxKCH2x1GgweORg2GpATA4DaP41NYd9PNcShNBEV9Co110wvMmmdhFFxDsy906N7 ZxtkspqjYIit8UGP7gVMr9roLKAbmpsaIXteAjYOxd5sJpopHidgQxYH/2wnbj5b4dV8zY gF3IUh7seT1FvpM4KOafYaVW9DBTGgWBDM+4DZvnn21ezUaF3+3Dl+gZmQUwNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166208; a=rsa-sha256; cv=none; b=SRbt4GhDzDTZ9yMzi/BoV/SD+BAGYPvoSP9Ywsq0hAmmQqi5LRqNIPUFtRhpbMK3FTNynX YMOEkpT4S2Iidm1rkVwafNQybudMQ/bjHRCIZomW4Gg3tM6jD7TBpOzpLCmrywnw7u8cH0 95A0JVwN7loedpF31RwO92yYGiYEimwTNwSUnBcof3ItuhgsIK0mVgerQHyZeT6aRYstk5 9tapt1iRnyVd2vcfIZtVuNZinlBX6Ubf5TPWnfpKgvnaOmU+9hHyh5mb1330ZjopXx96oZ ib4MJxFpJGO1F0gF0WusT6u4KLhhhI/89VjZvrcaP+gZJlojf1+eJaPstGmhhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iahmYMFqd32tokgQwfOeMMOI3ppSh+Y2VRyR+HCOLh8=; b=KrZF760jgR8T3QSr2GnswCbJ3JPW5XP2d4W9q0096BQLwp8nBl5aCOtW1D+oTsdHwACPmF 4JyoMm1PIJoiD0WGnCuI67fioIBB3DbP+DKS+dka61H3isjKN3qjQd0Ubr4hkKRy0qyLyC Gs8iokVFXt8dxxcfTCPhXK+jd6nRSnKDhTZOZnSDsy9bN6DrHcBUA+0RZAThvc6aiu6pmo O/qhRRTPD95PthQ9Iroz4sqhyrsA3WSuyGCLh6UQF944vjwwD/1CClv46v0k0qIJZndCAQ h8k4YdQJCihOD/amgJa/GZcpjV56Y4tALYAIYlwfvoocjgZgElCTMEvl2cCShg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8J432qzb5q; Thu, 21 Dec 2023 13:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhSLV078816; Thu, 21 Dec 2023 13:43:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhS3x078813; Thu, 21 Dec 2023 13:43:28 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:28 GMT Message-Id: <202312211343.3BLDhS3x078813@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: c5e0a6bc59b9 - stable/13 - cr_bsd_visible(9): New man 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c5e0a6bc59b96cb9ed98c452a0be4f012c468d26 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c5e0a6bc59b96cb9ed98c452a0be4f012c468d26 commit c5e0a6bc59b96cb9ed98c452a0be4f012c468d26 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:40 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:41 +0000 cr_bsd_visible(9): New man page Reviewed by: bcr, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40632 (cherry picked from commit 0d6bf73c4f20e6ed719c29c1b382d24bb0a81a2f) Approved by: markj (mentor) --- share/man/man9/Makefile | 1 + share/man/man9/cr_bsd_visible.9 | 117 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9d516b1f126a..18642ff86010 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -66,6 +66,7 @@ MAN= accept_filter.9 \ copy.9 \ counter.9 \ cpuset.9 \ + cr_bsd_visible.9 \ cr_cansee.9 \ cr_canseejailproc.9 \ cr_canseeothergids.9 \ diff --git a/share/man/man9/cr_bsd_visible.9 b/share/man/man9/cr_bsd_visible.9 new file mode 100644 index 000000000000..bd676e6f5705 --- /dev/null +++ b/share/man/man9/cr_bsd_visible.9 @@ -0,0 +1,117 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2023 Olivier Certner +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd August 18, 2023 +.Dt CR_BSD_VISIBLE 9 +.Os +.Sh NAME +.Nm cr_bsd_visible +.Nd determine if subjects may see entities according to BSD security policies +.Sh SYNOPSIS +.In sys/proc.h +.Ft int +.Fn cr_bsd_visible "struct ucred *u1" "struct ucred *u2" +.Sh DESCRIPTION +This function determines if a subject with credentials +.Fa u1 +is denied seeing an object or subject associated to credentials +.Fa u2 +by the following policies and associated +.Xr sysctl 8 +knobs: +.Bl -tag -width indent +.It Va security.bsd.seeotheruids +If set to 0, subjects cannot see other subjects or objects if they are not +associated with the same real user ID. +The corresponding internal function is +.Xr cr_canseeotheruids 9 . +.It Va security.bsd.seeothergids +If set to 0, subjects cannot see other subjects or objects if they are not both +a member of at least one common group. +The corresponding internal function is +.Xr cr_canseeothergids 9 . +.It Va security.bsd.see_jail_proc +If set to 0, subjects cannot see other subjects or objects that are not +associated with the same jail as they are. +The corresponding internal function is +.Xr cr_canseejailproc 9 . +.El +.Pp +As usual, the superuser (effective user ID 0) is exempt from any of these +policies provided that the +.Xr sysctl 8 +variable +.Va security.bsd.suser_enabled +is non-zero and no active MAC policy explicitly denies the exemption +.Po +see +.Xr priv_check_cred 9 +.Pc . +.Pp +This function is intended to be used as a helper to implement +.Xr cr_cansee 9 +and similar functions. +.Sh RETURN VALUES +This function returns zero if a subject with credentials +.Fa u1 +may see a subject or object with credentials +.Fa u2 +by the active above-mentioned policies, or +.Er ESRCH +otherwise. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er ESRCH +Credentials +.Fa u1 +and +.Fa u2 +do not have the same real user ID. +.It Bq Er ESRCH +Credentials +.Fa u1 +and +.Fa u2 +are not members of any common group +.Po +as determined by +.Xr groupmember 9 +.Pc . +.It Bq Er ESRCH +Credentials +.Fa u1 +and +.Fa u2 +are not in the same jail. +.El +.Sh SEE ALSO +.Xr cr_canseeotheruids 9 , +.Xr cr_canseeothergids 9 , +.Xr cr_canseejailproc 9 , +.Xr priv_check_cred 9 , +.Xr cr_cansee 9 +.Sh AUTHORS +This function and its manual page were written by +.An Olivier Certner Aq Mt olce.freebsd@certner.fr . From nobody Thu Dec 21 13:43:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8L2x23z54pqy; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8K5mz2z4NMD; Thu, 21 Dec 2023 13:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DDbAx63JVc2346EtTaC3uAGsLi8aA1FcquvQrRQIiQ=; b=hJB6HC7vtF6arNuJdqyl/8mkOG1pj1DJy1TluMZSTgQft1f/D9inN90kkY6dPhNvMd+VM8 de1iLbrjpgF/aLHQ37+wMNfgW8SlKGCvzntqaGxoYTqtiuJEDqXXDBsWw+sjgIQxzaf6IE mxGH0h4YQQFeztUIqNBID660dg8B9LMLSl3I7e8rGf+dRBZt7KZfBCSxOHRATuANUvMhZ+ IztiOKzHyQuvXQkCadoHX0XFAAjgOjr/KNYXDI5YSOHqDSpLrtJiLa86bapK+HVOay3hLD eFF+WbqKd2EZNPRw13/Dj5Z2R+9O5c9qDsJc1WSs0a4ARgnEI66fAgRhzymrWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166209; a=rsa-sha256; cv=none; b=gEx+mV9pJPVTKJLC0kLJrQzvHyOX6Q1SB1TmJqoq6kzBYHV9gnshBeTyR/GvOULevZejQI RNiHX15lDVFGjHSIVJbS4lUUGCEosN2eyCkpPOa0rQpwZWNxuOLKy49W8tmfU3h3Pp9QJK vgehDA2E0sPdpvFQiJ09DH1m8TnGZ9O+5bnPwh2yBFTNL/hSt3WP1HN18ETF5lBmMevCZV uuPUZhMhvsNsE73dAF7DdoZhXd+GEcYpMGZYTrR4OJf8U0j1ZPRvhkKNn+LPfdgkZDOgpE YAbXtJOkbeIYnhhOKbTdbPiVdnREpE32YbQl88YIk38uiqFj3f6Lbb+89WwBbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DDbAx63JVc2346EtTaC3uAGsLi8aA1FcquvQrRQIiQ=; b=MsHXuHAlKrjVwyt5Ztv7Iro3TKAzkATrPj2Ij+qWEFlZxC7CWRHeT3l6DZdlZ4KhASMgFj x01gbWgwxyrfUizaolZ+3tV2jWP8B2ANzQiWXXe5nhePMfJCVzVQf96Yosoly9VuelNFyq t4ZQ3/S4ft8nzJulx7YH1R30XKGr3q1BMtQ7OhoqB0EcFypkUb1OsMZR0/URvc6My7NK3S /F1ep/7Bn4/hj2+gpER+v/pu4YulGXR4k3DNQpfwTfGbbvJZMgtVvvlBDBvZgNc/gS1J28 d3QY7p3pD8pgbqOA0rUxDI2tQrwi2qCtZdSvmzROzzAeSLp8NRzejZOsvovh1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8K4ZRTzb5r; Thu, 21 Dec 2023 13:43:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhTkU078858; Thu, 21 Dec 2023 13:43:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhTnF078855; Thu, 21 Dec 2023 13:43:29 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:29 GMT Message-Id: <202312211343.3BLDhTnF078855@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: 29a2d242bd1e - stable/13 - cr_canseeothergids(9): Revamp, mark as internal List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 29a2d242bd1ee34443806b4478a94a915499c7de Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=29a2d242bd1ee34443806b4478a94a915499c7de commit 29a2d242bd1ee34443806b4478a94a915499c7de Author: Olivier Certner AuthorDate: 2023-08-17 23:54:41 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:48 +0000 cr_canseeothergids(9): Revamp, mark as internal Significantly clarify. Replace references to cr_canseeotheruids(9) by ones to cr_bsd_visible(9). Reviewed by: pauamma_gundo.com, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40633 (cherry picked from commit 3fe9ea4d2d04d48a249b2e6161d416bb4d5b364e) Approved by: markj (mentor) --- share/man/man9/cr_canseeothergids.9 | 77 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/share/man/man9/cr_canseeothergids.9 b/share/man/man9/cr_canseeothergids.9 index 79269533ae5c..f0c1e5c4e726 100644 --- a/share/man/man9/cr_canseeothergids.9 +++ b/share/man/man9/cr_canseeothergids.9 @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2003 Joseph Koshy +.\" Copyright (c) 2023 Olivier Certner .\" .\" All rights reserved. .\" @@ -25,56 +26,58 @@ .\" (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 11, 2003 +.Dd August 18, 2023 .Dt CR_CANSEEOTHERGIDS 9 .Os .Sh NAME .Nm cr_canseeothergids -.Nd determine visibility of objects given their group memberships +.Nd determine if subjects may see entities in a disjoint group set .Sh SYNOPSIS .Ft int .Fn cr_canseeothergids "struct ucred *u1" "struct ucred *u2" .Sh DESCRIPTION -This function determines the visibility of objects in the -kernel based on the group IDs in the credentials +.Bf -emphasis +This function is internal. +Its functionality is integrated into the function +.Xr cr_bsd_visible 9 , +which should be called instead. +.Ef +.Pp +This function checks if a subject associated to credentials .Fa u1 -and +is denied seeing a subject or object associated to credentials .Fa u2 -associated with them. +by a policy that requires both credentials to have at least one group in common. +For this determination, the effective and supplementary group IDs are used, but +not the real group IDs, as per +.Xr groupmember 9 . .Pp -The visibility of objects is influenced by the +This policy is active if and only if the .Xr sysctl 8 variable -.Va security.bsd.see_other_gids . -If this variable is non-zero then all objects in the kernel -are visible to each other irrespective of their group membership. -If this variable is zero then the object with credentials -.Fa u2 -is visible to the object with credentials -.Fa u1 -if either -.Fa u1 -is the super-user credential, or if at least one of -.Fa u1 Ns 's -group IDs is present in -.Fa u2 Ns 's -group set. -.Sh SYSCTL VARIABLES -.Bl -tag -width indent -.It Va security.bsd.see_other_gids -Must be non-zero if objects with unprivileged credentials are to be -able to see each other. -.El +.Va security.bsd.see_other_gids +is set to zero. +.Pp +As usual, the superuser (effective user ID 0) is exempt from this policy +provided that the +.Xr sysctl 8 +variable +.Va security.bsd.suser_enabled +is non-zero and no active MAC policy explicitly denies the exemption +.Po +see +.Xr priv_check_cred 9 +.Pc . .Sh RETURN VALUES -This function returns zero if the object with credential +The +.Fn cr_canseeothergids +function returns 0 if the policy is disabled, the credentials share at least one +common group, or if .Fa u1 -can -.Dq see -the object with credential -.Fa u2 , -or -.Er ESRCH -otherwise. +has privilege exempting it from the policy. +Otherwise, it returns +.Er ESRCH . .Sh SEE ALSO -.Xr cr_canseeotheruids 9 , -.Xr p_candebug 9 +.Xr cr_bsd_visible 9 , +.Xr groupmember 9 , +.Xr priv_check_cred 9 From nobody Thu Dec 21 13:43:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8N2tCzz54prM; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8N0b72z4NDh; Thu, 21 Dec 2023 13: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=1703166212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fRccNxX7acYoZ4A1dpSRUj2EJZ1L/ZIodflb1PqCjWY=; b=alLw8MFWwRJfWNipo/25bnjICPzODaEp/w3Q0uiZNp/Y6UEcVtEmQPa0r6JF3Tdq41G73z 2IfPzDIjbfQwAubdBpIUH9ls6RrqjMXtGCYFhMs+WD4PPiYRGizRIH0tekQrm578k60yoQ otznqu0IbPTTibNTFLliymmLW+z9MzsRiXOO9k4RDvBJwCdRGgN1NXmP3LVmYTUlJkLg+O i4iy3pMk9IYlFIZWY+Go+Qkz/hMO4vlThixet/LaWxi0gKgu9y9n6sqPMoSDEUI7AoAIUE TGFNOnFb7CA2/CkxOhvvdEY6Zp5JbKyFF8/06DZw1XOtxYVroC2ScVN4amZoQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166212; a=rsa-sha256; cv=none; b=aZ7LYnx+VWjHY9zJeoMF9xCb9AO+kp2ZJ821pGYrQ7VHNad97ifNkQojHrIeIdaLUIABS4 xCWbKEkFhY47KLwpq0NbNqx9PdSfrT9JbCDVm79SE2/cs4GNbTHTfu2lFyCMkN62Q5Eh2/ TS3fKCZPKX1M1NRyI/bLxpdBSVlwA2UPl/5rFUF4/P4VPcr2tKwYFRZcRlE18kPASsrAjf 4iXHa18H2Psrt6apw7cyIQYxmmIUbbh+EbV7mpJQSaIbSm36b2NWCCZd8UB0x+dFJ+k751 QMBsVvxLbw6gRshHNq9WC/HNBNfgHsCg3K+6OvyvWrnTlR3Lx/QMXGg9g568yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fRccNxX7acYoZ4A1dpSRUj2EJZ1L/ZIodflb1PqCjWY=; b=XxSLdbU8iSl8UbBPkA68P+UTYHOWQzJLQsZrOzGRrpJFB1xVR8LmaGGUfXiTam4aBGjhRf zCVrK09Cn3w2Bx3al0x6QVB5rjUQm3QAkDvE9Gnl9ms2Z8sChUwxsLQu1Mp0WC83a+WoxZ J8EpDajRu+LsquJ2+CE+iUACIkSdd4vT+l9fTG9XyxI9YEtgzXacdyskBSK1azj0JDRO07 d2X74olNO+BzV7PWBxwVi5jciGDUsWfM1KIDg1wONmp9KGifxjV9T0m4cw+xpTqn/ngRJH TnPk5nlwr+F7OCLXXO5kr8K8I39G6PCtYPgDrN9fN7k4HJM7B3/ILNWogQpnUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8M6pcLzZtx; Thu, 21 Dec 2023 13:43:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhVOm078954; Thu, 21 Dec 2023 13:43:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhVnD078951; Thu, 21 Dec 2023 13:43:31 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:31 GMT Message-Id: <202312211343.3BLDhVnD078951@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: 32a9108cdcc6 - stable/13 - cr_canseeotheruids(9): Revamp, mark as internal List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 32a9108cdcc671547d087cf6eecbcdb37064b8ab Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=32a9108cdcc671547d087cf6eecbcdb37064b8ab commit 32a9108cdcc671547d087cf6eecbcdb37064b8ab Author: Olivier Certner AuthorDate: 2023-08-17 23:54:42 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:01 +0000 cr_canseeotheruids(9): Revamp, mark as internal Significantly clarify. Replace references to cr_canseeothergids(9) by ones to cr_bsd_visible(9). Reviewed by: bcr, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40635 (cherry picked from commit 4ddd253b38dff8725555355cc1b5238b1bbfd380) Approved by: markj (mentor) --- share/man/man9/cr_canseeotheruids.9 | 73 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/share/man/man9/cr_canseeotheruids.9 b/share/man/man9/cr_canseeotheruids.9 index 80acc2d7a6ca..230c5ea59b78 100644 --- a/share/man/man9/cr_canseeotheruids.9 +++ b/share/man/man9/cr_canseeotheruids.9 @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2003 Joseph Koshy +.\" Copyright (c) 2023 Olivier Certner .\" .\" All rights reserved. .\" @@ -25,56 +26,54 @@ .\" (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 11, 2003 +.Dd August 18, 2023 .Dt CR_CANSEEOTHERUIDS 9 .Os .Sh NAME .Nm cr_canseeotheruids -.Nd determine visibility of objects given their user credentials +.Nd determine if subjects may see entities with differing user ID .Sh SYNOPSIS .Ft int .Fn cr_canseeotheruids "struct ucred *u1" "struct ucred *u2" .Sh DESCRIPTION -This function determines the visibility of objects in the -kernel based on the real user IDs in the credentials +.Bf -emphasis +This function is internal. +Its functionality is integrated into the function +.Xr cr_bsd_visible 9 , +which should be called instead. +.Ef +.Pp +This function checks if a subject associated to credentials .Fa u1 -and +is denied seeing a subject or object associated to credentials .Fa u2 -associated with them. +by a policy that requires both credentials to have the same real user ID. .Pp -The visibility of objects is influenced by the +This policy is active if and only if the .Xr sysctl 8 variable -.Va security.bsd.see_other_uids . -If this variable is non-zero then all objects in the kernel -are visible to each other irrespective of their user IDs. -If this variable is zero then the object with credentials -.Fa u2 -is visible to the object with credentials -.Fa u1 -if either -.Fa u1 -is the super-user credential, or if -.Fa u1 -and -.Fa u2 -have the same real user ID. -.Sh SYSCTL VARIABLES -.Bl -tag -width indent -.It Va security.bsd.see_other_uids -Must be non-zero if objects with unprivileged credentials are to be -able to see each other. -.El +.Va security.bsd.see_other_uids +is set to zero. +.Pp +As usual, the superuser (effective user ID 0) is exempt from this policy +provided that the +.Xr sysctl 8 +variable +.Va security.bsd.suser_enabled +is non-zero and no active MAC policy explicitly denies the exemption +.Po +see +.Xr priv_check_cred 9 +.Pc . .Sh RETURN VALUES -This function returns zero if the object with credential +The +.Fn cr_canseeotheruids +function returns 0 if the policy is disabled, both credentials have the same +real user ID, or if .Fa u1 -can -.Dq see -the object with credential -.Fa u2 , -or -.Er ESRCH -otherwise. +has privilege exempting it from the policy. +Otherwise, it returns +.Er ESRCH . .Sh SEE ALSO -.Xr cr_canseeothergids 9 , -.Xr p_candebug 9 +.Xr cr_bsd_visible 9 , +.Xr priv_check_cred 9 From nobody Thu Dec 21 13:43:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8M2SVpz54pfd; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8L6gdpz4NS8; Thu, 21 Dec 2023 13: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=1703166210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V05bWQWbrPJK5fjY3+OjG3olZOucsP1iAFZDdcsWYYE=; b=SuR2s8HMvx9ypN/NXbB/8VUpXVxawWkNbrad2TMeZ/IcSx+GXS2zoBmuyKk8Ooi/rICf01 XMz1Vf1WzRD+HoKV1OkvGTHit+ONdVw2nWZrnFGZn/Ro7M75vaBd01t4dDE4EJaQYfyUmW 9Vmg0CwcREgFa7cRzya/0svwrLFq+rf3GGDDkevVpvTxZwtYjE+WrQC2wg7ZX5By2/+06b +SztCaonUYd69GdsDmstKd+sNisCY7md2ARpJs89rZO50oRYOpmXsJsi58a4pd2/0RMmhi zK15kc0OH/S9pE6Ie0nvbzIdWSH5OIM8cvtOX5KmVJ2v+Xj4bRw2PMIn7Ww3Iw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166210; a=rsa-sha256; cv=none; b=SC+s1lWk9PGiQHLag6heLhatTEMUNa6gZ9O2Qiggjbjnosp2UbcJkOBZY7IQ47TJmiyHah GXms7faASmLR3fOABneGy6TkAUEh0lFSALhGZbVABdaG3pVjKpOrUrcfvXVA8PAVRrWcHq YNasRcp+6KVQRbnCa+V8yTa9ebUknh7ipOec5AQHXGas7mVWtpvqv/2OPnyMw0QmVZJ5xb JrJL15+Spp3T8H24KiFyW0koRDEboeG3b3VpH8+svjkgi0mEZ4D7hfVZZzZ+/BmU6MTfFM 8x71YcyMd//n3RM/HIqQPCgPzXHD8ZPA27LiWfZxT1m0XjQehKzW/KR/cpnwwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V05bWQWbrPJK5fjY3+OjG3olZOucsP1iAFZDdcsWYYE=; b=ZX75eGtppK1aJkms6eDTyk6UMHAqWJf0kyRqGOzC/huCX1yOCKObl9Fx/0ez3rYMM09wSe OuH9Xpfj7EXehB6GrGh+U5gjNaKJBiH3M0JunV8thUumOD0qkEQloL8l+/PFngfHc3QlNJ g/o6hEo+anBNOJaFUxODTLlS4K4glMy1PNzkN6qJE4xt7U3ck5z0nSum0KEZemoy4+myB3 q7U9IMzTObDLwzznxBIH8tBPQcerCkRntX43s+fuN7Ri2STgXrayxxIVeTyl/4fGhe44Z7 hSMLlviagE+a+aYCbbt8OVtl2IypBo+fSPJc3z193ZKVdxES0zhJFFWpwon9QA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8L5lMrzb4F; Thu, 21 Dec 2023 13:43:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhU1a078906; Thu, 21 Dec 2023 13:43:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhUv6078903; Thu, 21 Dec 2023 13:43:30 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:30 GMT Message-Id: <202312211343.3BLDhUv6078903@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: d23893ca4dd0 - stable/13 - groupmember(9): Detail which groups are considered, simplify List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d23893ca4dd00425814e23c87382ac20d8b0542a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d23893ca4dd00425814e23c87382ac20d8b0542a commit d23893ca4dd00425814e23c87382ac20d8b0542a Author: Olivier Certner AuthorDate: 2023-08-17 23:54:41 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:36:55 +0000 groupmember(9): Detail which groups are considered, simplify Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40634 (cherry picked from commit 75a45ca3b34062fe793ae326ad9da614a1a06df1) Approved by: markj (mentor) --- share/man/man9/groupmember.9 | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/share/man/man9/groupmember.9 b/share/man/man9/groupmember.9 index d447bf64c482..3a516622efce 100644 --- a/share/man/man9/groupmember.9 +++ b/share/man/man9/groupmember.9 @@ -1,5 +1,6 @@ .\" .\" Copyright (C) 2001 Chad David . All rights reserved. +.\" Copyright (C) 2023 Olivier Certner .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -24,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd July 9, 2001 +.Dd August 18, 2023 .Dt GROUPMEMBER 9 .Os .Sh NAME .Nm groupmember -.Nd checks group set for a group ID +.Nd checks if credentials mandate some group membership .Sh SYNOPSIS .In sys/param.h .In sys/ucred.h @@ -38,21 +39,26 @@ .Sh DESCRIPTION The .Fn groupmember -function checks to see if the given -.Fa gid -is in the group set of the credentials. +function checks if credentials +.Fa cred +indicate that the associated subject or object is a member of the group +designated by the group ID +.Fa gid . .Pp -Its arguments are: -.Bl -tag -width ".Fa cred" -.It Fa gid -The group ID to check for. -.It Fa cred -The credentials to search for the group in. -.El +Considered groups in +.Fa cred +are the effective and supplementary groups. +The real group is not taken into account. .Sh RETURN VALUES If the .Fa gid -is found, 1 is returned; otherwise, 0 is returned. +is found, 1 is returned, otherwise 0. +.Sh SEE ALSO +.Xr getgroups 2 +.Xr setgroups 2 .Sh AUTHORS -This manual page was written by -.An Chad David Aq Mt davidc@acns.ab.ca . +This manual page was initially written by +.An -nosplit +.An Chad David Aq Mt davidc@acns.ab.ca +and was revised by +.An Olivier Certner Aq Mt olce.freebsd@certner.fr . From nobody Thu Dec 21 13:43:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8P3m3bz54pXB; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8P1k9Qz4NVR; Thu, 21 Dec 2023 13: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=1703166213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCnnz/f5QJ7lS98xqgnUATgagHm/bUrO7dseLaM0qE4=; b=lw/nRM4DNAxCrQ9/p1DQ1rrtGt58OP8tCXqAtNFwcwIIL8pUh7QcS2wxb3CaFdddwdfTkm vdc1kzYgcNGF5p49CvvNeJgejv/wlk+ABuiJ+6IyrLkuYwALRyeSUG4AhCBFvWzAuhd+zk itcRO6w8XhSbUMMg55fjA0SjG3EqcpJyBrrEavgaVAlSIvddKeDTG4FqavQ6hARI+yRqbt Wio4Uwu//lNNO+e1RehcA28DT61ATyamGNHFhl8rGKasIDN/JynL9Vy7P5m0aYarKcTzAC G+6ASeXmJF3DmL7nSD9OrRVJv5W4cYVbPDk3LmcKAHKGvwVccB9d66GpqnDynw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166213; a=rsa-sha256; cv=none; b=F2qM50BKFM/VhkvzcN+pQNo47XPbT3rztP2aRCVsM8tXogv2kfJPhBxqXQcRKs9mc16jQA cLvN2SXZXdzrh7O+DbR19H+TXBp558oDwT90HGSkjMBUZEM0Ig1127IYM+RUMzimGxSaIL l6L+/kVDkWEv0pLm3LfEb3APfK2NTn0uDGSJhPLnXMuuac6UHXwQv3O/pITuNpnJlG+2h4 VjUyTHT5G3IV0e4UhPXsds7w3W3CMb7095e/Qa2CfDJHhP9vFw6RqSDqc42P1lNzDpPhts HMcf2BjZL33I9fulPbhB9x5cb5hzYLubB0eVl4PbR+2Yh3OQ9/+avxiIFaHHaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hCnnz/f5QJ7lS98xqgnUATgagHm/bUrO7dseLaM0qE4=; b=OrG7QTsAXySZ2Anwo5rr3b//mN/GzmAnXTz7bYNHdChXiYgyHFFp8XkRzUmGaCJF8V13Zo vUQmLxWZRqHO668iHqXPj3BvWhylwbq0tCbBT/F7e/EK1El5+eqPD5O1Kx312t0bb67/CT GT6k9Qs/wPvdjuFWYvk9NeaCeKWPytgt27z82ViRnKGQbJ925LSWb2i1MTrAszGeDaZbg7 8yh+c4a1N+7DaVdFTeusuEL5t8H6M1autv2yBYmsJJv370CYtJwouGVak3x7jxGOubuqd+ vbEwJ+OcgxOCjwg+XAE8LGWmHuH/zX7luuYGc7K5KwqqiD4YabVakxU57cUMsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8P0pgkzZmK; Thu, 21 Dec 2023 13:43:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhXXl078993; Thu, 21 Dec 2023 13:43:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhXuV078990; Thu, 21 Dec 2023 13:43:33 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:33 GMT Message-Id: <202312211343.3BLDhXuV078990@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: 6eecda225f11 - stable/13 - cr_cansee(9): cr_bsd_visible() impacts, simplifications List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6eecda225f11f1e139976b08c439bbf357f1553a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6eecda225f11f1e139976b08c439bbf357f1553a commit 6eecda225f11f1e139976b08c439bbf357f1553a Author: Olivier Certner AuthorDate: 2023-08-17 23:54:42 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:08 +0000 cr_cansee(9): cr_bsd_visible() impacts, simplifications Remove references to cr_canseeothergids(9) and cr_canseeotheruids(9). Defer to cr_bsd_visible() for controlling sysctl(8) variables. Reviewed by: bcr, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40636 (cherry picked from commit 82f9bc9ea8ed660c61050ad1d92f1a64108c7004) Approved by: markj (mentor) --- share/man/man9/cr_cansee.9 | 61 ++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/share/man/man9/cr_cansee.9 b/share/man/man9/cr_cansee.9 index 4824a231170b..d5cdfdd6f8e5 100644 --- a/share/man/man9/cr_cansee.9 +++ b/share/man/man9/cr_cansee.9 @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2006 Ceri Davies +.\" Copyright (c) 2023 Olivier Certner .\" .\" All rights reserved. .\" @@ -23,43 +24,39 @@ .\" (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, 2006 +.Dd August 18, 2023 .Dt CR_CANSEE 9 .Os .Sh NAME .Nm cr_cansee .Nd "determine visibility of objects given their user credentials" .Sh SYNOPSIS -.In sys/param.h -.In sys/systm.h -.In sys/ucred.h +.In sys/proc.h .Ft int .Fn cr_cansee "struct ucred *u1" "struct ucred *u2" .Sh DESCRIPTION -This function determines the visibility of objects in the -kernel based on the real user IDs and group IDs in the credentials +This function determines if a subject with credential .Fa u1 -and -.Fa u2 -associated with them. +can see a subject or object associated to credential +.Fa u2 . .Pp -The visibility of objects is influenced by the +Specific types of subjects may need to submit to additional or different +restrictions. +As an example, for processes, see +.Xr p_cansee 9 , +which calls this function. +.Pp +The implementation relies on +.Xr cr_bsd_visible 9 +and consequently the .Xr sysctl 8 -variables -.Va security.bsd.see_other_gids -and -.Va security.bsd.see_other_uids , -as per the description in -.Xr cr_canseeothergids 9 -and -.Xr cr_canseeotheruids 9 -respectively. +variables referenced in its manual page influence the result. .Sh RETURN VALUES -This function returns zero if the object with credential +This function returns zero if the subject with credential .Fa u1 can .Dq see -the object with credential +the subject or object with credential .Fa u2 , or .Er ESRCH @@ -67,24 +64,20 @@ otherwise. .Sh ERRORS .Bl -tag -width Er .It Bq Er ESRCH -The object with credential -.Fa u1 -cannot -.Dq see -the object with credential -.Fa u2 . -.It Bq Er ESRCH -The object with credential +The subject with credential .Fa u1 -has been jailed and the object with credential +has been jailed and the subject or object with credential .Fa u2 -does not belong to the same jail as -.Fa u1 . +does not belong to the same jail or one of its sub-jails, as determined by +.Xr prison_check 9 . .It Bq Er ESRCH The MAC subsystem denied visibility. +.It Bq Er ESRCH +.Xr cr_bsd_visible 9 +denied visibility according to the BSD security policies in force. .El .Sh SEE ALSO -.Xr cr_canseeothergids 9 , -.Xr cr_canseeotheruids 9 , +.Xr prison_check 9 , .Xr mac 9 , +.Xr cr_bsd_visible 9 , .Xr p_cansee 9 From nobody Thu Dec 21 13:43:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8Q6jfvz54pc8; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8Q2pNMz4NVs; Thu, 21 Dec 2023 13:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLfQtG7VuwKzHpdm/vE+g+pz4WG7ukIfdvJlodDE7LA=; b=T2BiQns9RaIfgZkW64kBxmpDl+B37CLR3vKP+Q0WbB2XR0sxHT5+TxETWiiS+TMo3w0QxM XlOqmpexklc8CIzb8LcygLC9iqjEB7IO7JrViTvh+eSaGuhEb8UUEf4ACDIqUuZ8akZlWR LEdoiLGehecYDdaxk7B3dl6WpuE65IbETd5Emij4U5ehqt1llfFwzZx6xH2RiM/INWUeNV KA5h42RC7/DKS4DDHp/KV5tRyAISEmDZPnx/sD5upaZ/QVKPZCV+4GXGPkwvBO64IZrMAn xv5Q+9521+mH88kXuhNl9csT7ogMITT0iYMg2+0sWQiIcLYApFCnxeSYoPu2Sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166214; a=rsa-sha256; cv=none; b=CIb/4JEKkAy7cg3+RkqwZdcj5ztin6dRL68fUKwYgHDi7d6d3Q+Psl+ptnI8Nhy/ikaHvd kaQytQ7FHX9ifIcWdbq8o+w+ylMqEDlW1olWdnH1OyblHhX0GYvbSvvmWGhGXHoN3v8Fdr +wTxT6w0VDk1rHKWugoOWZLy02eCaHxBAcbEBI4WJtKNZtopr5mHGBSgnRpLjDr1idz3Ck Dzj9tVI11ALRlJ/O3CAEFU3ZPnU8kpIyHKhN0mP1AFijXEwkfwCtUC6ERiCgjzz7a8rN2P lT5JJMI0pYhtIm9+1qDyRqH8RxFD6ZNPR/mEdmWsQfhdrcwIk/6hjR/hayzbrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLfQtG7VuwKzHpdm/vE+g+pz4WG7ukIfdvJlodDE7LA=; b=aFKFEHcaiKyNndqqe0Tb0bSpu3eJw34JLjDSuto959TAlp74oF8whHkgfsyNMqh1Rm0FPJ +sgJg+58Udh3XkzQZalpuwJ7EtE0uT7L+RJwEdpwlplmAsbNcDktPSQr5op8Sw3ihZYl/o +8ZlLldMe/7HeNE1ase41NF5clZP4XQ2bzcqYwODtwWFqu1JnfITGHdJ5k4WpocJu3V1bJ saff/ma/gyrWUtjEETvkAecyyTASemtXgyrJTgkdoJzTUhYT9ozbJ+htULBW4Pl6hERVoG 5TfNzQWfLoE+3CFFGYOcl4ECT5KqSSP3jo3G2qvG/vv9tNzwat1aiISOK9rGrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8Q1vPszZmL; Thu, 21 Dec 2023 13:43:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhYUe079035; Thu, 21 Dec 2023 13:43:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhYow079032; Thu, 21 Dec 2023 13:43:34 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:34 GMT Message-Id: <202312211343.3BLDhYow079032@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: b330170c75fb - stable/13 - p_cansee(9): Bring up-to-date, misc 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b330170c75fb02273c4536a6e0274e5e8eaad622 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=b330170c75fb02273c4536a6e0274e5e8eaad622 commit b330170c75fb02273c4536a6e0274e5e8eaad622 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:43 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:16 +0000 p_cansee(9): Bring up-to-date, misc fixes Essentially defer to cr_cansee(9), except for the specifics. Be more specific on the return codes. Reviewed by: bcr, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40637 (cherry picked from commit 2ede38aff5d4c91a17ab6d093f2e8cce24b5418b) Approved by: markj (mentor) --- share/man/man9/p_cansee.9 | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/share/man/man9/p_cansee.9 b/share/man/man9/p_cansee.9 index 84287dac951b..9fdce460dfea 100644 --- a/share/man/man9/p_cansee.9 +++ b/share/man/man9/p_cansee.9 @@ -24,19 +24,18 @@ .\" (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, 2006 +.Dd August 18, 2023 .Dt P_CANSEE 9 .Os .Sh NAME .Nm p_cansee .Nd determine visibility of a process .Sh SYNOPSIS -.In sys/param.h .In sys/proc.h .Ft int .Fn p_cansee "struct thread *td" "struct proc *p" .Sh DESCRIPTION -This function can be used to determine if a given process +This function determines if a given process .Fa p is visible to the thread .Fa td , @@ -45,13 +44,14 @@ where the notion of may be read as .Dq "awareness of existence" . .Pp -The function is implemented using -.Xr cr_cansee 9 , -and the dependencies on -.Xr sysctl 8 -variables documented in the -.Xr cr_cansee 9 -manual page apply. +This function explicitly allows a thread to always see its own process, +even with pending credentials changes +.Po +see +.Xr ucred 9 +.Pc . +Otherwise, it simply defers to +.Xr cr_cansee 9 . .Sh RETURN VALUES The .Fn p_cansee @@ -62,30 +62,18 @@ if the process denoted by .Fa p is visible by thread .Fa td , -or a non-zero error return value otherwise. +or ESRCH otherwise. .Sh ERRORS .Bl -tag -width Er .It Bq Er ESRCH -Process -.Fa p -is not visible to thread -.Fa td -as determined by -.Xr cr_cansee 9 . -.It Bq Er ESRCH Thread .Fa td -has been jailed and process +is not part of process .Fa p -does not belong to the same jail as -.Fa td . -.It Bq Er ESRCH -The MAC subsystem denied visibility. +and cannot see it as determined by +.Xr cr_cansee 9 . .El .Sh SEE ALSO -.Xr jail 2 , -.Xr sysctl 8 , +.Xr ucred 9 , .Xr cr_cansee 9 , -.Xr mac 9 , -.Xr p_candebug 9 , -.Xr prison_check 9 +.Xr p_candebug 9 From nobody Thu Dec 21 13:43:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8S04jkz54ptc; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8R3xDJz4NbM; Thu, 21 Dec 2023 13: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=1703166215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=td4v1xyFjPy4eUjuE8hk1NAyhrGwHR81Ia3A3IcUZeU=; b=ilSlSJ7Ut2Azb5ss2jn3Mt6crH7GC/GPR4s0PFPKr9/qStaJd1UtP1Y1274xjRrKAZsEY5 TgHKEiur8pSY9N0F4JDC5QB62IYFjmMfgxUVvu4ILNrCi3N51z4fEZBVzjsot4xG6cd2Wc TBUATzho3aUs0Ke2Ew12FW/snuH+2/9c2jT6gWt0UoBisfq5khzLvMwjXMTkcUqRfLKIYj LdC2oMVqS6nPHQI9OxLJfz0dsgsrezenAQg4EaUNry27sH0+IarK72e/vFc2ar7Cf7OU5p NfaGQ9yeBwMSOrZ/WmHSm3L7elZmuDFnmb3k4VQMMHpVQmqLMbbRYJ+JpJWIFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166215; a=rsa-sha256; cv=none; b=TkpzliSjGAoY8ToEIE/oXGEip0qQEVW4kZPRzMIrYd4Yu81f+bG7+oGvJX0K9opMNW6jlX A8qMdSuN88xJaJ1FMWrfOpppO1WxiA9WWWXPWoYmdbeB9zCsMoH7jYdrEpiCKkf9os0CAe 3uQtNdFcOWpcx/fBhv9R89YntiUepBjY8SXNRf8J3Ql6jYbteB82iTSUN2S8zwfF1+yVZS LrMYhEC+YVWGIkeze4Ju6ETMHBMJ0VdmvwIPekqH2XtmSELFNg6vpwWQ/GyaNxxFRhKg5A dAKPHwecM3rENfPy6OAlEuBQKzMUXT5ML1D8OW0Jlq800af187qD1WX9uww2nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=td4v1xyFjPy4eUjuE8hk1NAyhrGwHR81Ia3A3IcUZeU=; b=SLp6Ok1QFTnSfmLhFbyLx7lDA8gYleN/VpGaKgBSrZDGphC6PmUu4tpWc9RRZBC4giGIJ8 BGgBrBaUK84yBZ3MGx9GtYndX0SlRXegSM4unpKwqTYs6Yfhv5tSKe8MHhazJDM3kIotIG J32xLJ2szHXYGxxj7fMrC61DedJ6zvx+wfTYZrzaLRWXXoFya39/2AUAsvrWEbWQce73xv oELzoV+OyTB+cxq/ghwOF07Jxn0q00CNWlYVTjf1TVXZvISj2QG1JJBWJ5q5Z3CZAyjrYb cHXtXMxqn6VN4HXis23pCS6gEyvNeNBPMLFqwuAFUO52mxna9CYBp1FIEhvwwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8R33LWzb4G; Thu, 21 Dec 2023 13:43:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhZa0079077; Thu, 21 Dec 2023 13:43:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhZ4U079074; Thu, 21 Dec 2023 13:43:35 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:35 GMT Message-Id: <202312211343.3BLDhZ4U079074@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: 6345a69ee271 - stable/13 - p_candebug(9): cr_bsd_visible() impacts, misc 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6345a69ee271e1108a0f051eb5c335d67ca29736 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6345a69ee271e1108a0f051eb5c335d67ca29736 commit 6345a69ee271e1108a0f051eb5c335d67ca29736 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:43 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:23 +0000 p_candebug(9): cr_bsd_visible() impacts, misc fixes Mention cr_bsd_visible(9). Remove references to cr_canseeothergids(9) and cr_canseeotheruids(9), as well as indirect references not immediately useful. Fix description of credentials checks to match reality. Re-order errors to match code's check order. Reviewed by: bcr, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40638 (cherry picked from commit eb94f24fab4b44f13ca045370d9fcf12ca8835f2) Approved by: markj (mentor) --- share/man/man9/p_candebug.9 | 103 ++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/share/man/man9/p_candebug.9 b/share/man/man9/p_candebug.9 index e80d313de55c..c824db974154 100644 --- a/share/man/man9/p_candebug.9 +++ b/share/man/man9/p_candebug.9 @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2003 Joseph Koshy +.\" Copyright (c) 2023 Olivier Certner .\" .\" All rights reserved. .\" @@ -25,7 +26,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 19, 2006 +.Dd August 18, 2023 .Dt P_CANDEBUG 9 .Os .Sh NAME @@ -37,24 +38,27 @@ .Ft int .Fn p_candebug "struct thread *td" "struct proc *p" .Sh DESCRIPTION -This function can be used to determine if a given process +This function determines if a given process .Fa p -is debuggable by the thread +is debuggable by some thread .Fa td . -.Sh SYSCTL VARIABLES +.Pp The following .Xr sysctl 8 variables directly influence the behaviour of .Fn p_candebug : .Bl -tag -width indent +.It Va security.bsd.unprivileged_proc_debug +Must be set to a non-zero value to allow unprivileged processes +access to the kernel's debug facilities. .It Va kern.securelevel Debugging of the init process is not allowed if this variable is .Li 1 or greater. -.It Va security.bsd.unprivileged_proc_debug -Must be set to a non-zero value to allow unprivileged processes -access to the kernel's debug facilities. .El +.Pp +Other such variables indirectly influence it; see +.Xr cr_bsd_visible 9 . .Sh RETURN VALUES The .Fn p_candebug @@ -68,35 +72,45 @@ is debuggable by thread or a non-zero error return value otherwise. .Sh ERRORS .Bl -tag -width Er -.It Bq Er EACCESS -The MAC subsystem denied debuggability. -.It Bq Er EAGAIN -Process -.Fa p -is in the process of being -.Fn exec Ns 'ed. .It Bq Er EPERM +An unprivileged process attempted to debug another process but the system is +configured to deny it +.Po +see +.Xr sysctl 8 +variable +.Va security.bsd.unprivileged_proc_debug +above +.Pc . +.It Bq Er ESRCH Thread .Fa td -lacks super-user credentials and process -.Fa p -is executing a set-user-ID or set-group-ID executable. +has been jailed and the process to debug does not belong to the same jail or one +of its sub-jails, as determined by +.Xr prison_check 9 . +.It Bq Er ESRCH +.Xr cr_bsd_visible 9 +denied visibility according to the BSD security policies in force. .It Bq Er EPERM Thread .Fa td -lacks super-user credentials and process +lacks superuser credentials and its (effective) group set is not a superset of +process .Fa p Ns 's -group set is not a subset of -.Fa td Ns 's -effective group set. +whole group set +.Pq "including real, effective and saved group IDs" . .It Bq Er EPERM Thread .Fa td -lacks super-user credentials and process -.Fa p Ns 's -user IDs do not match thread -.Fa td Ns 's -effective user ID. +lacks superuser credentials and its (effective) user ID does not match all user +IDs of process +.Fa p . +.It Bq Er EPERM +Thread +.Fa td +lacks superuser credentials and process +.Fa p +is executing a set-user-ID or set-group-ID executable. .It Bq Er EPERM Process .Fa p @@ -107,30 +121,25 @@ and the variable .Va kern.securelevel is greater than zero. -.It Bq Er ESRCH +.It Bq Er EBUSY Process .Fa p -is not visible to thread -.Fa td -as determined by -.Xr cr_canseeotheruids 9 -or -.Xr cr_canseeothergids 9 . -.It Bq Er ESRCH -Thread -.Fa td -has been jailed and process +is in the process of being +.Fn exec Ns 'ed. +.It Bq Er EPERM +Process .Fa p -does not belong to the same jail as -.Fa td . -.It Bq Er ESRCH -The MAC subsystem denied debuggability. +denied debuggability +.Po +see +.Xr procctl 2 , +command +.Dv PROC_TRACE_CTL +.Pc . .El .Sh SEE ALSO -.Xr jail 2 , -.Xr sysctl 8 , -.Xr cr_canseeothergids 9 , -.Xr cr_canseeotheruids 9 , +.Xr prison_check 9 , .Xr mac 9 , -.Xr p_cansee 9 , -.Xr prison_check 9 +.Xr cr_bsd_visible 9 , +.Xr procctl 2 , +.Xr p_cansee 9 From nobody Thu Dec 21 13:43:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8T0NdRz54pXM; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8S5CP9z4NWP; Thu, 21 Dec 2023 13: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=1703166216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P6wKzjpgaoZdQgaHlqq06jRQyiHpW7dcw5qoj4FVtTA=; b=QWk2DG0oC2Yp5hzi/ckP/5oemQ62Hfk2jZ1FRX+Xf0zW50liKrx+LywqZQs+lWDn44IsvP /lDVayrq0c4FCbrlFOLFhN/QFxw2+FEh64UXXu6EIcHRQyke9l8M5baWVw+oSbrBhBoC3C XUP1UYsimMkYAaICRdG49UAiFa7gUwdlVxnIC6cJjq357CWbF0AvbamGxheoinU4b/ahXI ahh4bGSO/0he8cWdlWpAib7HmFgPUh0IWOTQFpo/5N9irriLIT6/QUyqLbfJ9/OMxJNpVw H/TX6kSIvNfHotZEFmqN9TuhEnakEgyPcSPLUVDgOqvu3GnVYVDMWjdkDJjKAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166216; a=rsa-sha256; cv=none; b=uRE8mqsAMbMeW2zcSEjfkMYM95w/wTg2grDbKcyeIpR2nMLLyCwTHzy4dayhak6+dvXDWw BMkKOdS/87vdQcO2Nxg2hCSkO2lFTgo3nBt2Add++ykEZalAoOwF47Fy1JDe4kXksFPxKP VyAVxqlFOJUGQSH5/HMHeeOfNE0tTnfhnreNUoNfCE5FAlHnZivpVg9br3eTrEnQdyuU3A q6iRKTk+utHkt3Y+FtD61GzXQROUCITtyGEKAApK4civeBjv9ndCQP8stt6u5yhlODexqd dm2VgdALoSOyUlgyJ8Nlplz4fhKu3o2yZqYdLVEElLS7smj74WfYky/BWjWyYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P6wKzjpgaoZdQgaHlqq06jRQyiHpW7dcw5qoj4FVtTA=; b=b5E3zW99eWCNnS/4HK++HlhKcyrcVw/ETi3MrKS+5OP1CbgVz4ySzK2+Xkh/JN27eP9u9I PHYM0Doj4uzl7cayNrgn6r+54gHKVS1ITbxQc2/TIKgRZk+f8WQzBCqTA/vDrZF6Bx/gsn YoOZQ2uKIatXWupPklxaqyL2bQF/ikMBRPhiPHYet2F6QaVm5nB3jsAsK0AIPw0Me2Kuvy jgdQCtrA0ZX2IAz4fSXDUYfm+VDnHJB4HHMz8GdLo9N7q3h7f63/UZwt6ItPfJ8zQcS48s a7alV00CFMPhl5Sjq12P9yrtxpVCp55r2UMGwV3Tqzjcbx5xv5hhWahRlNnPKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8S4KVVzZmM; Thu, 21 Dec 2023 13:43:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDha30079125; Thu, 21 Dec 2023 13:43:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhak8079122; Thu, 21 Dec 2023 13:43:36 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:36 GMT Message-Id: <202312211343.3BLDhak8079122@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: 865df3aed731 - stable/13 - prison_check(9): Bring up-to-date with hierarchical jails List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 865df3aed73197f00967fed573fc9fa7b74df08d Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=865df3aed73197f00967fed573fc9fa7b74df08d commit 865df3aed73197f00967fed573fc9fa7b74df08d Author: Olivier Certner AuthorDate: 2023-08-17 23:54:44 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:38 +0000 prison_check(9): Bring up-to-date with hierarchical jails Reviewed by: bcr, emaste, pauamma_gundo.com, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40639 (cherry picked from commit e9fdd494537ca45b14e0917e8bb1595b6460f3a3) Approved by: markj (mentor) --- share/man/man9/prison_check.9 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/share/man/man9/prison_check.9 b/share/man/man9/prison_check.9 index b3bdcf6b4571..7f174e3ceb2e 100644 --- a/share/man/man9/prison_check.9 +++ b/share/man/man9/prison_check.9 @@ -25,22 +25,23 @@ .\" (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 December 11, 2003 +.Dd August 18, 2023 .Dt PRISON_CHECK 9 .Os .Sh NAME .Nm prison_check -.Nd determine if two credentials belong to the same jail +.Nd determine if subjects may see entities according to jail restrictions .Sh SYNOPSIS .In sys/jail.h .Ft int .Fn prison_check "struct ucred *cred1" "struct ucred *cred2" .Sh DESCRIPTION -This function can be used to determine if the two credentials +This function determines if a subject with credentials .Fa cred1 -and +is denied access to subjects or objects with credentials .Fa cred2 -belong to the same jail. +according to the policy that a subject can see subjects or objects in its own +jail or any sub-jail of it. .Sh RETURN VALUES The .Fn prison_check @@ -48,12 +49,9 @@ function returns .Er ESRCH if -.Fa cred1 -has been jailed, and -.Fa cred1 -and .Fa cred2 -do not belong to the same jail. +is not in the same jail or a sub-jail of that of +.Fa cred1 . In all other cases, .Fn prison_check returns zero. From nobody Thu Dec 21 13:43:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8V3ssdz54pcL; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8T62gdz4NWh; Thu, 21 Dec 2023 13: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=1703166217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=20gfSf7XhGCdobLBu08/yEc7BVQez8Iq0W1A7sZ0Kgw=; b=YoqGYIle53KWsx2B2uOGS3mgdFuxrmKKQNvtzns0+pyAXvg32AYb11Oo4na1qp3Msd/u+U ojGPZQKcbFxgHM+mQuJskyvoboDNUt2e8CFf/dD+kYb91UHFMiojgMv/Hmk48Hx0hlIi94 czyQLk4a7eWuXyqOAed7CVasf4Cz1qIXTkUiEyMZJrOKQQhWz6Ms8ABIyfOzRCEsgrnUOK 4tW0NhBQTj4+st/vtROSo5mOzJ1mX6k43upzDya1+Hgs8mpgV2oAs+kuo8IHdYxRzxZCup h2t66QK4RokovwLHDcY3rrVXWZDwP8X8OgRGe84bFnE2M5li/eh4GwtZPniCdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166217; a=rsa-sha256; cv=none; b=EcE9fZLAt0k6/ZoUqVbEKk9f78OB2LQjAIbVol91izz+gH0y2OOzXWUNY2glk1QE9PoCfW qh/5xPGvlAardVVM08RjUsQtPxtbo82gf4bwygTthN6H3cJtnzJfWhLmPksPjeCABduYYa jHoqvWCRPGGBFZSCWTZQYIxC72OVp/4kMDS0CurE1dYxN4Zoh3keVtCXtwM3c4yWgFQmMB SkaUU2HxjTBUKiWLke0LUz19VqiZQKPl8KJ8h4MRV9embs8pd4gFnHmCFoB4CYj3UZOv6n 6XIng7dzqWcDFqOplX2QlUb+wxTEFRe/YmEqAHQV4zN6sBbA56uXCfTc7CfI9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=20gfSf7XhGCdobLBu08/yEc7BVQez8Iq0W1A7sZ0Kgw=; b=R1vwPrf7EtLZxx9CUDlTFoLBsyvbkd6rlxS+wncTH6dzhhLFYFOWtyLB7r5skkQ9p27mPc 2hk6r/eZ2n7ytkXUyAX/wHSxAvPFPIBmxyhyAIAmX++uv5UrliTQCOygZI56/WKxfq8Img i1lOMhVURcLDq4aSj1xt065XgQfTKaJDNEEOARrR8/L3VAuE945XoxwpOIUBvAxGUxCaVy j8R/Zvo5cV+N1s8PC1YRxRjv/j+pv/Xku8kKYJzulbncJ6ex9sXSQpmdQrkYBkEHpENpSk h+eVbHhCjgG1UoYaR/sAF6A3vYSElX848ec/QkqhVHMJ74+yzyUMNGyHWWnWhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8T57rPzZF9; Thu, 21 Dec 2023 13:43:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhbvR079188; Thu, 21 Dec 2023 13:43:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhbb1079185; Thu, 21 Dec 2023 13:43:37 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:37 GMT Message-Id: <202312211343.3BLDhbb1079185@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: c55330ce4d1a - stable/13 - groupmember(): Extract the supplementary group search in a separate function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c55330ce4d1a8cfa214299872f243d1dffc90376 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=c55330ce4d1a8cfa214299872f243d1dffc90376 commit c55330ce4d1a8cfa214299872f243d1dffc90376 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:44 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:45 +0000 groupmember(): Extract the supplementary group search in a separate function This is in preparation for the introduction of the new realgroupmember() function, which does the same search into supplementary groups as groupmember(). Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40640 (cherry picked from commit b725f232f3b09b4bcbc426854fe1545234c66965) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 7f196a446315..682754dd7687 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1275,36 +1275,43 @@ sys___setugid(struct thread *td, struct __setugid_args *uap) } /* - * Check if gid is a member of the group set. + * Returns whether gid designates a supplementary group in cred. */ -int -groupmember(gid_t gid, struct ucred *cred) +static int +supplementary_group_member(gid_t gid, struct ucred *cred) { - int l; - int h; - int m; - - if (cred->cr_groups[0] == gid) - return(1); + int l, h, m; /* - * If gid was not our primary group, perform a binary search - * of the supplemental groups. This is possible because we - * sort the groups in crsetgroups(). + * Perform a binary search of the supplemental groups. This is possible + * because we sort the groups in crsetgroups(). */ l = 1; h = cred->cr_ngroups; + while (l < h) { - m = l + ((h - l) / 2); + m = l + (h - l) / 2; if (cred->cr_groups[m] < gid) - l = m + 1; + l = m + 1; else - h = m; + h = m; } - if ((l < cred->cr_ngroups) && (cred->cr_groups[l] == gid)) + + return (l < cred->cr_ngroups && cred->cr_groups[l] == gid); +} + +/* + * Check if gid is a member of the (effective) group set (i.e., effective and + * supplementary groups). + */ +int +groupmember(gid_t gid, struct ucred *cred) +{ + + if (cred->cr_groups[0] == gid) return (1); - return (0); + return (supplementary_group_member(gid, cred)); } /* From nobody Thu Dec 21 13:43:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8W1p5Jz54pXS; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8W04Cnz4NkL; Thu, 21 Dec 2023 13: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=1703166219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VKzpyN7oh/oqf2ROLzVvs8wS1DcdlezGXjPZ2EUMDDk=; b=HrtaYMQabwNQI3fNHTXpVVotxC+mwsohQN9Aslc3m0AaC9hnEhBBGwGwXjB62BxwmMJFML m5UDdubi8ldz2G8jKyoH6xPEwNNih7i3d8t0MTj26P08LdD64Yi9Qbe9Mtom9Wkyhi0I5d qHWv76QgUzvEp+LZPbo4wH79xVJLJfTqHdPcCkwVJQ8WAsPZIFisLymKFufvd3BLsUA0J4 N75MWFYc4aVz1ZSJVmfgKzSRbORfGLKSmM2YhZajKpo0304TpXwO36GpBAf/lSgiQLkUYz AP1T9rpy1z8U9djC8Z7P3GsjPtmXVOd4nCbJa+xU9Ycp+scGdeZFtPW3/UUqjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166219; a=rsa-sha256; cv=none; b=ZJ8F2R/on34e8MO2HUr9jsXM3RJuTIzju4qN5XVCHpGu/o7gsUyARlVtm4qpoHvqNbAFJt 1RFr1VEQ2ipDnxrm841J38ga0JGEkaRVy220MIcHn8Yo9WHnjU0kIbO+mgsSVyU8MSyaeq UrWdsrs/UW0RWVy6vG51M5wWhq8zvBfWVJ5q2KhslN6EonoEyb5VSEf0yPtn4kBN5D4q7C btVRMz2tsNso5aEoxSx0460LvFOjXbCoSOJcJ8+FobiD5pkv9uV2h3urgQCGQWCLTC46iu jXHJDoODiezwtkvYYkaGS5TsQE18rlyqs1wI2pS1ZugmcdIeSpkIoJYAjDmy+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VKzpyN7oh/oqf2ROLzVvs8wS1DcdlezGXjPZ2EUMDDk=; b=oHfD+IGg45rMwdM8lnENTP9UtPZGrVZ/5BQ3wLkS/Zi4uzysTymuh6kA1tcyhAWlm8/NtQ OfBXPtU5qaRctD/ZZQykdo+h2YMv4xkkvgJWHEtVaTIIzKGMCDZsks/43vBLalgDbjoFpF 0lahN0XX9EBc2bPauVF5JcrA1boeRFmu4Nxaviw2d/L/ZVwbhCvwH2f2alyp/EiCWJlF3s ZRzrgP/bLeNC1MBf2kdvMkR8FvMbfXMigUFI8GTwO1jQc16zA0X5QXvmvizhVEyNilW26J a1zB4aGXzDvp2vlhbtvA4nFMoRPR1dx13NYBDQ7HBhNHPiqlIwcu996deBdr2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8V6FctzZdF; Thu, 21 Dec 2023 13:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhckT079221; Thu, 21 Dec 2023 13:43:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhc5O079218; Thu, 21 Dec 2023 13:43:38 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:38 GMT Message-Id: <202312211343.3BLDhc5O079218@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: 3fab2d96cdd7 - stable/13 - New realgroupmember() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 3fab2d96cdd7f4ce78391ab67f719bd2936bec60 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3fab2d96cdd7f4ce78391ab67f719bd2936bec60 commit 3fab2d96cdd7f4ce78391ab67f719bd2936bec60 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:45 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:52 +0000 New realgroupmember() Like groupmember(), but taking into account the real group instead of the effective group. Leverages the new supplementary_group_member() function. Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40641 (cherry picked from commit 2a2bfa6ad92e9c82dcc55733ad2fd58fd2ea7559) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 13 +++++++++++++ sys/sys/ucred.h | 1 + 2 files changed, 14 insertions(+) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 682754dd7687..e6c11d2ea74b 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1314,6 +1314,19 @@ groupmember(gid_t gid, struct ucred *cred) return (supplementary_group_member(gid, cred)); } +/* + * Check if gid is a member of the real group set (i.e., real and supplementary + * groups). + */ +int +realgroupmember(gid_t gid, struct ucred *cred) +{ + if (gid == cred->cr_rgid) + return (1); + + return (supplementary_group_member(gid, cred)); +} + /* * Test the active securelevel against a given level. securelevel_gt() * implements (securelevel > level). securelevel_ge() implements diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index b17dccada4d8..837c33757317 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -159,6 +159,7 @@ void cru2x(struct ucred *cr, struct xucred *xcr); void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); int groupmember(gid_t gid, struct ucred *cred); +int realgroupmember(gid_t gid, struct ucred *cred); #endif /* _KERNEL */ #endif /* !_SYS_UCRED_H_ */ From nobody Thu Dec 21 13:43:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8X2mT4z54pVG; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8X1DNVz4Nfm; Thu, 21 Dec 2023 13: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=1703166220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMrDpT+Pl6A83cm4DmVfqKNZTQj4IZuWMuhkwhEYoc4=; b=NEcZW7W4IuIeD2O6Ikc+IkfE+SE0WYcPLcznhE227LvCGGlBWxOK3tihJTEwXNWIaeVDF3 jecFJ312D5oiAda5UqBX5jYN5Gz3OuMPOZQW2xcOZbkfY1zbs9up8aQcUF1mRjxi8oCD1X GjbgOdzdzKAI87dZvBYEQfXJ6AGKXRjozr9c6mFEWrP0AIcpEYcQxlambJRjVtzNbF1CUL rqaWLLcq6VrfFkN3GnATT5KI6pWjgRtKbHpWbqoEPNO5cfL78OxMz1MxXxH129weZIChX7 7rk9C8p5IaZglN5JvBhvmCgDzIXiF6XOiPln9+m1kOlCHo6HPVl/CmopiSOItA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166220; a=rsa-sha256; cv=none; b=fb+6PsD6Z32Ow3qCF/eZrpCJUpkf5RJqdjf4NhmZNpY5Uxlo1VALzU2eW1HuizBpxy5Pdv /Oa9qG+hS+Vo6jq0mog6AqIEByB3gBC6GpxrMWTsiEfcn6rnD1gatdANwc5JBbimwOrs3i Mr5+DKRq6vZPOOPBrg5OtxTfnR+OzU91hx4NbHfEc5nudgYo7gon+LJUBAnQYfWHgiRz7l PN9gnRnh3z7KkN+0tkkH9rjjOPtXe+5csiFyU7kjSInenIKIDiK0cqkF/SemBuEcQ3bOWX GcTlwB3e/K7GA5Y3DvHh47HBcAYZOjdgRkcpkUklWzEDRr4u6O7twntFZbimQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XMrDpT+Pl6A83cm4DmVfqKNZTQj4IZuWMuhkwhEYoc4=; b=jS2lGa27iSSX37TCBz9cV7nLE9YR6aco0nu2epvCbFEWsOahZ2A+WPajEoKG/E7bqmbcZj +/F1oA6Iv83oq0M7Ij5JqXxbEyepBcxtS7q9yHhl/oW2sqLE1kJ4dXFCotkXitcIR6Rn8z SLUnx8UOVjhfSNWhzn9Kq5z/msdnZk4j1m6f0lmfxVvhWU9GHvQCu1WZFhc5/oGm2NLNjJ YFcMXBAqgGR80m0nYG+72W1tckU0oMe2nicFGwjZJJA2MDGQoy0Wo4vce0og9yps+RPToL gyN7aebjlSQMb5bd/9+pAo6Wzl+0pa2yeAnTTUuV3laq4rwqfE5fx1FnKHQzdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8X0KRFzZdG; Thu, 21 Dec 2023 13:43:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhd6R079269; Thu, 21 Dec 2023 13:43:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhdf6079266; Thu, 21 Dec 2023 13:43:39 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:39 GMT Message-Id: <202312211343.3BLDhdf6079266@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: 3eb8bf041831 - stable/13 - realgroupmember(9): Link to groupmember(9), document the 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 3eb8bf041831a0f5ee6e682a9826c1ae89b254a4 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=3eb8bf041831a0f5ee6e682a9826c1ae89b254a4 commit 3eb8bf041831a0f5ee6e682a9826c1ae89b254a4 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:46 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:37:59 +0000 realgroupmember(9): Link to groupmember(9), document the function Reviewed by: bcr (older version), mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40643 (cherry picked from commit 5d9f38405a10fdcd9fc108c940dcf2642e9f1833) Approved by: markj (mentor) --- share/man/man9/Makefile | 1 + share/man/man9/groupmember.9 | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 18642ff86010..d237f677311a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1155,6 +1155,7 @@ MLINKS+=g_provider.9 g_destroy_provider.9 \ g_provider.9 g_error_provider.9 \ g_provider.9 g_new_providerf.9 MLINKS+=gone_in.9 gone_in_dev.9 +MLINKS+=groupmember.9 realgroupmember.9 MLINKS+=hash.9 hash32.9 \ hash.9 hash32_buf.9 \ hash.9 hash32_str.9 \ diff --git a/share/man/man9/groupmember.9 b/share/man/man9/groupmember.9 index 3a516622efce..ae7ccd477955 100644 --- a/share/man/man9/groupmember.9 +++ b/share/man/man9/groupmember.9 @@ -36,6 +36,8 @@ .In sys/ucred.h .Ft int .Fn groupmember "gid_t gid" "struct ucred *cred" +.Ft int +.Fn realgroupmember "gid_t gid" "struct ucred *cred" .Sh DESCRIPTION The .Fn groupmember @@ -49,6 +51,11 @@ Considered groups in .Fa cred are the effective and supplementary groups. The real group is not taken into account. +.Pp +Function +.Fn realgroupmember +works the same except that it considers instead the real and supplementary +groups, and not the effective one. .Sh RETURN VALUES If the .Fa gid From nobody Thu Dec 21 13:43:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8Y3Xxrz54prg; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8Y2WzQz4Nck; Thu, 21 Dec 2023 13:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2tUM13aT55QWssPEAwCezYwpYjMoafu0+PYNhKJAKg=; b=h3n07SVad8oNUzIQqUj/lCrnbCV+Llr4sXUsPyt+PelUXN6bv9HAdXX7BH3PyXWHH4T/WY VJTHABkPTsw6mogn4HgqYT9AmIBol8RSvU8b4/h0UiCaksyFjTzLWA6kok9ajzRJfDLoak 3QlwaCn5qUzqniCz+1PErLPGCKrviQLvQN6BCXtUyaMxzaptHpF2kpeCREtUk5HVGDPjwn iuyfn1LL+eevEXZv8Qbjlq2i/+R0a6KyuT+EvTeCU4CtY8M3wP6Ex9uHh45enJIoSfQx75 wA9Rz8DU8D6DNOHXV5LSjpHeGzC1Kper+eDezbOQqIlOCB2PC62sAP/j8PbePw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166221; a=rsa-sha256; cv=none; b=o/Tg4KYfUUZRfm0YnHzno44T/jQZlOUNYz6Nc5V/CawFL1T29gSH6VKcv/aYAPlCexwvOP nZnZzL5dAfkPIaaSr/Af5tOTeBvFHXffSxUATnbsmWLFNdGmuZlDEPf95b6lyMK7L6cgFf hEEdB/PHpbUF+fCK5R53O0Sj211gFpOYtVhJ0s3yqPxDF/Y3AH1cY5kPh1+kTWPSnXG3e/ LXwbYXLAfdlslDXAg/DEQdsM6EWIlJJKgZ8wXA0aZhLc2smz/ueKMXPzFwAMDLMJ2oo6WY snTyZLTexmZJUb+xK5WRxOU9snsaDaE5c/L7dLfvvqKxO9JqohJGf0P9Vap0tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2tUM13aT55QWssPEAwCezYwpYjMoafu0+PYNhKJAKg=; b=mokL7duto9EH/V+me6E8PBgJHDyCViHHDqGMiF+ep+DWuYY1TM7cGC15CrXC9YOGvc2fsw t3xRPvty1JuDnKUBZXdTi3OP6KqnaqTxwJYESH8Y9wkimqaCzgCDZGs+o10ps75aElkN0l h4EA2cfjWphUmQiDFPLxLoBcrZ8h78kzvhwkpQl8b2xx1NXd3rKvTuU6yWc536JUa6GRqP dotNtsSP2oGeVVt63vACZhaGU/UOSsujfzqMVISqTUzqWlPmH8xZ+6uG+WQEKGNL99u5p8 ufpIU8v2zxFlBLHYAMHF75HIhdyYuV8G2D52c39f80O2FW1yuBvYCtQIqi8o3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8Y1SxYzb4H; Thu, 21 Dec 2023 13:43:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhfG1079320; Thu, 21 Dec 2023 13:43:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhf2l079317; Thu, 21 Dec 2023 13:43:41 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:41 GMT Message-Id: <202312211343.3BLDhf2l079317@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: f0951233c6d3 - stable/13 - cr_canseeothergids(): Use real instead of effective group membership List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f0951233c6d33da3c9a6bc347d9ae7aa911d7ca9 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f0951233c6d33da3c9a6bc347d9ae7aa911d7ca9 commit f0951233c6d33da3c9a6bc347d9ae7aa911d7ca9 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:45 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:07 +0000 cr_canseeothergids(): Use real instead of effective group membership Using the effective group and not the real one when testing membership has the consequence that unprivileged processes cannot see setuid commands they launch until these have relinquished their privileges. This is also in contradiction with how the similar cr_canseeotheruids() works, i.e., by taking into account real user IDs. Fix this by substituting groupmember() with realgroupmember(). While here, simplify the code. PR: 272093 Reviewed by: mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40642 (cherry picked from commit 91658080f1a598ddda03943a783c9a941199f7d2) Approved by: markj (mentor) --- sys/kern/kern_prot.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index e6c11d2ea74b..1c9e2927bc5e 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1406,21 +1406,18 @@ SYSCTL_INT(_security_bsd, OID_AUTO, see_other_gids, CTLFLAG_RW, int cr_canseeothergids(struct ucred *u1, struct ucred *u2) { - int i, match; - if (!see_other_gids) { - match = 0; - for (i = 0; i < u1->cr_ngroups; i++) { - if (groupmember(u1->cr_groups[i], u2)) - match = 1; - if (match) - break; - } - if (!match) { - if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) != 0) - return (ESRCH); - } + if (realgroupmember(u1->cr_rgid, u2)) + return (0); + + for (int i = 1; i < u1->cr_ngroups; i++) + if (realgroupmember(u1->cr_groups[i], u2)) + return (0); + + if (priv_check_cred(u1, PRIV_SEEOTHERGIDS) != 0) + return (ESRCH); } + return (0); } From nobody Thu Dec 21 13:43:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8b0JnGz54prl; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8Z3QKXz4NgG; Thu, 21 Dec 2023 13:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCzBbQ0vjjP+FQydvGBoXmfNddgY2q72BZ9gHyGsyts=; b=kVQjHGmkTuI6lXpwv1pGyK/jVfgc6ZlWV1a/uk4+k89QLZcwJszKp3xG0yKFh9e+D6+EjX Twahu17Dmd03bCACdSl1YAyjRwFs22nQ0aQ8yDHN48kdvSbngbcYniNHLhh1f1EFqd5yCv zpdLZ1BPhlE4doPAYe8IdnuH1UovP6EjyDIHPvDW0kTiJSCgt0eo/38BOr3lt8uvBXcEG5 LF6oWmYQSoG2orf8FQrmsp0KLYDXmkZ9ndDRbg9qcOmrK9WBmy0TarOzrprXTFXFqMnlTG K7jRcckRS3RWzURq1zMEhNozBtXxUuI4Cns066dfQHAZjtZwc5rzHTreT7qcSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166222; a=rsa-sha256; cv=none; b=EbpJisEbxDppy11mqUMs6MsJ+9mjMqgGIG/Yf2i1V2gem9Q8Rpy0GsgUKz3UU+GVMvxQu7 5nUdv7tkVAD/7Pu9uBrwgFh4/KDsehqVYNOdHGd+LB0ILsgZrq26hueulQQzUQ9a8YZ8BB b37Uu/nTFVylUm4idXWmyBnlaDQwcHV/27DuJ9B2alpCQWrPDua0gxIbxDf8WIq2GsZySk bkCXCmp4pwNleCa4FnOmQI7fiOrEN2mT3HTQT351ZEP7TQj2gvJ4H6nYMoEvy5ybNJcjiQ kZRGiXRJoeBgSPGjM9lKNv6jkJHQe7wnHo7y50lvnF7jbe6u0U6gtdGqrzw3lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mCzBbQ0vjjP+FQydvGBoXmfNddgY2q72BZ9gHyGsyts=; b=DY2EZbhOBGlZ5pDPv9nXVfjB9fjXOz6qgjPcyxI48QthYqo179AoOzcJ02mohhj4qy7TdV bFZixIS23Wv+J6yhyDaMXpbMuy9LNcDowfKy/k0qEYgJDLsd0OV5CGyLpVc6xnBk+TfpO7 d3PGfFwnLu7ZLrLKF1e8sR2yAbJ2b76KLS60IJ1USNM5YXzmO50YX4roTw3vopyog9xku9 MeSetSAUrkGnD7JQzkg2bu3vq1MJ46mYNle21qSQIEogqU6KC/TRFv72+n21mDSo+SmrjD KUnIpHqOGRbiQLdVnhi2zxBv5rgYAP0pY5UFAxliiBM7QZYS7Sx/kLm3X4VILA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8Z2Vczzb4J; Thu, 21 Dec 2023 13:43:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhgqY079365; Thu, 21 Dec 2023 13:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhgFf079362; Thu, 21 Dec 2023 13:43:42 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:42 GMT Message-Id: <202312211343.3BLDhgFf079362@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: 0297e7213c0c - stable/13 - cr_canseeothergids(): Policy change's manual pages impact List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0297e7213c0c0ce8bd7bdc107da953e8fb6b5815 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0297e7213c0c0ce8bd7bdc107da953e8fb6b5815 commit 0297e7213c0c0ce8bd7bdc107da953e8fb6b5815 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:46 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:15 +0000 cr_canseeothergids(): Policy change's manual pages impact See previous commit that made cr_canseeothergids() use the new realgroupmember() function, taking into account real group IDs instead of effective ones. PR: 272093 Reviewed by: pauamma_gundo.com, mhorne Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40644 (cherry picked from commit 0452dd841336cea7cd979b13ef12b6ea5e992eff) Approved by: markj (mentor) --- share/man/man9/cr_bsd_visible.9 | 2 +- share/man/man9/cr_canseeothergids.9 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/share/man/man9/cr_bsd_visible.9 b/share/man/man9/cr_bsd_visible.9 index bd676e6f5705..f2d42f3835dc 100644 --- a/share/man/man9/cr_bsd_visible.9 +++ b/share/man/man9/cr_bsd_visible.9 @@ -97,7 +97,7 @@ and are not members of any common group .Po as determined by -.Xr groupmember 9 +.Xr realgroupmember 9 .Pc . .It Bq Er ESRCH Credentials diff --git a/share/man/man9/cr_canseeothergids.9 b/share/man/man9/cr_canseeothergids.9 index f0c1e5c4e726..109d41a8545d 100644 --- a/share/man/man9/cr_canseeothergids.9 +++ b/share/man/man9/cr_canseeothergids.9 @@ -48,9 +48,9 @@ This function checks if a subject associated to credentials is denied seeing a subject or object associated to credentials .Fa u2 by a policy that requires both credentials to have at least one group in common. -For this determination, the effective and supplementary group IDs are used, but -not the real group IDs, as per -.Xr groupmember 9 . +For this determination, the real and supplementary group IDs are used, but +not the effective group IDs, as per +.Xr realgroupmember 9 . .Pp This policy is active if and only if the .Xr sysctl 8 @@ -79,5 +79,5 @@ Otherwise, it returns .Er ESRCH . .Sh SEE ALSO .Xr cr_bsd_visible 9 , -.Xr groupmember 9 , +.Xr realgroupmember 9 , .Xr priv_check_cred 9 From nobody Thu Dec 21 13:43:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8c00Xfz54pZR; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8b4Y3Wz4Ngh; Thu, 21 Dec 2023 13:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vt2Ax6bsLjkT7gphe3AFftNwGngIfSJpxKAHppJ0a3o=; b=WVbT2X6lNxRafnP8/z2b9WJKB3YXXCahtbmi6cRBSQgkJ34dvgRd3N2ahuXhjgsY0H1OwU hwbi1sEor+sQ/Qkq3L0ti3Okqqbpis6W8DCMUTZ2I+1mF7Tj8DLanz/z/b3SD0NLoBKpu7 N2NKM3CiWW/ZliZKuUCKF/5Rej63AiSb1OlEk8f4oAm+gCxpQlvTAYkx9mh0WgMh3zTkjb /1hZGkdyZLVeaGkWqvQjmY8uyhACZYwW86QpmJ6Asee5K4sYMgB/AqRjRFSWXlpklLnPjh VVWwvOTkrJYvFa3XGnzd++clHJ5DshyY+VksSJFY0FcAJhg3wMiedXR+/YX99w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166223; a=rsa-sha256; cv=none; b=B2ZaAs8lQHdC75dKDTNGCuFSSDFmnHiQQfFU1i+3+pwhCx3FSDs0KRBFiJS7swp6YmXzUV ORfEruG4bGAK6TJNPHomalP3HIJ0cyYQTU1/tPR1IqSh2q2STt9tYs9gToL4egVzav2zkP mRS2oPLRO7Nx2jzxjGKOFArq15jQfotpi0evL4x+ydsiRCNG/6BG1eYvodxjnH7cTsBvgy wEiCj0Kva74M9IDnS0tzJsJHwQyx+TXn2BC7iDfDCaQ5LXhYrVVSY4etbID2xwCPkxCtVx fSTHPzV781HaxLrohudM1x+KxyW0OEGg1BBJx4SARW+dT7ha/F+JpYwu6fb4PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vt2Ax6bsLjkT7gphe3AFftNwGngIfSJpxKAHppJ0a3o=; b=CrQuxdZ5wAjHtpwP/uYhvFL4IqZQwZ5+PF5pEV+LKx+lBSfb9yP6CKffKS/tCa3W6HXe6o ydpgqak4i/IRWEQ5MgiiFdyTtI5eNP2eR/6N+DBkKncwzQTTrkUGQ3X9t+pmwepX909Ydj lUWCMr9+5trPlPgUPse00u5hjyZch8hPJGWXAt3KDQanjkBV1bUvh+380mrClaM1Yk9MFm lH6cnRAvshMCEvdMOAZCHhIjFtf09jomasRoiEaa2B/PtAE5fvLrmw6cPlBo9JIfc319sS W/ylAWP2rCtLuB/w/PWiTSQ3X5Qd6wMcye6yAY7hvBFSYrntxzWWo8F/xP7CtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8b3fhtzZdH; Thu, 21 Dec 2023 13:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhhxP079413; Thu, 21 Dec 2023 13:43:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhhU5079410; Thu, 21 Dec 2023 13:43:43 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:43 GMT Message-Id: <202312211343.3BLDhhU5079410@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: 56f758066c82 - stable/13 - security(7): security.bsd.see*: Be more accurate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 56f758066c8272ce37394365945ae62c10456e49 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=56f758066c8272ce37394365945ae62c10456e49 commit 56f758066c8272ce37394365945ae62c10456e49 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:48 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:22 +0000 security(7): security.bsd.see*: Be more accurate Reviewed by: mhorne, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41108 (cherry picked from commit 61b6e00bee1d39e9c688e728fbf3a4efcdb61e66) Approved by: markj (mentor) --- share/man/man7/security.7 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index e84d3cf4fb4b..785cfcb6c7e5 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 14, 2022 +.Dd August 18, 2023 .Dt SECURITY 7 .Os .Sh NAME @@ -956,16 +956,18 @@ Backwards compatibility shims for the interim sysctls under will not be added. .Bl -tag -width security.bsd.unprivileged_proc_debug .It Dv security.bsd.see_other_uids -Controls visibility of processes owned by different uid. +Controls visibility and reachability of subjects (e.g., processes) and objects +(e.g., sockets) owned by a different uid. The knob directly affects the .Dv kern.proc sysctls filtering of data, which results in restricted output from utilities like .Xr ps 1 . .It Dv security.bsd.see_other_gids -Same, for processes owned by different gid. +Same, for subjects and objects owned by a different gid. .It Dv security.bsd.see_jail_proc -Same, for processes belonging to a jail. +Same, for subjects and objects belonging to a different jail, including +sub-jails. .It Dv security.bsd.conservative_signals When enabled, unprivileged users are only allowed to send job control and usual termination signals like From nobody Thu Dec 21 13:43:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8d12sqz54pXh; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8c5nNnz4P2K; Thu, 21 Dec 2023 13:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CCQofkutay05AvN3ruFtKL55S213Lx3yX+8qaXz/YqE=; b=pYw/eEKSxWJNfYnvA2Xb8Q50LU/xc3eFhp3Gu1ZzeLvHd6l3nfgfzrBtCM8I1gd1orDieg UIQPYqmZyJPP9QdTw/0o5FkOlqc4yxMWbkC9HOvUte3YhmfJC9t2A1uzWklyw3y25qBfdN EZjcJ7mSeOdADyY3W1Otu4H14+bn+j2PqcvQnufsO1NuIQ3EtgMXvni2ae/6cHQQAro3DW J732ExCC0GNg6ZKv+YiVf2ESkbBQbAWR07EKKH+MLNHtgeKfi18/r5jeyxTKWbaTw36Jc1 mfwKXDVjGUtkJdsi+1s40YzVxJMoKY1tAPV8e8zg5J+xisASosE+Xhrm2L0LqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166224; a=rsa-sha256; cv=none; b=JGgdRfx2BQ+KLYE8nUIaFNjfngNkYqbvc+qjLEpvR3M7ngujrhFRHx5IzNlDENCMW+twxV Gm4/4vpEMduBeMpr9qmWs5hWUpGiWDRvkqO2YS/uYXdA+cU6ERvkO4WOW7ItgiFF/5DbU0 i4Mc8R+pvaSow7qyV6qBOXnwzU/lM5xcoADq3WCHQ0M4RyP+t8j/MB7EMzKkI0pJQOMrxY UowNgv7nWTPQZvWtm1hsw5U5AEXSAZ+O4q+5dEyD9f5wMx8SZdVdWnwRE6gNP9tF/pmzr0 OKGLnnStU2H4NxC02sFKf/nwaTa0NVz8tY2J52FFa6iWT3YZGP3bCamTF5tfFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CCQofkutay05AvN3ruFtKL55S213Lx3yX+8qaXz/YqE=; b=xnywuNnPrxGCwb7KxpSarU7+OrD8ZkIFhltpfqYpEBOAwamK+BaszPGcCwoWxGu4sw2A54 dR4SJeOmzlTU0IkcNDIsss6Pp9WIXZr9M9clYNNQe7g4Mn2cf1g5gU8TVJ4737dTV/knGW OGji4hMD0oESgk8Bs0vfYub6TO89Ug5E2BQ5a7gaHn2aZG5b+FElIpkRPE5yZF0J2C0yk/ ogTCjDmL7ureuwC09yf79IXqZJiO36AnrS0q3Vn8ass3KekKvx9Ni+Xwy3Xapn0+Ioc835 AdKSJ1e2gYkFUGn4PhofhdQxwIkSnK5tbKIcPHYVq2dI1HJ0QEz1b0zcV6dikg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8c4tz0zZRT; Thu, 21 Dec 2023 13:43:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhiOo079458; Thu, 21 Dec 2023 13:43:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhiJd079455; Thu, 21 Dec 2023 13:43:44 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:44 GMT Message-Id: <202312211343.3BLDhiJd079455@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: 0c01901f122d - stable/13 - ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 commit 0c01901f122d1d9590f00c9b6fbd9f4d79e7d4f0 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:48 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:31 +0000 ptrace(2): Disabling: Describe influence of security.bsd.see_jail_proc Reviewed by: mhorne, emaste, pauamma_gundo.com Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41109 (cherry picked from commit d952820105d6a2ad87ddf3bdc6c5fc5215d13b87) Approved by: markj (mentor) --- lib/libc/sys/ptrace.2 | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index f417b4f021af..25c7663114a5 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -1,7 +1,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd December 15, 2022 +.Dd August 18, 2023 .Dt PTRACE 2 .Os .Sh NAME @@ -149,31 +149,37 @@ its scope. The following controls are provided for this: .Bl -tag -width security.bsd.unprivileged_proc_debug .It Dv security.bsd.allow_ptrace -Setting this sysctl to zero value makes +Setting this sysctl to zero makes .Nm return .Er ENOSYS always as if the syscall is not implemented by the kernel. .It Dv security.bsd.unprivileged_proc_debug -Setting this sysctl to zero disallows use of +Setting this sysctl to zero disallows the use of .Fn ptrace by unprivileged processes. .It Dv security.bsd.see_other_uids -Setting this sysctl to zero value disallows +Setting this sysctl to zero prevents .Fn ptrace -requests from targeting processes with the real user identifier different -from the real user identifier of the caller. -The requests return -.Er ESRCH -if policy is not met. +requests from targeting processes with a real user identifier different +from the caller's. +These requests will fail with error +.Er ESRCH . .It Dv security.bsd.see_other_gids -Setting this sysctl to zero value disallows +Setting this sysctl to zero disallows .Fn ptrace -requests from process belonging to a group that is not also one of -the group of the target process. -The requests return -.Er ESRCH -if policy is not met. +requests from processes that have no groups in common with the target process, +considering their sets of real and supplementary groups. +These requests will fail with error +.Er ESRCH . +.It Dv security.bsd.see_jail_proc +Setting this sysctl to zero disallows +.Fn ptrace +requests from processes belonging to a different jail than that of the target +process, even if the requesting process' jail is an ancestor of the target +process'. +These requests will fail with error +.Er ESRCH . .It Dv securelevel and init The .Xr init 1 From nobody Thu Dec 21 13:43:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8f4h3bz54ptw; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8d6yphz4Njm; Thu, 21 Dec 2023 13:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jbun8UmCQHxsKwYuDuFgUsmCpiNRvfktTFg8+Xr0Gs0=; b=IAN7x0mEOaM1qzUg0gky6NStL31BQqIWCLkruhNIdufk+CdK6I1+d1+SHBbZNz3Ct19TRF SZtUx9X+H+FoMXIKIAD320fvHynSDo89STFS+VRX0yRGEwxG3oC9eWGt+Sf5gcoGvMQe0Q JuWh53ldGQhTzCPy5dR1xOSZSpkI94K/09Aek2s3SXwyIm2EDVivf1QyIfEpkhYiHY0QLS RjD1UvCDBTKXYMnMX8bVBQ8n1QtgsqqG2ooKHKFg4yo2ASXdDxqnO02hzEhE5IePPXRlU7 CFXGS6/xEVbSRHJahzBdzUMCZyVd3v0MM34TtYKtdUUSb1PDPPk6ehDXRFFiSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166226; a=rsa-sha256; cv=none; b=q1i/rr8Jzj+SC2k01Y+R8P9qYs/YW5Fwv4CG2aRe8EFvA9kOBCY3d+ztKOsHjoWTTpo3wK QcSI6B7AqGrWXhLVFE2GM4r0LvyrgBsyb0KrOo6xrQTQqsFxHSxtfzT5jUBkco8KK/9ar1 OrhQtxh2/mj7tlqQVXroTTjoVaDf5Fz+knBBe9sJdg8A2m0QfwOH3qPLVi2WDykW8SKgsV Y+Uh8N2Lyu1k37C7ocR5rb2KWplKRFAd5Q9E8cNr/AIqCZ65IFBqyP6Wcjcorg4h8Y8ADC ihgBYNiNZDISwH4LILvjL24ShK9nh6kO8Q5QcgzGq+NuOG/u/2HybjBBt+eXxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jbun8UmCQHxsKwYuDuFgUsmCpiNRvfktTFg8+Xr0Gs0=; b=oV117lHcL+xSCpaZwP8yLeVoIbLOn8vlDaYbVJtHoQoyvILhmCxwNQRp9aPKL/w4j4D272 tkDtPFZYbv+b24CYzlFPfP8hsakmhEn3xdLEiP8a8Ly+Hd0sGDYOQ3DRDNq7EQrMjk3bgd 1uiw5YcFyGOK9hflXmcjFiQt43Epf346DvZ8C2sZQ7nyWFE86ZK1y8X/rGaEamE4vBJYDw hVtyA46mzT2X9DYYpDtkej3J+uGJKh5maruW6mpvvTpecJCkt7UbwvRnp3s3Vq5gX+uMti jcRcQeiXqXFbWPTkoxPJqJ0RiqyQvmBPdYuXMEwnjulfYU41mh7tE/t+o7Mt1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8d64TXzZmP; Thu, 21 Dec 2023 13:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhjj7079509; Thu, 21 Dec 2023 13:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhjru079506; Thu, 21 Dec 2023 13:43:45 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:45 GMT Message-Id: <202312211343.3BLDhjru079506@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: f63da9704585 - stable/13 - sysctl(8): Mention more security.bsd knobs; Refer to security(7) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f63da970458592f7488796da4e8c07f9e5314b31 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f63da970458592f7488796da4e8c07f9e5314b31 commit f63da970458592f7488796da4e8c07f9e5314b31 Author: Olivier Certner AuthorDate: 2023-08-17 23:54:49 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:39 +0000 sysctl(8): Mention more security.bsd knobs; Refer to security(7) Reviewed by: mhorne, pauamma_gundo.com, emaste Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D41113 (cherry picked from commit 8d7a48d367ffde2a29419ef943c4099984e3af4d) Approved by: markj (mentor) --- sbin/sysctl/sysctl.8 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index e404763c5003..11ed75270e28 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -27,7 +27,7 @@ .\" .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" -.Dd June 30, 2022 +.Dd August 18, 2023 .Dt SYSCTL 8 .Os .Sh NAME @@ -184,8 +184,10 @@ Please refer to for more information on which tunables are available and how to set them. .Pp The string and integer information is summarized below. -For a detailed description of these variable see -.Xr sysctl 3 . +For a detailed description of these variables see +.Xr sysctl 3 +and +.Xr security 7 . .Pp The changeable column indicates whether a process with appropriate privilege can change the value. @@ -222,6 +224,8 @@ String and integer values can be set using .It "kern.logsigexit integer yes" .It "security.bsd.suser_enabled integer yes" .It "security.bsd.see_other_uids integer yes" +.It "security.bsd.see_other_gids integer yes" +.It "security.bsd.see_jail_proc integer yes" .It "security.bsd.unprivileged_proc_debug integer yes" .It "security.bsd.unprivileged_read_msgbuf integer yes" .It "vm.loadavg struct no" @@ -311,6 +315,7 @@ option has been deprecated and is silently ignored. .Xr sysctl 3 , .Xr loader.conf 5 , .Xr sysctl.conf 5 , +.Xr security 7, .Xr loader 8 .Sh HISTORY A From nobody Thu Dec 21 13:43:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8g4k02z54pty; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8g1Y3vz4P2q; Thu, 21 Dec 2023 13:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/m5nWXpQ8vk/tsvr1K6HjPgD6wZbOeEidmXplB+V3A=; b=Dl5XqmxOpRoOrk42uDp/cOpLzwh1X7v7EyZneDQCz9QqUC1CkCqvT28W/Lrb4tDcONtkju 9nN06MaI5DLedb7nC60IFyZI+YHImS2hzgR98oaa3C+AMuB/0EpL+CEBTmMbvvJO39yQUL mNmbzuH93hayRecimpGIv6oStSiCGvc5oS9RHa7AwxO8fWLmN+nzi8u0Y1cWXbW2Rzu14x OogrrBlV4oGbNgHI/5wWxRXs+2GUTAFh8zy+pNjLVBfV10pkZUDiFlV7tBTw1Lj4hQytZd Ieyh6kUzuvpyFMTtV1RlK/nnRKRSPlyiqkcp6HKoRw7zxiK4cRu0lW+syJN2mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166227; a=rsa-sha256; cv=none; b=I5xDNFNiyumZ1SfPx9KMTGZ8PnbLdAlI+X3Cd7sh36zSsU3vMdnvhBajpIphPUiPWH/4Ho sZle0DYp6lreyb4ku0MU54eio2vMUtTKTX4L4Gq/OJFuXGQe613ViIEFLkIZ1YnRoeST8i ApQ7n+sVVq7chwGhpxSBpUJGpdlVzkVgCpUm7Ipn5x9HkQFlsX58jgGBdFNI1RUOKOsxsW GGxrvBZHigC29rQFV3S/ieoAdsr5RqZ5vF83qTVunIp41+yZfokHTXWbGNaREcUjeAgPGz oJ0T2oxAS2LM4VKW0xn1siS78n+xoIHp1uk+XTdZtQGzjf0Z+p9vPP+7203T1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/m5nWXpQ8vk/tsvr1K6HjPgD6wZbOeEidmXplB+V3A=; b=GZ3j1b9f3t6+Hp8w8cB2O79+qLf/G+PyiQLK1CqA/mqW87vESA8yqUtX/7TIsY/Fr8vpJB bEOORNxojU7ykAuMbXUcyK40ePXGa+AFocQ1vc1FoSOqZZcdCIlsbFAOBqQ+N0Pz0LKtlA A6c7csioWdzAJGwrKw6LbA5sOPwnuRcJ3cauw6PZeTG/FAvQ5IhWc9vKaNy4eiwb85uqh1 JNLpn07LgFbHz0HWCy8hgKq5AMZ0O/VFbMg93bqASXqPOgQxvtddnx/s2Hx/Ubqoc1H51h FL3PtELGC88nAiKkfWUZsh1sd3DEKk/U2OVSYjbFdeBbPHGiNCFKlft3O8oISQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8g0HSLzZmQ; Thu, 21 Dec 2023 13:43:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhksh079564; Thu, 21 Dec 2023 13:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhksw079561; Thu, 21 Dec 2023 13:43:46 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:46 GMT Message-Id: <202312211343.3BLDhksw079561@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: 831792fc07ca - stable/13 - setusercontext(): Fix gap when setting a realtime-class priority List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 831792fc07cadd1aa3bc404843f45b8c2982b1bf Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=831792fc07cadd1aa3bc404843f45b8c2982b1bf commit 831792fc07cadd1aa3bc404843f45b8c2982b1bf Author: Olivier Certner AuthorDate: 2023-05-25 07:10:27 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:46 +0000 setusercontext(): Fix gap when setting a realtime-class priority The login.conf's "priority" capability allows to set priorities in the idle or realtime classes in addition to the classical nice values (-20 to 20), through a natural extension where values greater than 20 put the processes in the idle class (with priority adjusted within RTP_PRIO_MIN and RTP_PRIO_MAX, 21 being converted to 0, 22 to 1, etc.) and values lower than -20 put the process in the realtime class (with priority adjusted within RTP_PRIO_MIN and RTP_PRIO_MAX, -21 being converted to RTP_PRIO_MAX (31), -22 to 30, etc.). Before this fix, in the latter case (realtime class), -21 was converted to 30, and RTP_PRIO_MAX (31) could never be specified. While here, change the priority computation for the idle-class case to be symmetrical and use RTP_PRIO_MIN (in practice, this changes nothing at all, since RTP_PRIO_MIN is 0; but this is the correct theoretical formula, which would work as well with other values of RTP_PRIO_MIN). PR: 271727 Reviewed by: imp, kib Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40339 (cherry picked from commit bd572be78436473a2ad4c1b78728b739c74ef238) Approved by: markj (mentor) --- lib/libutil/login_class.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index f561479690c1..90a3ec5d106a 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -452,7 +452,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in if (p > PRIO_MAX) { rtp.type = RTP_PRIO_IDLE; - p -= PRIO_MAX + 1; + p += RTP_PRIO_MIN - (PRIO_MAX + 1); rtp.prio = p > RTP_PRIO_MAX ? RTP_PRIO_MAX : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", @@ -460,7 +460,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; - p -= PRIO_MIN - RTP_PRIO_MAX; + p += RTP_PRIO_MAX - (PRIO_MIN - 1); rtp.prio = p < RTP_PRIO_MIN ? RTP_PRIO_MIN : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", From nobody Thu Dec 21 13:43:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8h421Cz54pZZ; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8h2Wz7z4Nv8; Thu, 21 Dec 2023 13: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=1703166228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXnjtu7A64q7FVmJNhyulKJObsXH2WnMqvEUbGT1nh8=; b=kUU88HLqka4rME/AvWaEQmaKiC781IXAgTyHmyJEEj6fYGStrLdGlyYPzuR+Fc+hc5vYPl Rw4HBs8L5Tlyr8dSTyaUrbxuFIBWBd53UpYpINYI7JZ4fii3v86ra3FBf8FnwSDWfaiFJA 9/JTo8NKYlfdGOhob7jpHHrbJQA5CBHg5+UaK3V6hWnSU5GT7OCIEFzNsJJMMwYPBBxdlY QVbGIoA+JwOa2Ib837rx0AiD1zRLp55uHrtf8DsQwV4Bc/xJ8EsxzTWIeKlIu+kXJYBg5b 0Vs2XJAKFkyS0ibnzA6/wJynpBouSJRKdQW2/+t1cTwF3tTGA5TBJhyKkatHdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166228; a=rsa-sha256; cv=none; b=WLg200vsYOLBg4omw8UOBrwUAZmEJH2HYJ5tOKiG9mIWg3zIMYGHkTCaTD/oHLRcYSbGN4 4Cc48Z9GPxJfy6iaOj9Tj8faNg8hf3dufRgB7oDFDOGcY/oyPnnNoEonPkgzJDmCh8IcnG bo9poTrzcHlrlXZA+G621u6e76njwVkkZgvE3VuG9igxse3lU+CzuXpUBcfhos/Sn8VozO XwxswLBxIbkw7ghNuiygiHJTI8N5vuT83ODCwVpe0Se//gKnbLx6pwsPIxjA9iu2vuOaLc 9HxI9GYGGhBldZHF8xoNlOEl2OmHWxbjxi9Zuvc5PxpSfEekjlLTW64vIyeI5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oXnjtu7A64q7FVmJNhyulKJObsXH2WnMqvEUbGT1nh8=; b=P0GX0CekAIUBsmhOaDkMP3PHk+1PdiHxRSohvsIa6PhVmlG91DWfHbB0kNe/bEI3oJl0sm X61poLmpaF48ovfGEZNWzLmzsbyuNAWN7vTaLR9Rp6DWUiazOIIv/pBeZvJjR0FE699EaC R7OSKhyNdxW0xipBhVilWNcWDJ/2YVPDQ1RTqAsn1igdWgNp6Bv5P6HIsMrSkK8YR8Cb/V 9XEM4nQKVfPjSxJpy8pv9MiIDzsultts5gcrS8odz/nsH2i3p+XqD/dymi7/Plioh7lqsQ 1jVh/LVUymETp9LzBTu0gT6VE9bl9T8OudYLnlfdWM1SFTDH2t+cAfMnLkU60Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8h1bM3zZmR; Thu, 21 Dec 2023 13:43:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhm3S079621; Thu, 21 Dec 2023 13:43:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhmB1079618; Thu, 21 Dec 2023 13:43:48 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:48 GMT Message-Id: <202312211343.3BLDhmB1079618@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: 6983b8c39ff3 - stable/13 - login_cap.c: Don't set errno to ERANGE on memory allocation failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6983b8c39ff36b3a4c1090b5cca97d450dca7b34 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6983b8c39ff36b3a4c1090b5cca97d450dca7b34 commit 6983b8c39ff36b3a4c1090b5cca97d450dca7b34 Author: Olivier Certner AuthorDate: 2023-05-25 11:48:40 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:38:54 +0000 login_cap.c: Don't set errno to ERANGE on memory allocation failure Modified functions: login_getcaptime(), login_getcapnum(), login_getcapsize(). They all call cgetstr(), which returns -2 on such conditions and already sets errno to ENOMEM, arguably the appropriate value for these functions as well. No in-tree consumer currently checks for errno on error reported by these functions, so this change has no other code impact. Reviewed by: kib Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40342 (cherry picked from commit b8c1aadef9d80786daf731300c33d3a001261422) Approved by: markj (mentor) --- lib/libutil/login_cap.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index dd7bcefabea6..2b19218a8aaa 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -653,10 +653,8 @@ login_getcaptime(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error) if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1) return def; - else if (r < 0) { - errno = ERANGE; + else if (r < 0) return error; - } /* "inf" and "infinity" are special cases */ if (isinfinite(res)) @@ -738,19 +736,18 @@ login_getcapnum(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error) /* * For BSDI compatibility, try for the tag= first */ - if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1) { + r = cgetstr(lc->lc_cap, cap, &res); + if (r == -1) { long lval; /* string capability not present, so try for tag# as numeric */ if ((r = cgetnum(lc->lc_cap, cap, &lval)) == -1) return def; /* Not there, so return default */ - else if (r >= 0) + else if (r < 0) + return error; + else return (rlim_t)lval; - } - - if (r < 0) { - errno = ERANGE; + } else if (r < 0) return error; - } if (isinfinite(res)) return RLIM_INFINITY; @@ -789,10 +786,8 @@ login_getcapsize(login_cap_t *lc, const char *cap, rlim_t def, rlim_t error) if ((r = cgetstr(lc->lc_cap, cap, &res)) == -1) return def; - else if (r < 0) { - errno = ERANGE; + else if (r < 0) return error; - } if (isinfinite(res)) return RLIM_INFINITY; From nobody Thu Dec 21 13:43:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8j73pkz54px9; Thu, 21 Dec 2023 13: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8j4Dq3z4NxS; Thu, 21 Dec 2023 13: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=1703166229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwzrBFcrRbljMUCEwpq0s15BkVBOjodAkkPd99nm9e4=; b=qWD2TUF96/E99Z4WUfhQD9KqyihYfMY4/CkylKd0m4OrmlgzfJ4p4WWcUZEH1oT5JGMQK/ vRYAKiO/TJC+qaaaNbC18g3sphPdLgT6DGc5yoM+AoNY1bG/HCZr7FzGjuwn2NtZNHQdMG OG78ajCkJBLeeGuiknpv+6qKMzE85OPWwE7ZaAM4ydusn+dw4N6jrMnAJrHEFlumwio0+o wwGvtLclGVTYYfjZx7wBM2ozuH4dzEd9iCjLSjbUmvBOCAU2gzMiTow1qGa5fasfwEjKMb 2Gec/Fx32ONfvPDPxb3h0kBnZ797o0EBIDI8WahpB97aOl2xeCjfvVsm5VlLQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166229; a=rsa-sha256; cv=none; b=rfg0dNfcyY9bnu44/KY7Ts4y7VCyjK439SrA7zgjxeeMgK6+KArU0+gsc7wq+ceLn/1APd ZFyn0vfY0fMCSiIOiA53WW7/sQ81ER0zhIgLK9rWHGFBwtUFwdmBWzFgNwrI6fHjOJOa28 VruW16Q6BRo9vvuNA4rBEDvF2uA7p5sfvxn1VJKfh+XFFNuhIYE7hnz8j8XTnU6rq5Kh11 RA2fS34xssAdJ3EaNIMSaPuv9LyOTrC4A/HOPjsDavb2I1VCbRJP9yGQ9VXcU9nfsSWmkn c00q5a9uUpixn20eW72nzCpIKndwg3EqfYV9+cxGPRbWrSfXWfvgNHwqnWvgEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GwzrBFcrRbljMUCEwpq0s15BkVBOjodAkkPd99nm9e4=; b=J5qM2uePnS2uD7AJ45jo62g6TsFZ9dvybu6dX6JcfHjk7la1HmglT7pp3Qqpl/cAKQAwG1 yL7f7h00NFsoh4s+MuSxEVDZXBwTAE/VS9qD8cDBk0Kbt1lsE1fGMRCp+7HzjLQY/Z3U+I YlLxC/RRQx+aQyPzXMdLlmPxe3OTn06x/h+9b6fPanC0rrQr8Zj1jJuSViZQHepX5sBFZR oSUA+a39UgOGd6930l8WUuV6/F3pt9UWlS1wdlVEqT6FraLoPBvb9nFRkyoLScXaNXbmMx gGvGjdSxzY4+sVIrErLgP0IBv+gsMiQmbci4jTGvjk97rwEj6bi+yQHlsbNKGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8j2qcczZRV; Thu, 21 Dec 2023 13:43:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhncF079681; Thu, 21 Dec 2023 13:43:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhnYl079678; Thu, 21 Dec 2023 13:43:49 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:49 GMT Message-Id: <202312211343.3BLDhnYl079678@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: 9fcf54d3750e - stable/13 - setusercontext(): Apply personal settings only on matching effective UID List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9fcf54d3750e379868e51e4aa7fbf696877ab2ed Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9fcf54d3750e379868e51e4aa7fbf696877ab2ed commit 9fcf54d3750e379868e51e4aa7fbf696877ab2ed Author: Olivier Certner AuthorDate: 2023-05-30 16:35:08 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:03 +0000 setusercontext(): Apply personal settings only on matching effective UID Commit 35305a8dc114 (r211393) added a check on whether 'uid' was equal to getuid() before calling setlogincontext(). Doing so still allows a setuid program to apply resource limits and priorities specified in a user-controlled configuration file ('~/.login_conf') where a non-setuid program could not. Plug the hole by checking instead that the process' effective UID is the target one (which is likely what was meant in the initial commit). PR: 271750 Reviewed by: kib, des Sponsored by: Kumacom SAS Differential Revision: https://reviews.freebsd.org/D40351 (cherry picked from commit 892654fe9b5a9115815c30a423b8db47185aebbd) Approved by: markj (mentor) --- lib/libutil/login_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 90a3ec5d106a..1036e9f9208c 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -546,7 +546,7 @@ setusercontext(login_cap_t *lc, const struct passwd *pwd, uid_t uid, unsigned in /* * Now, we repeat some of the above for the user's private entries */ - if (getuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { + if (geteuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { mymask = setlogincontext(lc, pwd, mymask, flags); login_close(lc); } From nobody Thu Dec 21 13:43:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8k71ZBz54pry; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8k4gjCz4P13; Thu, 21 Dec 2023 13:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=joowXEK13rKkqh08w4CnM4/yUtFa+fywlaqxsnvu1Ds=; b=emzJcwTflIDTiPzAllSZanaUpzNgyVMgMewiPjsD+0bTwRfTAHdS5tGWwofXcEDZdyqM94 XhF0kp+TpcivGFcZG8AjHdpYzXIhTdxC9J7/3Qj7M/43lyyf5dyRyqmvADmkaXwUtewObK Pgr4hsvG6KXVXTjZVOuqrZaUt1uyslurOlPfrw+JcTUbIQ9GUM5c5YkoIYTpjTcrhGLAaN CCbG8Zt4JFgFiVLozZ6rfXN8KJtwva7iQSpKGxAuNlIEXvKtKqY9PGWNaNtNrz7A6ko7KW L309OFVYu7dTiv9QkKSJRlUeqebl9VTm5NUJGY5ritqHOZj7VVYEWCeJqNIJIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166230; a=rsa-sha256; cv=none; b=lDc2Ed9Sm+Vpqk8i3LF0z0FoltSQRih8i9IYr7NC443V4bc59JifTvEOCQnanTKCV198nu JUGK+OpFIMpl7uxect82u1LeNoO3AToYq/zdqxfAJ/ZO7N9JYwuO4E9Eo9Kb2xRGs3EgED o+eEC5G8hilMNj/ikGnpONJ+l4G5DksbTLGONOilEsxeVCTDJxHcSIhXe6zQ9h+ux9uKwh 9ml2hMXuHdW2Ts//DpQ7E8z7pak6HdMduQAovCa6R030K9uIvj0x69LrQ2cjR9OrOE/0rH /+9FgkK5uBISpKhZz7jAxaJ9lh1TdPTRURhfNBy6hgprX57t8Wr457sxGhmkjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=joowXEK13rKkqh08w4CnM4/yUtFa+fywlaqxsnvu1Ds=; b=rujSsMIYXVkgSyu+3giTONjpF152Gbea7A0K3T0LykgY+Rq/oPtsMfwB+HUWm9JQ/TxY4v 6lUrv4CzyxUoNxuJyrRna4fKYA6pu3JDYUccx1d//Oweiw/MSiw6d4UnEl/hpMd199Wxph K0HJ8PJMcRbL03mpb1RBGhFV/iaO/YdeygYPjpl7s5wwBO5u7dr8e4Oc17hRY5zvfpgp/x SpKeqywFPvsMO2JKStO98/6PxZHMlivkGIcapX8bXrh6W3cDgRYeyH5lU7f8izie5gDvvw s/mDyJ86ctC085aTHsEOSD9yOZivEkho6YW6FpYwMbnIk/pQvO9bJG3Vw3Jb7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8k3mflzZRW; Thu, 21 Dec 2023 13:43:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhodg079717; Thu, 21 Dec 2023 13:43:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhoR7079714; Thu, 21 Dec 2023 13:43:50 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:50 GMT Message-Id: <202312211343.3BLDhoR7079714@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: a10630ef818f - stable/13 - pdinit(): Fix 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: a10630ef818f05ada0c52f7f0cd35d8036052c5a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a10630ef818f05ada0c52f7f0cd35d8036052c5a commit a10630ef818f05ada0c52f7f0cd35d8036052c5a Author: Olivier Certner AuthorDate: 2023-09-26 10:26:46 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:11 +0000 pdinit(): Fix comment Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42256 (cherry picked from commit 56bb3ce091371ffd95711c65e1eff306a19435e2) Approved by: markj (mentor) --- sys/kern/kern_descrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index de6bfe8bc1ae..0bd011ac2425 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2255,7 +2255,7 @@ fdinit(struct filedesc *fdp, bool prepfiles, int *lastfile) * Build a pwddesc structure from another. * Copy the current, root, and jail root vnode references. * - * If pdp is not NULL, return with it shared locked. + * If pdp is not NULL and keeplock is true, return with it (exclusively) locked. */ struct pwddesc * pdinit(struct pwddesc *pdp, bool keeplock) From nobody Thu Dec 21 13:43:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8m0Sxqz54pZg; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8l68bqz4P3p; Thu, 21 Dec 2023 13:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9rkVRlJQMtwi9lF4hmZpbfebS3gnbTclqKWJVskU2XM=; b=c2yJO51t0CptJyWdDGDi3LGmyTQbN//55OOt385fnIDV+SyD2FIB0BHAomohX74fsWdiVf 7oh8CQE5F5+z54eJrApgGPDGeYCTb6Q3rkndJ7YgmtdtVqT7eXddsLO1mrzxh/SAZ/5E4Q BNvb+zGt0+ijunqFOO0Jzo4Ydle000oqeUTsfEJURKUBt80mVUhHVlKtjKzvbNAyedx2PW I15U9+MtLUg5+VJNkRHe1iXa26JEehEuvHnAWdFqbB1cj3QrgF3zE/7/bSzvfOfWcWCDbK cor4BbwbnoqN4sccFgnSWabI+atu8YMx9/cxwAhusIKMaSCRThGvXCw5NWUY1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166231; a=rsa-sha256; cv=none; b=VIsKkAGzK83NXmZBmGPmN0wWjAXQ74+qogTbpHopnRSQtW+XqRjs9Yrey8U+aQJEE2DSUt 9/l3XaV3lDStBQV+TOC9L4WrjPErEtZMEiFk+SjgUKt2JBPzgjaNu45uzazl7pqa9PxPlt xHxC/olU3q1Z0MhlJ21kPeWnSuqrKR5TI6MdPyNZR3kFaxcXcXs1vrHhwZIWN35HVQiq67 F69GkU3154cc4HWB5fVpgKiW8Xz775o/k4SCBEWXduIOkXfrl6ODWe2HMhHk1Am297p4mC aeotX5ulBjk13y2MEykDz59frr/GV6pH0bEwZMePoKtml7aeJBiqoZU0wt3X/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9rkVRlJQMtwi9lF4hmZpbfebS3gnbTclqKWJVskU2XM=; b=m13KLrio5deTUwWOFyWfIfv6A9NAksRk6jWqAKq0rWF32k/pIPi5WiXJQLDSaijTGjJH+F Lvg7kldueT9QIgkHSmkZw8GjJ0mrUIgRmLyTqFtVIjxQGDqy1CuBiMVd+jXT04r4THBNiG iDdJiV0AgmHW2dpYa4CfJa3fbH4yz7kmruDg7GhyFCtp8snzMMF7VEdcDgX78SlfdMyASm vCLTexXwnp+6zOYfER3+ZGuS2lVe1YNYOw7o17Wm1Wg4hAxeXaEiXnJhM3ceIhvbc6n6Rb 6nN92EpKCgax6rDDHCRUUnC6IGklD7V83Sh3vDHLjihtD8sjgGehAxiy8a6O3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8l54t2zZdJ; Thu, 21 Dec 2023 13:43:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhpLj079768; Thu, 21 Dec 2023 13:43:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhpx8079765; Thu, 21 Dec 2023 13:43:51 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:51 GMT Message-Id: <202312211343.3BLDhpx8079765@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: 037c104ca4a7 - stable/13 - Ensure "init" (PID 1) also executes userret() initially List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 037c104ca4a71b7510799c6fff5fa031c070319f Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=037c104ca4a71b7510799c6fff5fa031c070319f commit 037c104ca4a71b7510799c6fff5fa031c070319f Author: Olivier Certner AuthorDate: 2023-10-10 17:36:20 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:18 +0000 Ensure "init" (PID 1) also executes userret() initially Calling userret() from fork_return() misses the first return to userspace of the "init" (PID 1) process. The latter is indeed created by fork1() followed by a call to cpu_fork_kthread_handler() call that replaces fork_return() by start_init() as the function to execute after fork. A new process' initial return to userspace in the end always happens through returning from fork_exit(), so move userret() there instead to fix the omission. This problem was discovered as part of a revamp of scheduling priorities that lead to experimenting with asserting and sometimes resetting priorities in sched_userret(), in the course of which the author stumbled on panics being triggered only in init() or only in other processes, depending on the modifications to sched_userret(). This change currently has no practical effect but will have some in the near future. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42257 (cherry picked from commit eac624207ccf3a16225368d226861b06e3631d0d) Approved by: markj (mentor) --- sys/kern/kern_fork.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 59ffcce70966..114eeeb2a943 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1161,9 +1161,15 @@ fork_exit(void (*callout)(void *, struct trapframe *), void *arg, } mtx_assert(&Giant, MA_NOTOWNED); + /* + * Now going to return to userland. + */ + if (p->p_sysent->sv_schedtail != NULL) (p->p_sysent->sv_schedtail)(td); td->td_pflags &= ~TDP_FORKING; + + userret(td, frame); } /* @@ -1214,8 +1220,6 @@ fork_return(struct thread *td, struct trapframe *frame) if (!prison_isalive(td->td_ucred->cr_prison)) exit1(td, 0, SIGKILL); - userret(td, frame); - #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) ktrsysret(td->td_sa.code, 0, 0); From nobody Thu Dec 21 13:43:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8n3nPvz54pZk; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8n0T57z4P44; Thu, 21 Dec 2023 13:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmTFiowc03Q8tJJk2QidWtshYZtP6b0WxCqho8gsrNs=; b=xxEXePt/ZZYpQ3C3BJGehSy3yXxhUMIsJ1pkcy6wqNe68SPzu53b4Mf63TeZKmc7Fjo3eU QMtBktWNR4TgG3XWtdvNZFuN1EGIzuYjnpCPM8LQ9FH7UOwQMF8eZEhtQayrnnG7FZ5Klm zO/y6pEY4CVFjusi/ASxPNLPh+NZL7wA4SY9JMZ4WLh9V7xUSNpcZHayiPZFBVhOLex3C5 8X3tddch7X1GJoMU78j6hJVlgW/FumuwdxnsqXtllH42Bo5IM8ShcwKgLp/EzljbB3FUZ9 KgTqGLyFYKmaQCCAm43OylclihLyF+j8W/ljv/GE1idEFg/uiiX6pUSW5yUBRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166233; a=rsa-sha256; cv=none; b=K/t9EoqqFzKKUmKRgKfAKBBt/6aorUBSjMbWzQKujL/PSlF5/8n9hhbQHmr+qDBt/hZez9 tYiUCGO7uAvY5+ickuyKaikMZnm4oGTnchdpJaU5tPXwTK6f4a4eeb5JPJPfBYyArkCm1t DBYWDt1hljtssgjL7TmUDTfIYgsqKiPYh20lG3XM+BQEF39BmoMF33qJiCNieLpeJwJScb WrPcxcZx9yrnZCHKEhho58gxGJSwfbSJcYH2uBjWcpHlFExQe/SDFeI5Y7DN5gqL/i3MGp HTKMHubVp0IejG2Xx3SRx5n9/V9q66MJoOVQBUiXiZyqsQ0UETqIM5hgZgKBUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmTFiowc03Q8tJJk2QidWtshYZtP6b0WxCqho8gsrNs=; b=W63muFoLNag6OjnKymuDVKDiowVsCBB8BfN7vo1PxG2vYblg0ALecm0pah11B69cP2LlGl a2h/KhEb7na5bplxyW+hvy/IRDjVKDfCsAROzfODd+ai6mX4wKoRwzzDFFAgUa7YmAH7gr VIS9irHNiFkhXTh4QyC2i4zaoyIF3zxHAfiAJGPl1cTvWcevjBnO78pkcJ64Zl+yphFHy7 4JVy3QKY2092lvz09Wk3MqctkfrTlhjInCfFjJ3y+9UwNOfG+JXHQ8aR4K1syqAEF6pzjs OH3BEqb+PY43T0+3I2FmWc6Vy9IrmV45zeGVQR2piWixY7/Qqsy/exsVftrqUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8m6hKNzZRX; Thu, 21 Dec 2023 13:43:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhqUG079813; Thu, 21 Dec 2023 13:43:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhqb6079810; Thu, 21 Dec 2023 13:43:52 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:52 GMT Message-Id: <202312211343.3BLDhqb6079810@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: 56c53cc8fb3e - stable/13 - uma: Hide 'uma_align_cache'; Create/rename accessors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 56c53cc8fb3edaed82678440da5cf8e0dc482d03 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=56c53cc8fb3edaed82678440da5cf8e0dc482d03 commit 56c53cc8fb3edaed82678440da5cf8e0dc482d03 Author: Olivier Certner AuthorDate: 2023-10-13 09:52:28 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:26 +0000 uma: Hide 'uma_align_cache'; Create/rename accessors Create the uma_get_cache_align_mask() accessor and put it in a separate private header so as to minimize namespace pollution in header/source files that need only this function and not the whole 'uma.h' header. Make sure the accessors have '_mask' as a suffix, so that callers are aware that the real alignment is the power of two that is the mask plus one. Rename the stem to something more explicit. Rename uma_set_cache_align_mask()'s single parameter to 'mask'. Hide 'uma_align_cache' to ensure that it cannot be set in any other way then by a call to uma_set_cache_align_mask(), which will perform sanity checks in a further commit. While here, rename it to 'uma_cache_align_mask'. This is also in preparation for some further changes, such as improving the sanity checks, eliminating internal resolving of UMA_ALIGN_CACHE and changing the type of the 'uma_cache_align_mask' variable. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42258 (cherry picked from commit dc8f7692fd1de628814f4eaf4a233dccf4c92199) Approved by: markj (mentor) --- sys/arm/arm/cpufunc.c | 2 +- .../linuxkpi/common/include/linux/dma-mapping.h | 4 +-- sys/vm/uma.h | 6 ++-- sys/vm/uma_align_mask.h | 36 ++++++++++++++++++++++ sys/vm/uma_core.c | 18 ++++++++--- 5 files changed, 56 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c index 32b3d2f869c9..f2845eb80f3b 100644 --- a/sys/arm/arm/cpufunc.c +++ b/sys/arm/arm/cpufunc.c @@ -254,7 +254,7 @@ set_cpufuncs(void) panic("No support for this CPU type (%08x) in kernel", cputype); return(ARCHITECTURE_NOT_PRESENT); out: - uma_set_align(arm_dcache_align_mask); + uma_set_cache_align_mask(arm_dcache_align_mask); return (0); } diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 4a53b7675302..fb63a45ac307 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -350,8 +351,7 @@ dma_max_mapping_size(struct device *dev) #define dma_unmap_len(p, name) ((p)->name) #define dma_unmap_len_set(p, name, v) (((p)->name) = (v)) -extern int uma_align_cache; -#define dma_get_cache_alignment() uma_align_cache +#define dma_get_cache_alignment() uma_get_cache_align_mask() static inline int diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 954d64c4d63b..4225bd83ba23 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -470,12 +470,14 @@ void uma_zone_reclaim_domain(uma_zone_t, int req, int domain); * alignment. Should be called by MD boot code prior to starting VM/UMA. * * Arguments: - * align The alignment mask + * mask The alignment mask * * Returns: * Nothing */ -void uma_set_align(int align); +void uma_set_cache_align_mask(int mask); + +#include /* * Set a reserved number of items to hold for M_USE_RESERVE allocations. All diff --git a/sys/vm/uma_align_mask.h b/sys/vm/uma_align_mask.h new file mode 100644 index 000000000000..666633350b9d --- /dev/null +++ b/sys/vm/uma_align_mask.h @@ -0,0 +1,36 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Olivier Certner + * at Kumacom SAS under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _VM_UMA_ALIGN_MASK_H_ +#define _VM_UMA_ALIGN_MASK_H_ + +int uma_get_cache_align_mask(void) __pure; + +#endif /* !_VM_UMA_ALIGN_MASK_H_ */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 679fd5ef1187..506bc63033ba 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -149,7 +149,7 @@ static uma_zone_t slabzones[2]; static uma_zone_t hashzone; /* The boot-time adjusted value for cache line alignment. */ -int uma_align_cache = 64 - 1; +static int uma_cache_align_mask = 64 - 1; static MALLOC_DEFINE(M_UMAHASH, "UMAHash", "UMA Hash Buckets"); static MALLOC_DEFINE(M_UMA, "UMA", "UMA Misc"); @@ -3182,7 +3182,7 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, args.size = size; args.uminit = uminit; args.fini = fini; - args.align = (align == UMA_ALIGN_CACHE) ? uma_align_cache : align; + args.align = (align == UMA_ALIGN_CACHE) ? uma_cache_align_mask : align; args.flags = flags; args.zone = zone; return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); @@ -3191,11 +3191,19 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, /* Public functions */ /* See uma.h */ void -uma_set_align(int align) +uma_set_cache_align_mask(int mask) { - if (align != UMA_ALIGN_CACHE) - uma_align_cache = align; + if (mask >= 0) + /* UMA_ALIGN_CACHE is also not permitted here. */ + uma_cache_align_mask = mask; +} + +/* Returns the alignment mask to use to request cache alignment. */ +int +uma_get_cache_align_mask(void) +{ + return (uma_cache_align_mask); } /* See uma.h */ From nobody Thu Dec 21 13:43:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8q4QlYz54pg5; Thu, 21 Dec 2023 13:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8q2qB2z4P8G; Thu, 21 Dec 2023 13:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rX0nnBeO3OgmMkgPX40lyUYRO6MG2WHjn9qFQKKBJF4=; b=GJiGN6FmUPSEc1pHYi2ViFEAeFeIL6VInOMfMDmjDdIDgCR7FvkrUzTXN36DSXvzHpSmSz nSHJH0jkwqSLsqVqmMqVJgKp7W0osIx/yR6FSt0P5Ln7SIqJPavyne9r8qyCoHvneOXP+s h2DCE7jROHlyuEvrkPz5iiWzhj6GuwkGK1DS4I3f4KQoegtA32O8X4NrQ3oH0OynAoENdw DQm/nZI39Iyue4FWadJ98gH4J+a+r6g9Ye80lYGuYE0AhhKkGIBWsDKI/O37AwdNJZ8MTc AHfcxjXa4j01oIHzVPix5hRzDWxb9rPVUl+d5CnjpHRXx+/PXLKP7vFHxd0uew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166235; a=rsa-sha256; cv=none; b=VzuvHgY5hxxiqZsXNpqkdaxfeg6HNiQqtwklmrYuz2/biwyvKZzHlLYpm+LEl7u+SiswXI Zf0ghnt67rk99JfX1RLsZexaZ8/4FbnP3ZMuSyOz+dHnbw5ZoiJMrw6kSS9xXAl1APeMdK k5AZDbnDjU2qwdyeaPKdtGtIdrLcTjAsKtuR06Gpqu7EZClYXrASzuQ+SNlwv+8HvW4wGC 68JrJgcUQ3eB9PZbModZl/oRdtG60TqPeAhZPoYQJajt8bAygwP2EcM0V/Bwe53snsJFBC 7c3kLMCuPZ5lBZaX/O0SYNjRuq53D9GUu0LXkokT+AQxRzsxcvHhxX8u9b6bhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rX0nnBeO3OgmMkgPX40lyUYRO6MG2WHjn9qFQKKBJF4=; b=paHVRMBRuz988BMNpPA9wAmgXgfkPb2CIPIjuxseJmYSKVr4i+Rc9vaqI2/bBpb06GbwND az6p+2KcPSg6J3T33PR4XiOZViPaNsYfuR3SQPgudwoI14ZC9C1LL5b2QqI1ZUHnNTDIdz Q3WEqubbU6NJV4g5zk+oJTyBWjZE+C6DhKs7wFSxuoC3C8cOrcMxAWqfjohChFl8biTJZ3 oSkelkYMcSd7g450YvVH5bxwkYXxpOPnMN4GMOm7/yB3VQoD9rmoktrIKg0i90mmQAuOHW EUVJpG7fPA8iVKN9MH8IhZ6thTu7f3R9C7Z1LrIkbcKKqKbb2lNey31eH9wBmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8q1wGkzb4L; Thu, 21 Dec 2023 13:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhtKR079909; Thu, 21 Dec 2023 13:43:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhtlO079906; Thu, 21 Dec 2023 13:43:55 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:55 GMT Message-Id: <202312211343.3BLDhtlO079906@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: f056e19abe20 - stable/13 - arm: Simplify get_cachetype_cp15() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f056e19abe20d14234e24d927a847ea6e2a90c42 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f056e19abe20d14234e24d927a847ea6e2a90c42 commit f056e19abe20d14234e24d927a847ea6e2a90c42 Author: Olivier Certner AuthorDate: 2023-10-13 12:22:14 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:43 +0000 arm: Simplify get_cachetype_cp15() There's no point in setting 'arm_dcache_align_mask' before the function's end. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42261 (cherry picked from commit 1bce6f951a902f03bfb354f5b11473a0d12b3d7d) Approved by: markj (mentor) --- sys/arm/arm/cpufunc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c index f2845eb80f3b..42f718b9773e 100644 --- a/sys/arm/arm/cpufunc.c +++ b/sys/arm/arm/cpufunc.c @@ -172,7 +172,6 @@ get_cachetype_cp15(void) : "=r" (csize)); arm_dcache_align = 1 << (CPUV7_CT_xSIZE_LEN(csize) + 4); - arm_dcache_align_mask = arm_dcache_align - 1; } if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { sel = (i << 1) | 1; @@ -195,10 +194,10 @@ get_cachetype_cp15(void) if (dsize & CPU_CT_xSIZE_M) arm_dcache_align = 0; /* not present */ } - - out: - arm_dcache_align_mask = arm_dcache_align - 1; } + +out: + arm_dcache_align_mask = arm_dcache_align - 1; } /* From nobody Thu Dec 21 13:43:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8p3j64z54pv6; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8p1XxGz4P4S; Thu, 21 Dec 2023 13:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BCd5NBIlPMmd8a7yaEOMztSJRO27nPtJb2jysDCuBk0=; b=uSwaqpgSA2iQCLYa3yOo4d3SiKl6Q/lblUwko0KHly65d0VxkQmQXNy3HW3j2ai+ER1TGb pNLNvDPrQf7dxk6B8ziCC0bv/a+I8+c57suTbSbvY6znml7UvJoSbfaL7uo2TakbgHgOqm 5b6X2sNDI3CQ459987EHTq1fUqmoD9epEAUmLmixbYPxXgekBoxhdTUk5pEBftArmQSSJJ O9v2/Vf9248r9OfG4zt0bwJtCyYQBkGwhiuUZc7zmpMer3mtpYJA/FxHmUUhGsWui6e24z 94l9EUTIXbVwezGIRwNV3n95DT/HnQ2xss6TgqrW0L1dnlOg8ZNisGYL7QZdhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166234; a=rsa-sha256; cv=none; b=E1+aa/7X+6T75n3H04vKVKEx4mqm2E6X0ocJEfdgkvjKqCqq0JBxKSq5mSDApya5Ahq16M ng3D4d9Z+kdRWxWetRpYaI3hTheUctEBxEerqfs/qkf88ksqNtK/k+Dd1I3r+WPISnZND+ Hi7pO5m1EpCR9+uwoKEqhqD30tc0cBFNYprrqYXuxLwjmbfB1KOy9fQW7ce5rIqbP9T8GL bUdXCtIPyioy83WuF3xyFhI1LDJ1wD/RvofaWz3DbayK/Xth10qNi8sENfjxd3Cfn7CXua KFlu1VVKpQEXD7HddINisKLNAFms3+v2j+kQB5T9nicyFR4sjZHEeZLVrCBQ8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BCd5NBIlPMmd8a7yaEOMztSJRO27nPtJb2jysDCuBk0=; b=Mbikiz1dyj6iVfIXx+XFWrQxluar/PJB2/enA+8J877qeQTTol2/sUPaYDcZaT8lbB50u/ M3ScRRfLdIqNhsncSyUMLYwQkfpcYbC6Y+IlzS1pgGBLWwI1lXAHW44KnNCNUZ9B66rkDd X4GN2a00Atw6YXod3nqd/jV0K5OVXvOnD0fThG/tOjgmSecfD5vGxXXsNMDs/NtLo/wi70 YKXk0CbFR8EZEAgCzWUqKm2FZdUaiXd/IZlmzE4/NtIqwZDqdmWlPL0KEO4ucYyEF9Pcg3 nZWa7lk+zj0KTFCChDzGytEq6Ps5l6/SjRzbcvZZQWomN/ekv73h1gagWLAfAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8p0dz4zZfw; Thu, 21 Dec 2023 13:43:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhr2f079869; Thu, 21 Dec 2023 13:43:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhrWX079866; Thu, 21 Dec 2023 13:43:53 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:53 GMT Message-Id: <202312211343.3BLDhrWX079866@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: 4e00940e9f1f - stable/13 - uma: UMA_ALIGN_CACHE: Resolve the proper value at use point List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 4e00940e9f1f7dc1210a094d916ef930ff447e4a Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=4e00940e9f1f7dc1210a094d916ef930ff447e4a commit 4e00940e9f1f7dc1210a094d916ef930ff447e4a Author: Olivier Certner AuthorDate: 2023-10-13 12:13:30 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:34 +0000 uma: UMA_ALIGN_CACHE: Resolve the proper value at use point Having a special value of -1 that is resolved internally to 'uma_align_cache' provides no significant advantages and prevents changing that variable to an unsigned type, which is natural for an alignment mask. So suppress it and replace its use with a call to uma_get_align_mask(). The small overhead of the added function call is irrelevant since UMA_ALIGN_CACHE is only used when creating new zones, which is not performance critical. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42259 (cherry picked from commit e557eafe7233f8231c1f5f5b098e4bab8e818645) Approved by: markj (mentor) --- sys/vm/uma.h | 2 +- sys/vm/uma_core.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 4225bd83ba23..c748a7843374 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -301,7 +301,7 @@ uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, #define UMA_ALIGN_INT (sizeof(int) - 1) /* "" int */ #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ -#define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ +#define UMA_ALIGN_CACHE (uma_get_cache_align_mask()) /* Cache line size align */ #define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ #define UMA_ANYDOMAIN -1 /* Special value for domain search. */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 506bc63033ba..19ea5433559d 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3182,7 +3182,7 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, args.size = size; args.uminit = uminit; args.fini = fini; - args.align = (align == UMA_ALIGN_CACHE) ? uma_cache_align_mask : align; + args.align = align; args.flags = flags; args.zone = zone; return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); @@ -3195,7 +3195,6 @@ uma_set_cache_align_mask(int mask) { if (mask >= 0) - /* UMA_ALIGN_CACHE is also not permitted here. */ uma_cache_align_mask = mask; } From nobody Thu Dec 21 13:43:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8s0ZMvz54pZr; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8r4C6Kz4PFJ; Thu, 21 Dec 2023 13:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvjdjYxUZ11u1PuV7DKEs+pUiXIqN0YPjvUZEzg26Wc=; b=ZqPqyuDaEj+oq94NB0r1pZ3kOtck+Tp11GRDilfYNcYcHm5/mY09qBgshh/MD5nj5t2xmi J+zcDCBEjXqznMojzVOnxvMytHLwihOPRuuRrObRwe8D4hyy2wabjve9yaHBYGaS8rcTdZ oUZQVgOKh2r1MAVnU7OgdWYUP/QMv8Y4LVz59fMI68lwMX9XCbwvhfuHRvdU0/gvPwpBTB DhWsovdhBSxTEX012XD7uK2kUymZTYETh6q3nJUd4cEJDhJUcZzHvmdA5CvLgoHH9VW5Gg bsdn36dgioje4Hnb/wut7BHef0BOcfspinO9V4Q4fZbdmNQ1VJLyy/ptYXU57Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166236; a=rsa-sha256; cv=none; b=oFLmLm/ayaq+HdD8mqbpEuj4d28eNxEFUP/JN7Dx9e50j0WKMtcerOv0uFOP0fP+WD3ClX oNfsQT1dz/UejEIX5vLe/89y9b85hgSuP0O69YZMHknxVTFLVXaS7fAVCmx1PoxI8pKQvC lwLlyHGZqiqVwe2nRxCiCEcDzGz6n9F0a16NawC5stJYpL3GzOt9LLJbHCo47hskcA7oZc ALdO21u4xMt1WyCkxcBhWnGa1JDqRlveb8J09NiGgVAWGms+nNFvKy1bV7uVsE9n92LlBL xrR4BcFtaJHdKrME8sYKocZcTkc+422yXP6rwCUmcS43pD5Q/KrntavmBcSDbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YvjdjYxUZ11u1PuV7DKEs+pUiXIqN0YPjvUZEzg26Wc=; b=lfbRalOud/pDu1+dqJsETYEFfiQKW8Cv7ymHMGoPYmOsU5gliYj8GLOl9qMsOm0mPgpzNB lNcAKOu95YcK0YlH7F15Ju7sHe/piQhlHL/awWjt4jD19veZSPUW3LGR3k8cokVpjk5IVl mAfZZd1DHNFU8G/BOa0LpQan0Em6GVE+K80EJc49oYebBaNkplmaIkjTFKcOieIrxC6Op3 aCTMeVyp+W2Y1wU7XbDLcRmGU2tCBBXIql2HuUs9KmfO9Jyasl+vPijp3YZOxumQDXR+dP 8fWbdiqRh6fBiPzspGkpCACQ9v9XstTH4o7Qov1NdDgxrfFVZn70j2/T+cTD0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8r3HZkzZmS; Thu, 21 Dec 2023 13:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhu79079957; Thu, 21 Dec 2023 13:43:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhux5079954; Thu, 21 Dec 2023 13:43:56 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:56 GMT Message-Id: <202312211343.3BLDhux5079954@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: 9121202fcb27 - stable/13 - uma: Make the cache alignment mask unsigned List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 9121202fcb27e981bc4d2a7695fbba463361df93 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=9121202fcb27e981bc4d2a7695fbba463361df93 commit 9121202fcb27e981bc4d2a7695fbba463361df93 Author: Olivier Certner AuthorDate: 2023-10-13 12:49:11 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:39:53 +0000 uma: Make the cache alignment mask unsigned In uma_set_align_mask(), ensure that the passed value doesn't have its highest bit set, which would lead to problems since keg/zone alignment is internally stored as signed integers. Such big values do not make sense anyway and indicate some programming error. A future commit will introduce checks for this case and other ones. Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42262 (cherry picked from commit 3d8f548b9e5772ff6890bdc01f7ba7b76203857d) Approved by: markj (mentor) --- sys/arm/arm/cpufunc.c | 6 +++--- sys/vm/uma.h | 2 +- sys/vm/uma_align_mask.h | 2 +- sys/vm/uma_core.c | 15 ++++++++++----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/cpufunc.c b/sys/arm/arm/cpufunc.c index 42f718b9773e..e94565cdc61f 100644 --- a/sys/arm/arm/cpufunc.c +++ b/sys/arm/arm/cpufunc.c @@ -61,8 +61,8 @@ /* PRIMARY CACHE VARIABLES */ -int arm_dcache_align; -int arm_dcache_align_mask; +unsigned int arm_dcache_align; +unsigned int arm_dcache_align_mask; #ifdef CPU_MV_PJ4B static void pj4bv7_setup(void); @@ -170,7 +170,7 @@ get_cachetype_cp15(void) : : "r" (sel)); __asm __volatile("mrc p15, 1, %0, c0, c0, 0" : "=r" (csize)); - arm_dcache_align = 1 << + arm_dcache_align = 1U << (CPUV7_CT_xSIZE_LEN(csize) + 4); } if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { diff --git a/sys/vm/uma.h b/sys/vm/uma.h index c748a7843374..852473d69c27 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -475,7 +475,7 @@ void uma_zone_reclaim_domain(uma_zone_t, int req, int domain); * Returns: * Nothing */ -void uma_set_cache_align_mask(int mask); +void uma_set_cache_align_mask(unsigned int mask); #include diff --git a/sys/vm/uma_align_mask.h b/sys/vm/uma_align_mask.h index 666633350b9d..b4e9ac835d93 100644 --- a/sys/vm/uma_align_mask.h +++ b/sys/vm/uma_align_mask.h @@ -31,6 +31,6 @@ #ifndef _VM_UMA_ALIGN_MASK_H_ #define _VM_UMA_ALIGN_MASK_H_ -int uma_get_cache_align_mask(void) __pure; +unsigned int uma_get_cache_align_mask(void) __pure; #endif /* !_VM_UMA_ALIGN_MASK_H_ */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 19ea5433559d..0f3d2591c893 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -149,7 +149,7 @@ static uma_zone_t slabzones[2]; static uma_zone_t hashzone; /* The boot-time adjusted value for cache line alignment. */ -static int uma_cache_align_mask = 64 - 1; +static unsigned int uma_cache_align_mask = 64 - 1; static MALLOC_DEFINE(M_UMAHASH, "UMAHash", "UMA Hash Buckets"); static MALLOC_DEFINE(M_UMA, "UMA", "UMA Misc"); @@ -3191,15 +3191,20 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, /* Public functions */ /* See uma.h */ void -uma_set_cache_align_mask(int mask) +uma_set_cache_align_mask(unsigned int mask) { - if (mask >= 0) - uma_cache_align_mask = mask; + /* + * Make sure the stored align mask doesn't have its highest bit set, + * which would cause implementation-defined behavior when passing it as + * the 'align' argument of uma_zcreate(). Such very large alignments do + * not make sense anyway. + */ + uma_cache_align_mask = mask & ~(1U << 31); } /* Returns the alignment mask to use to request cache alignment. */ -int +unsigned int uma_get_cache_align_mask(void) { return (uma_cache_align_mask); From nobody Thu Dec 21 13:43:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8s6qfsz54pxG; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8s5X24z4PNN; Thu, 21 Dec 2023 13:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E2Y4XpBczRSasf6928Ka6U1zA3JQKggaTKm+YtYfI5Y=; b=Qq/cJkEZpcFSI0bsM0Mil3ABxxzrKowyG6DsMRsxeJNMsG3H5sXGqvG0zYarIdcW/LGI1M Iiu57V2c3Eczi1rEPVHvCoZ+ujKQI7liMyzaRURwmnc9Rp8UT8M70z3Ws04s1J54TrgDgH QHcvrwBFNqljGhIK4gzyMA4CzGKZ2Q0UuiAud0eCaGjhtyDvUXfCUojuz97DKTfi8YaPUd fY7D7pRUeK44I7S/v9vy3u/RH2Lrc4tAQYvnKNBGcVrchKjpDp9XBBeRUMRFgR4zT1ZoEW 8mftEtWKmmTiGqYESIxJd5BFFOvnWUYsVDpxKE4vqChM/ZP8AdwgpNlU1LOc4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166237; a=rsa-sha256; cv=none; b=OORomUxq4vwSln6IeLQiEKEyKSC7ttgTs3ea46eELSyXWgN+qjL+iecPEmOM+UNxgv5JO5 YZP8y0de0q4Vv/IpgmX61vjgB1xNZH230TRaeM1ohpdlitgmKBEi8pgXYa6YB96+NePqze VsfNoZWE7uxAcwu8bKQEOv3Tx8hhWMJS0axx3GWE9vE8Z8QDDiXSDkUNB3YMXLtNNJS8GC 7DQ3XYNJFH+H5jxG+gbbWJsggnFLM+crfAJdneAnGX2Ot/oHtwFQu/0pgGsul0E0BdiuVq AdZSua1zlNT8HvM4bLBImWfpATAozGYqqK7XBCs4bcdmCfycf7Du1uGxQbDKfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E2Y4XpBczRSasf6928Ka6U1zA3JQKggaTKm+YtYfI5Y=; b=E+yWphu6ZTR7Q9kG2Br7UPo0TTzALXKnY756YWrXtbXHQ5qgLbi5GhXbzdSWK7RvRkoyla X+aXbv1mNIWQLbDKgr+KTvd7uykUhUnMrvB9NGuM6TiHpSOytfiHlpjE+LAqduDLwLuDeu QzcZETfhqaOAgTinFw22jrIPqHCdtohuf29yLavIljd1Uw/G3v0Wtvq537h2L1BgTPz8K/ I9kos4vF3X9m2FwtCAw4KFxrtgNZLai0oDVilvocUxwJ4WGcLBgfS6eJyrm/LYWZrzzEMn 2VVVzoNB/jyewQfyETvVCxeU/gsmC/QZVMjp32gziadAPm8TOOauotJLPn2/Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8s4dtczb5s; Thu, 21 Dec 2023 13:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhvEh080006; Thu, 21 Dec 2023 13:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhvh0080000; Thu, 21 Dec 2023 13:43:57 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:57 GMT Message-Id: <202312211343.3BLDhvh0080000@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: 8626f6da9a21 - stable/13 - arm: Update declarations for arm_dcache_align{,_mask} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 8626f6da9a21c14546ea11c1e9ddf23923bf5470 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8626f6da9a21c14546ea11c1e9ddf23923bf5470 commit 8626f6da9a21c14546ea11c1e9ddf23923bf5470 Author: Mark Johnston AuthorDate: 2023-11-02 16:23:51 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:09 +0000 arm: Update declarations for arm_dcache_align{,_mask} Reported by: Jenkins Fixes: 3d8f548b9e57 ("uma: Make the cache alignment mask unsigned") (cherry picked from commit 185aa8c9c3d7a01d616cfaafd492f61b37ed2551) Approved by: markj (mentor) --- sys/arm/include/cpufunc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/include/cpufunc.h b/sys/arm/include/cpufunc.h index df3ebc3b9255..5889e52819c1 100644 --- a/sys/arm/include/cpufunc.h +++ b/sys/arm/include/cpufunc.h @@ -178,8 +178,8 @@ void cpu_reset (void) __attribute__((__noreturn__)); */ /* PRIMARY CACHE VARIABLES */ -extern int arm_dcache_align; -extern int arm_dcache_align_mask; +extern unsigned int arm_dcache_align; +extern unsigned int arm_dcache_align_mask; #define HAVE_INLINE_FFS From nobody Thu Dec 21 13:43:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8v19zmz54q3B; Thu, 21 Dec 2023 13:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8t6mrBz4PCj; Thu, 21 Dec 2023 13:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5JQCip4qhCU3IV5YYU5shfsMaKnDnrHoiETbDctVPI=; b=ICsF7AJbH1c26bDuoldSSnUDilH+Fee2dC/05/xtA1gDhE6doN860HR3Gl9NQkdgYNx1Kd iY3tZQ1wGpSn+JHprOZbiGFUW0OivqvRa6rDt+vQQ35qdf9k4Cv22W9GgiLrdB+JuCirc0 DRSvgFHyIGTfrb6UffGAy6tdnQZ+op5t+llpaI/M5n9JhCxSxXACA/kGHY75HleDI82DFF UhrNlOoiLxuPj4cAuf0sr/cTV0ef29ufsH5BdTQdWUqHDuqW8R1uNgzNEzK+obpMYLdIQD QvmzKYOsEdJVCcBrG1/prH8CjYJpwHfXW1cKjT3o/cvtPwsA1LXE/3/AR6CwYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166238; a=rsa-sha256; cv=none; b=gd0OAd+69Ch0WAsISQwaEc7bw4XFnJI5MemoMzhS5Gt7oiWnOKm94rhwHhCag9WryW1duU dA3qna6GFZVm5p2zKKN24efh3SxiQ6VthmGb8OMEwF7zsa5disjZ7jrXd/3kNZL90sYfXx XaGzua0mB7pkWRxSGzNALbg00EF3emC+1yu4Ey/MZaYorsTcl3+u6aKF1zdS/KiUQ7pOp5 pp1RVVLwggnCQZWu0MfQUQxqqmLeqsPCsNmXcxhkqUYSW22FVsb/nBqHT4lCh7M2HOKsI0 t3qXBEegYVoMacfbATdjoQDnh5X1RXOSfKgnYoiPXt3gW+a8E00PTr63vuF4/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t5JQCip4qhCU3IV5YYU5shfsMaKnDnrHoiETbDctVPI=; b=Jfat1YIi4E77qhyLauKCqPfLoxrtE1q1/gyHGv3wacs5CeHlr8kpJCxw61GqCXKcmOSYKP paphqLNEcOBG+oCVH0GO6TvGFxq8PxtXyegA4TCdcIV8Pukbd4GkAprhP0RoAfOD/NWGKb ZYnvUAgGOusynfNunTXwvAFEuCP+DQY9Ov0VfEFgTKi98K7qKpqYEGm7PnepVl5ecX5vR0 9BHU3ydBkKBYBt3zhV9t1DGQSMlKrjmjD0aY+rsJ8fwhiaGHt2C8Tl6sgKLLa2DIDGfsGw bt1+vBg4BYze8he8u7u08uXnjFPvceiPi4yuXF2A3jP5uqEUwowYN8IGLB8DDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8t5tHfzZv0; Thu, 21 Dec 2023 13:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhwOw080055; Thu, 21 Dec 2023 13:43:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhwYu080052; Thu, 21 Dec 2023 13:43:58 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:58 GMT Message-Id: <202312211343.3BLDhwYu080052@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: 27199e55a4d5 - stable/13 - uma: New check_align_mask(): Validate alignments (INVARIANTS) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 27199e55a4d568659d3a4b9985e736e8e5ee3dfe Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=27199e55a4d568659d3a4b9985e736e8e5ee3dfe commit 27199e55a4d568659d3a4b9985e736e8e5ee3dfe Author: Olivier Certner AuthorDate: 2023-10-13 14:09:51 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:09 +0000 uma: New check_align_mask(): Validate alignments (INVARIANTS) New function check_align_mask() asserts (under INVARIANTS) that the mask fits in a (signed) integer (see the comment) and that the corresponding alignment is a power of two. Use check_align_mask() in uma_set_align_mask() and also in uma_zcreate() to replace the KASSERT() there (that was checking only for a power of 2). Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42263 (cherry picked from commit 87090f5e5a7b927a2ab30878435f6dcba0705a1d) Approved by: markj (mentor) --- sys/vm/uma_core.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 0f3d2591c893..2236df90dfc0 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -3188,19 +3188,31 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); } -/* Public functions */ -/* See uma.h */ -void -uma_set_cache_align_mask(unsigned int mask) + +static void +check_align_mask(unsigned int mask) { + KASSERT(powerof2(mask + 1), + ("UMA: %s: Not the mask of a power of 2 (%#x)", __func__, mask)); /* * Make sure the stored align mask doesn't have its highest bit set, * which would cause implementation-defined behavior when passing it as * the 'align' argument of uma_zcreate(). Such very large alignments do * not make sense anyway. */ - uma_cache_align_mask = mask & ~(1U << 31); + KASSERT(mask <= INT_MAX, + ("UMA: %s: Mask too big (%#x)", __func__, mask)); +} + +/* Public functions */ +/* See uma.h */ +void +uma_set_cache_align_mask(unsigned int mask) +{ + + check_align_mask(mask); + uma_cache_align_mask = mask; } /* Returns the alignment mask to use to request cache alignment. */ @@ -3219,8 +3231,7 @@ uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor, struct uma_zctor_args args; uma_zone_t res; - KASSERT(powerof2(align + 1), ("invalid zone alignment %d for \"%s\"", - align, name)); + check_align_mask(align); /* This stuff is essential for the zone ctor */ memset(&args, 0, sizeof(args)); From nobody Thu Dec 21 13:43:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8w3WQSz54q15; Thu, 21 Dec 2023 13:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8w0R9nz4PT5; Thu, 21 Dec 2023 13:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mchxLVlJoOdTPYs7BnKw9aLDc7sR3klKi++jkZ3gmBU=; b=nSjER/V1mwhbwnAxFv4dg8J3jRmukVni7URSm2nX9Cjclapx57diay7ePvg4VZZewqRaKc jbD/YSIli6OALbWKW3ZUJc9N7d6Jm9VVkC3/mCMRNGuuqnLIxx+Bmeew/5nYnui9qcd784 jKsT5FZ0QOU4YIlrrMDHOwZe40T2XUTXjX5DlUGqR5mXc0t+I4yhcRS+lUKL6qmevlzQli 8udPwkymcAJchmT3wYCie0m1Gn8ACfmfBxZbu7knHguib3de4jH85iQA1P1Q7PO+gK4lwf k6Hy4ldM7M0pGBwEBXfytWe1A8m+Li6oSerEu8NO4YBDpOtSmvqIwazr1EvpDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166240; a=rsa-sha256; cv=none; b=Rc7LixmKeX2DmCk0vV5ZI+paO3uTIqUF5P9WtSQQ7IT+WhHJIpiaDhNxs982cgnUbMOPTe qaMXdxUvyRdLJF5VMRoqiksfEmLtf3S0jZ5y8JDrRiOjMHjobZk2vT82/+KYMJOaZQ30SY /wjZe+uG3jOO2Q0N58YDwdLRHSxVtg+cleIXK+CueiigqPZcoCBwyme7Y4V0y2R0FN42mh EIUoA6ZqYWa9BlW9SKzHaUs6TijBb7tBOg0Q+1TtL/28+wzw4eNztPschkbCDgcuklkcDq T4+T+avhr3jx7q8gmPCYE21SNlOCupVr3422bkOixhcCQrvXg5JSGq7xkI5+Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mchxLVlJoOdTPYs7BnKw9aLDc7sR3klKi++jkZ3gmBU=; b=PWgFa5Kc0e3jsQOPlnYPXMUqrjN9FPw3s068Clqnnn6AzmSinBegpwObJDnHCWdc+S8az6 EbtEjOagZ7i/XiXcdgDXBeAehSzOMTiLU5HAolBKox2V3eyePpxcLwtbAver7Dl0wZ2dsP zXLKkWmL4rXsjrGCAtWoGuqws3raMnJBAATzQUc5NmFc/FxjNgcA2Df0Hqn0SKaEHcfguZ YSlTU+TZGaEmftlibl9p1oXgYCKQlcadfEURrEVZsNe5g2eV2o6RLhqhBogqm4gfQV03uT 0REIWdjHhEycx4yPs+Ac9z2vUfEeKZe6kz7/oyKtsTYYycyBtVpMYFgsqrHZnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8v6dFgzb5t; Thu, 21 Dec 2023 13:43:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDhxDO080103; Thu, 21 Dec 2023 13:43:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDhxrc080100; Thu, 21 Dec 2023 13:43:59 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:43:59 GMT Message-Id: <202312211343.3BLDhxrc080100@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: 89af1555b4ef - stable/13 - linuxkpi: dma_get_cache_alignment(): Fix off-by-one result List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 89af1555b4ef7efbd8caedf905956b2a2a5df141 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=89af1555b4ef7efbd8caedf905956b2a2a5df141 commit 89af1555b4ef7efbd8caedf905956b2a2a5df141 Author: Olivier Certner AuthorDate: 2023-10-13 15:13:28 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:09 +0000 linuxkpi: dma_get_cache_alignment(): Fix off-by-one result Substituting 'uma_align_cache' by the appropriately named accessor uma_get_cache_align_mask() made apparent that dma_get_cache_alignment() was off by one, since it was defined to be the mask derived from the alignment value. Reviewed by: markj, bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42264 (cherry picked from commit 2c7dd66d09a1b92a4698232996cded6e5315b3bd) Approved by: markj (mentor) --- sys/compat/linuxkpi/common/include/linux/dma-mapping.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index fb63a45ac307..d0ada4df3e26 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -351,7 +351,7 @@ dma_max_mapping_size(struct device *dev) #define dma_unmap_len(p, name) ((p)->name) #define dma_unmap_len_set(p, name, v) (((p)->name) = (v)) -#define dma_get_cache_alignment() uma_get_cache_align_mask() +#define dma_get_cache_alignment() (uma_get_cache_align_mask() + 1) static inline int From nobody Thu Dec 21 13:44:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8x3n51z54pxN; Thu, 21 Dec 2023 13:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8x1TYzz4PTJ; Thu, 21 Dec 2023 13:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PeqkXWl+yb2sOfByBZq/+7WvxobYQyaIcxhaFsm9Ys0=; b=jMa3UzEdbn2SQMtQVZlpptjtgTsgeTadjK+7atw5ZQPOucJdTt3XKWwZA9sDHtS3vR1IO+ re/b9VSuYAKIsb6iEnoHoO1GrkhNcsp2EE/3p00dMYK8erYeb4bPJOpiXA6cPalkblQ/3x Zto3U5xivSTXEQY1Mt2Vu+6NydYQtRoq+fRWBbhexIkWJKHLHbR/v2WJlEAobM+ZUnOSsf VG1lsNTK7B6l7ylIhNWYJ4I8Q3TT1YSQvGOs+coNiSB65U1lO89Cb18DmpVT17DiuxoNW9 Y9UCXJlAIgTdGT224lxPJzB8IS4VCgIieQ/O8wUnKyYSwYQ7G2O/qCynDMEmOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166241; a=rsa-sha256; cv=none; b=HPpPGDqLtV/7bB0k3qm9c6cW8J1YgMlxsHXzt9K01fMyYAW3d8kCX4hBgMniC5LFVKvTMD jdTjMjKC0js3DDD40SxtCimVXSi6OrRUFfIYkJkCYzi8b4M6bUwY7hmz1Ju7cA0HOqrbJm iSUgzbrBbGBgvzV556VZYKfma+XOrJFvpcFSO++yUSqCJEwuRaCn3ei/NV7GhKadW2WV5k RBkxoj2Qj3hPSUMiOQFVaagy1QWa1giAw7h3KVjFgA8q0YYycswdzrRoSmU+Q7fQ0MGZUH 63/tgQT3A4yBk/OZc/T1ykS5shBYvgg8aGhV91HDktr/GlYawanKr1HBabXrEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PeqkXWl+yb2sOfByBZq/+7WvxobYQyaIcxhaFsm9Ys0=; b=ieJFZykpBdzSR5epGfTP+iijCwXQqfXh0Vwc5cgyy0I84zZNmkhmrqWPxQ/KHaExSQ/u3z A11bIHCKaUOO4Yo4wPeO87nL175lK1+MtQkc+HspNQvjqRuDkNwoOcKrebEFnMvsDETULa dUsW1T3wZ6B7I6+fNUH4+n9QeKOCuU/Ws/WEbYqxLyum84s+dalqUYWzAi15KrSR3yEOnW R8fjLDT/9ak9hcu4NtoEO2kOfJgj+pDdgSYq1sS821c9stUe3cIYfGvIosxPoY8mnyn/ft 65XqmujiXajtX1/1L+NhLX/9E8vzK3IjmDQZcLBAIFQkfcJNKEwsgejnX+bbbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8x0Ylgzb4M; Thu, 21 Dec 2023 13:44:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDi0HS080189; Thu, 21 Dec 2023 13:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDi0M9080186; Thu, 21 Dec 2023 13:44:00 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:44:00 GMT Message-Id: <202312211344.3BLDi0M9080186@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: 6e4b7753610d - stable/13 - uma: Permit specifying max of cache line and some custom alignment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6e4b7753610d2594740d73120fe6251ce7f66a61 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6e4b7753610d2594740d73120fe6251ce7f66a61 commit 6e4b7753610d2594740d73120fe6251ce7f66a61 Author: Olivier Certner AuthorDate: 2023-10-13 15:05:34 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:09 +0000 uma: Permit specifying max of cache line and some custom alignment To be used for structures for which we want to enforce that pointers to them have some number of lower bits always set to 0, while still ensuring we benefit from cache line alignment to avoid false sharing between structures and fields within the structures (provided they are properly ordered). First candidate consumer that comes to mind is 'struct thread', see next commit. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42265 (cherry picked from commit 733e0abd2897289e2acf70f7c72e31a5a560394a) Approved by: markj (mentor) --- sys/vm/uma.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 852473d69c27..2a305d87ca34 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -302,6 +302,8 @@ uma_zone_t uma_zcache_create(const char *name, int size, uma_ctor ctor, #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ #define UMA_ALIGN_CACHE (uma_get_cache_align_mask()) /* Cache line size align */ +/* Align both to cache line size and an explicit alignment (through mask). */ +#define UMA_ALIGN_CACHE_AND_MASK(mask) (uma_get_cache_align_mask() | (mask)) #define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ #define UMA_ANYDOMAIN -1 /* Special value for domain search. */ From nobody Thu Dec 21 13:44:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sws8y6Hlqz54pb2; Thu, 21 Dec 2023 13:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sws8y2YS8z4PTf; Thu, 21 Dec 2023 13:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTAa8nRMEQ6rFNIA2yT9vlG0XSntSZ2OFx5cbgRl3VE=; b=pF9/6lOWjl5pi2o3aA7Oy9Bb9qUC9CRFlP4dY5ggqrPsFbh4RuI+saA/nAI3smSDxEJgzq dNH/oIAFM55jAl87V1+TPtWzGeT4d94vTXk933mVVYL7BLgBuW3P9m6RKg53zXhh1v/eUg nhQwhNlcOY/t8MMwMGybxWut5BLlqL21WWiVp7xJCb6T8Lqb5Z6NMWlCzrC4e/hBCUSURR VQWBWgo+m0XAdXQsUvbLRw6EFGdyh8uKi+yq6cOrT88kMFUO5oxCXgehkc0e/AVwgFq1VR hc3KiTnA20eKu4U7N9beIuCctxqXT5ggWTbQXLzTXpezMkpfmzKKXdNjbCGmbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703166242; a=rsa-sha256; cv=none; b=A2odoQEGPm8ldmdHk8ZnuQB3Gk6oLSt2CLLeVblE37RiiQrk38Py9WU/vCSkHxVXJvtO2f InUMXfrDY6hB+iFzfffZMl1sXYYUJZhF/jRosM74umkVtDt28pQQVqQkwT5wFYecVvkVm2 zzngT8kMC3F2+xCTNCNjcQ2kncfoy3b+pGa8sTVC/MAHpC9dBB3MuPhGGH1noL8C+mDywl cn4O8PCGTaTPxWBY3aj9o5d82EIVRPGJhyv/vcd/xtYC/knh0QekF9XLeIjMcCmWybJufb BzYHH+XE+XMKGSE4ZMYjsgDvW71V2GbyuNHKov0YAw+XubH+pvLJwpWcf47xoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703166242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zTAa8nRMEQ6rFNIA2yT9vlG0XSntSZ2OFx5cbgRl3VE=; b=TCdmoiLcdxKoKxYtxPjUyesEP80mzBgeIo0GOSAZt2yY7WMPh62FwE4c9qJxh6dD8lxTIN gy5t0sLYtMOdsvYGixGpwP5fm7J8No8KZsi25OSFj5TTvhRIaJZKbyX0nhYZrkq1xRrHtq hPH1rIvzmcbT28BCCEkehNxeniZ7bpOGU0bEo1LCV3hH70mSq3pZoqp1sEUJsnt2aSZvz9 d0/XmDZRaTI5B31MtqUxTm4wUwAwy2NqB42sPkMdd2A0rW4kUW2Gf3dux3U6ZF/wo4aG/l ucus8pfzUAOJVmZCBkwpx6ZbnUZJ4RCI+xhWATroyOrzecg4NccRNYjDrTPAVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sws8y1dFlzb7h; Thu, 21 Dec 2023 13:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLDi2TV080244; Thu, 21 Dec 2023 13:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLDi2hi080241; Thu, 21 Dec 2023 13:44:02 GMT (envelope-from git) Date: Thu, 21 Dec 2023 13:44:02 GMT Message-Id: <202312211344.3BLDi2hi080241@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: 706303829968 - stable/13 - Ensure 'struct thread' is aligned to a cache line List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 7063038299682f421a3b56ade0dbd40c2ce69292 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7063038299682f421a3b56ade0dbd40c2ce69292 commit 7063038299682f421a3b56ade0dbd40c2ce69292 Author: Olivier Certner AuthorDate: 2023-10-13 08:52:31 +0000 Commit: Olivier Certner CommitDate: 2023-12-21 13:40:10 +0000 Ensure 'struct thread' is aligned to a cache line Using the new UMA_ALIGN_CACHE_AND_MASK() facility, which allows to simultaneously guarantee a minimum of 32 bytes of alignment (the 5 lower bits are always 0). For the record, to this day, here's a (possibly non-exhaustive) list of synchronization primitives using lower bits to store flags in pointers to thread structures: - lockmgr, rwlock and sx all use the 5 bits directly. - rmlock indirectly relies on sx, so can use the 5 bits. - mtx (non-spin) relies on the 3 lower bits. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42266 (cherry picked from commit 7d1469e555bdce32b3dfc898478ae5564d5072b1) Approved by: markj (mentor) --- sys/kern/kern_thread.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index cab0d7446d2a..14015ef5fdc2 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -525,9 +525,15 @@ threadinit(void) */ flags |= UMA_ZONE_CONTIG; #endif + /* + * Thread structures are specially aligned so that (at least) the + * 5 lower bits of a pointer to 'struct thead' must be 0. These bits + * are used by synchronization primitives to store flags in pointers to + * such structures. + */ thread_zone = uma_zcreate("THREAD", sched_sizeof_thread(), thread_ctor, thread_dtor, thread_init, thread_fini, - 32 - 1, flags); + UMA_ALIGN_CACHE_AND_MASK(32 - 1), flags); tidhashtbl = hashinit(maxproc / 2, M_TIDHASH, &tidhash); tidhashlock = (tidhash + 1) / 64; if (tidhashlock > 0) From nobody Thu Dec 21 14:24:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swt3V3CRxz54s40; Thu, 21 Dec 2023 14:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swt3V2jLbz4cRQ; Thu, 21 Dec 2023 14:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703168662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDGS7b7WobtbYfRqMqnXQzLT5LSCU/kp9ioVX/7OnoM=; b=Gip5MPap4HqDAUXuF+17DbCLS8f22KJc2gqLUANdDCoecQJXO4FBOgTSYGyoq1QHm4bNF8 epgD1U+PU1qUABUvpGe7useonNhxUr/9DMi5XdUyWPeq/rw4v/5nRfKGUdMWUAjRRyxUb1 Upw1IgoEDf8D93eGf9gwzK8vXCAJNYk4rR6M/kK9nF5vQFQ0IHsVuA2V2xDgyDhcKVBzRJ ZHcBB9MNvPCYyojkIZcK4mFiZsg42f87SxUEwDzKr09eMPunrsr5atTKdqUXDPKuMbPGvD YUfr2bkGInZ/HvQnwt0IzN8Q6RbAi6Vwk47dNenQOTN5MhzYq/s3XPNW22E7tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703168662; a=rsa-sha256; cv=none; b=Quc/C9OCOoHIKER2MafOKZsFqtEBc7Ha+5dMtxkN2zUN+gOTzUsVd2vXzYdudsgUwBc3fu fm3RAHdPXu/s2paBgkcL028EEIMLClzwGCzVPezInQHHU6Wrau0hMTUUaRreF87wT8edSn 4P1JpLvEX8axWvbimhE6IKvpFGIav0uROsjY9/gldWK4wOvAjmRwIIOhCjX7ruvKoq5eeV kD0bScWhHb1exeEzvJjrtnR2GlJF9Ry4TejPepSeE4UFYe0g8Xi5iHpmUclHDjNaGUrN6T QGT/xsoCAJ7igP4pW+z+9cj1xt4F4ul90IgiCrjAegx69N5RCL1rM6h1SyY2FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703168662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDGS7b7WobtbYfRqMqnXQzLT5LSCU/kp9ioVX/7OnoM=; b=bTK76kW4UR/Gisax4Njd2q9iZih5xLT3MYmUEPjUpPn/N8h/8ekjoq7++rEeeXGbNZfzKu a2XtDs62E9UReLYescvmZGryUbf62r1eSImYCSbxvNLTq9mk7bkNfwdtH+ohq31/hq+dSu e5CvjprAH8xLaBZq4aA8mjrdb46N0S1yKBpP3mDfOAnyjUtl/6jFrwbOp96hJqmtzky0ot 3JJ5Z7xC4CMmKIlmY1pTA9535IuwiLRUm+sOWyyOEdNdolx/yz10hzqysXGoEz5xyB285L WU9qkYOpZTPhMf0Q38XJQz4ru5kMUn3W0rp6ZMkXBDCTq0hRF71LDhvsqupBnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swt3V1lnDzbp4; Thu, 21 Dec 2023 14:24:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLEOMhr047628; Thu, 21 Dec 2023 14:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLEOM2Q047625; Thu, 21 Dec 2023 14:24:22 GMT (envelope-from git) Date: Thu, 21 Dec 2023 14:24:22 GMT Message-Id: <202312211424.3BLEOM2Q047625@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: 2d5a980f43e5 - stable/13 - tcp_wrappers: recognize IPv6 addresses/prefixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 2d5a980f43e565355d5d174ac4737b0ca080dda2 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2d5a980f43e565355d5d174ac4737b0ca080dda2 commit 2d5a980f43e565355d5d174ac4737b0ca080dda2 Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Ed Maste CommitDate: 2023-12-21 14:23:40 +0000 tcp_wrappers: recognize IPv6 addresses/prefixes Intentionally or not, but the libwrap was written in such manner that if your /etc/hosts.allow doesn't have any domain names, neither smart keywords like LOCAL or KNOWN, then it will not try to resolve the client address during the hosts check. This was achieved with the NOT_INADDR() check that matched IPv4 addresses/prefixes. Extend this to also skip resolve if client list token looks like IPv6. Reviewed by: philip, emaste PR: 269456 Differential revision: https://reviews.freebsd.org/D40070 (cherry picked from commit 1d9722de6f90c3edf286b077938bfa696e728d6c) --- contrib/tcp_wrappers/hosts_access.c | 3 ++- contrib/tcp_wrappers/tcpd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c index 05c62d194091..e55f3f34dd20 100644 --- a/contrib/tcp_wrappers/hosts_access.c +++ b/contrib/tcp_wrappers/hosts_access.c @@ -315,7 +315,8 @@ static int host_match(char *tok, struct host_info *host) return (masked_match(tok, mask, eval_hostaddr(host))); } else { /* anything else */ return (string_match(tok, eval_hostaddr(host)) - || (NOT_INADDR(tok) && string_match(tok, eval_hostname(host)))); + || (NOT_INADDR(tok) && NOT_INADDR6(tok) + && string_match(tok, eval_hostname(host)))); } } diff --git a/contrib/tcp_wrappers/tcpd.h b/contrib/tcp_wrappers/tcpd.h index 1078073c8e3a..194cde378c1c 100644 --- a/contrib/tcp_wrappers/tcpd.h +++ b/contrib/tcp_wrappers/tcpd.h @@ -70,6 +70,7 @@ extern char paranoid[]; #define HOSTNAME_KNOWN(s) (STR_NE((s),unknown) && STR_NE((s),paranoid)) #define NOT_INADDR(s) (s[strspn(s,"01234567890./")] != 0) +#define NOT_INADDR6(s) (strchr(s, ':') == NULL) /* Global functions. */ From nobody Thu Dec 21 14:46:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwtYF572bz54smH; Thu, 21 Dec 2023 14:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwtYF4Tknz4dSt; Thu, 21 Dec 2023 14:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703170001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hL/gB48AWxNvg4FU/1Guj8F95El29hbuaieQCvjohs=; b=K9JT0VvB94xgSjkonXXMX5bdog0UJHIniVLdG4KwVDvCBW1+7vnuYWwsbKdqrkhyUKnvIC m7+YNRwdn6ylVYqTZCLno6lQXTog/RjkYfvIE7ZBArh+Wjgy3RtGQbxpk/JUy9JO/T8ySK GdNlr3AYPYwAnKChzDTjKEXyZAZ0mCzfgQVtJDXMIzErLWrRGf4kE0IkU4k2t4iGFHelFX JFurc4I2S8fMSSMgjs+0P4QP57WrshwISq977IX5pQBNX+F1gZ6YlbDKI1F7x06LcanhKm yQd8+O9OSoAjeFjmavtrhd9BD4cv2oZve6c3FhayPHIqoiF1QJytemRXPfeBqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703170001; a=rsa-sha256; cv=none; b=w3XpyrL7ixqAQeh2jJFQro33klxe+g5CGiyrL86BF51DY2+Br9Gj8vIkNuAwKyzn+2yKIa JuSuj5Mq5g7uZdvSZh6hRC4qNL0udYLhzFwyNfwMd45C2fuyCIrH9PR+05QfUKdxaiKmsj pUO/Wr5+vdt+mr6d+zpZ0dnI+QK9X3R3lyVUItl2tDgP+pMayzZT3vGAlmpuMwz7ttIm31 o2xkJu8l4SijoEob554TbpZHWj3S3e+9JKHjm6cwqwcM2/w7ewOmK+F1Afe2zJ9qzGdqVf yLQg5G4Vr/sT5TgVJyL2iBEkc0tvxQaInuH6r8OZPWQBIwpMnRJB77vhqEpNtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703170001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4hL/gB48AWxNvg4FU/1Guj8F95El29hbuaieQCvjohs=; b=xOi2OD58Dd7WcfobWNoWtLhef2onz5aY+B60XOC+DW7RUJPIftYc6jQmpoPnUy7SD5tvar 59JnYH/T3T2F20cpBL+mpjM3cYhoGJkk0AprcCYaSOfvtetDR3D85POQMp57Onc5DGgFK7 BTkTeokD1gvjcdpeNe4/GhhVEGGSx78LP8RvX3sP6fp+zgrUAACd1bDaTgK+O8VL/dM2b/ l4aI86NxHiPQS4EDzBe5bFewuCshW+BBdplNJQQtYBRL3khP2+Ws60oRectIzxWfJ8sFzg dP2ccPx7B698xVMdVJQub5IkJsiHOOPSNSzH9fxzeGtq2tJbEOsjrVdpTIwQvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwtYF3N38zc1V; Thu, 21 Dec 2023 14:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLEkfm1081339; Thu, 21 Dec 2023 14:46:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLEkfpt081336; Thu, 21 Dec 2023 14:46:41 GMT (envelope-from git) Date: Thu, 21 Dec 2023 14:46:41 GMT Message-Id: <202312211446.3BLEkfpt081336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: ad874544d9f0 - main - libnetmap: remove interface name validation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad874544d9f018bf8eef4053b5ca7b856c4674cb Auto-Submitted: auto-generated The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=ad874544d9f018bf8eef4053b5ca7b856c4674cb commit ad874544d9f018bf8eef4053b5ca7b856c4674cb Author: Vincenzo Maffione AuthorDate: 2023-12-21 14:43:57 +0000 Commit: Vincenzo Maffione CommitDate: 2023-12-21 14:43:57 +0000 libnetmap: remove interface name validation When trying to use a VLAN device (e.g. "em0.123") with a dot the library fails to parse the interface correctly. The former pattern is much too restrictive given that almost all characters can be coerced into a device name via ifconfig. Remove the particularly restrictive validation. Some characters still cannot be used as an interface name as they are used as delimiters in the syntax, but this allows to be able to use most of them without an issue. Submitted by: franco@opnsense.org Differential Revision: https://reviews.freebsd.org/D42485 Reviewed by: vmaffione --- lib/libnetmap/nmreq.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libnetmap/nmreq.c b/lib/libnetmap/nmreq.c index 645f01abc130..2477337d8791 100644 --- a/lib/libnetmap/nmreq.c +++ b/lib/libnetmap/nmreq.c @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx * for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++) ; - if (!nm_is_identifier(vpname, pipesep)) { - nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname, - pipesep - vpname, vpname); - goto fail; - } if (pipesep != scan) { pipesep++; if (*pipesep == '\0') { From nobody Thu Dec 21 15:13:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swv8Q5k65z54v5H; Thu, 21 Dec 2023 15:13:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swv8Q3wP5z4gDb; Thu, 21 Dec 2023 15:13:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-78101108e3fso53073185a.1; Thu, 21 Dec 2023 07:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703171620; x=1703776420; 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=Kjg0KDS3OBpoDljwmB4O/qzKq+4xpnq94RgsPMe/kOY=; b=Rxc6csl1hylh/ntd65RoauJ9op5McHbTPEpKIpiMgcWHRnqVefgFUxyMrB3GvNeLpX NRUmJiusIxOIVdygUXAlBaciJgztgMyC1nyH66tNlA6vfgqTYmOyvfSxCeyP4T1cIpu8 lCSdvECuwAU0KZV9FCQLdQecZI9iDHub3+pJdl1jCSK3TNcLbsmoVvBg9Cr5axhqDCPz 0z6q+FtbZXUSNeMU78XIwCooUfHNVWSFaAeaAFZ3vwXvokxTrhMmu7od5BdTLKwlMGm9 aMmi79d4MeRx+2UsLvNpkjCKE/4CqucpwAP300dhai1HjVw0UNZwdxq9LsP4unnAAGdF FufQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703171620; x=1703776420; 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=Kjg0KDS3OBpoDljwmB4O/qzKq+4xpnq94RgsPMe/kOY=; b=KtC9FfZpMR73DRgOFKiYFNAyi9PLIJbR0AlugzZeiQvWF2xkLlXq8UKemT8+Wlqj52 lsBT3XdT23QlZEDX3ls7hZihzSk8WkMctUX4CRbHmj4sKYUuf6n6lnM26L0Pjp0ytqN2 DZIne9vrgyV6HV2Y5HgnKvl0DR/8VTOKeNt8If2zmodDI4483K7YX0Sg2ImOBUV3a4iH rG4Y4lR5H+h9FTuPqML+KaywCfLOPYUh8deaNEiZwHf6f/+GG4JSOc6WHZ3VBC/b3XkG 5aBqe5xuaCR8lb+vx5ptmmGXnnTWL4NeaZt0Qlj7HWriN4d3+ctieWw9Pt3HICn8Isua jqBw== X-Gm-Message-State: AOJu0Yy776fNWH5ZgcTRVpAt7SS+tIFrUwq1SpaApQmTOewfvQviifBR GeNI0+TM9yCfNtTzRTLaLimG7iHviGktpw== X-Google-Smtp-Source: AGHT+IHbW9Sd737yCyZk4snfoHCpgun8Eobz7zqQ8atEH+ba6icoTmumbKP9d4F5ma4eCCSQ8GqoZQ== X-Received: by 2002:a05:620a:600b:b0:781:15f2:9c55 with SMTP id dw11-20020a05620a600b00b0078115f29c55mr3033025qkb.140.1703171620140; Thu, 21 Dec 2023 07:13:40 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id a39-20020a05620a43a700b0078108a4a7cdsm709827qkp.108.2023.12.21.07.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:13:38 -0800 (PST) Date: Thu, 21 Dec 2023 10:13:35 -0500 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned Message-ID: References: <202312210421.3BL4Lb9T036317@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202312210421.3BL4Lb9T036317@gitrepo.freebsd.org> X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Swv8Q3wP5z4gDb On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > Author: Warner Losh > AuthorDate: 2023-12-20 19:09:09 +0000 > Commit: Warner Losh > CommitDate: 2023-12-21 04:16:45 +0000 > > vtnet: Adjust rx buffer so IP header 32-bit aligned > > Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them. > This improves performance everywhere, and allows armv7 to work at all. > > PR: 271288 (PR had a different fix than I wound up with) > MFC After: 3 days > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D43136 > --- > sys/dev/virtio/network/if_vtnet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c > index 287af7751066..360176e4f845 100644 > --- a/sys/dev/virtio/network/if_vtnet.c > +++ b/sys/dev/virtio/network/if_vtnet.c > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) > m_freem(m_head); > return (NULL); > } > - > m->m_len = size; > + m_adj(m, ETHER_ALIGN); The driver is expecting to get a cluster of size sc->vtnet_rx_clustersz, but now it's getting one of size sc->vtnet_rx_clustersz - 2. I don't see how this change can be sufficient on its own: what prevents virtio from writing sc->vtnet_rx_clustersz bytes and thereby overwriting the two bytes following the cluster? > if (m_head != NULL) { > m_tail->m_next = m; > m_tail = m; From nobody Thu Dec 21 15:21:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwvK41tKbz54v6s; Thu, 21 Dec 2023 15:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwvK41R1Xz3D9c; Thu, 21 Dec 2023 15:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703172072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yeC4WNgIHMdeTN8SxjQ1SKpT8IcW+tAwZO0sA2/Hiys=; b=cf7/eLy+HZzcQHszF61gJ4BLFtIgrB2H4KvdyZSCbFsOpPEMVIreRttSeVWozBIKx2IVBx vQubC4Qz9J9cFBkQ0iam/RhOoCd8lN05ImncveuYfl7JEhESQE2raA7XbPNijczFLGBXcP 3VE+hW2UbsibDEXemN3QW3YboWBTjVlsiIRWB1Az5DtMSqr8tIWbvY7iSYqKdRU0KUfiT0 Y9PxH/QsCCkoJ9BHacWP5VVM9jr9Sofp+yo0sUQ6g7ezbNINuCKowAgRTjFnwBC6nqYAsK 4iJQsiXrUSUTBQ0hw/LqQlukRwowoV7Frjm2WxKM09UKtZNOfFFE+p8YFaxv0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703172072; a=rsa-sha256; cv=none; b=eG4WZ+dj7VaSOaSXSPdiRqbsDb+81Ztsjnv1KezyrJS8ceQGLT658276z+zI381Adn+SVk urmC4DFw8ZcL9BJ6BcA/n3FrTdjLdXBUo693JOlKq2/XDPwp1PeOeh1ky3CLR3i48BGBIm rOZWqHy7A+GVsVCKVKXxvhJJ0t7EfnkNg5uZsfiVDI2VcuHGrj+VzipgXwoR+REmE8W1Pe qwBDl0V3L/K7RmfF73OJl1Z0QCAyV0Bu2q9bYvA34OlFTsNo26rnyimHUoQW5Y1cKz9MB2 rK7+7aBX8eiJhf95Ynx8HtcHR0fFVNwFu2Z4AcPQSeyrNMZYA9uD0gMCAYtnZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703172072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yeC4WNgIHMdeTN8SxjQ1SKpT8IcW+tAwZO0sA2/Hiys=; b=yDfgYPoANjhzL04RvIMozffc2HFsocYAYohdOvxGFOdwIloMEckf/8vJdBk7Q7u4hErMzk 5+8NiurnMJ668ZGNA0MX6HY3ez3NXiPk+e1nfGHe2qc/5bJ5eLbzea7nJA2TkWB7i6C/9x C5HbsFRlu7b1bQO3Bz7aOjMH95aeFX0tWK8raG12LoOpJtH68/A01Uqq06qsulUxgybfiZ KfU37VNTMsLmp8cGFfmMY1ycHqbVROEN3M/pZQk8DazJF+RG8pOWdRns5NKIp1CrHbLkfV IHHmibXRzxsP2oOiSODx7mU+gDepFpJrIumfbP1nzhrM9Uqu53fa/bQkz15WGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwvK40WKfzdLx; Thu, 21 Dec 2023 15:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLFLBJC043298; Thu, 21 Dec 2023 15:21:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLFLBJx043295; Thu, 21 Dec 2023 15:21:11 GMT (envelope-from git) Date: Thu, 21 Dec 2023 15:21:11 GMT Message-Id: <202312211521.3BLFLBJx043295@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: 6bccb677d06e - stable/13 - ufs: do not leave around empty buffers shadowing disk content List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 6bccb677d06ea15fb34d00b482c77c8f8bf35e19 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6bccb677d06ea15fb34d00b482c77c8f8bf35e19 commit 6bccb677d06ea15fb34d00b482c77c8f8bf35e19 Author: Konstantin Belousov AuthorDate: 2023-12-11 22:57:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-21 15:20:39 +0000 ufs: do not leave around empty buffers shadowing disk content (cherry picked from commit ca39f23347e1416a28dde13279bfe5841ad9a746) --- sys/ufs/ffs/ffs_vnops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index abc1c3524396..21e6e22c6f88 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -969,8 +969,15 @@ ffs_write( * validated the pages. */ if (error != 0 && (bp->b_flags & B_CACHE) == 0 && - fs->fs_bsize == xfersize) - vfs_bio_clrbuf(bp); + fs->fs_bsize == xfersize) { + if (error == EFAULT && LIST_EMPTY(&bp->b_dep)) { + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + brelse(bp); + break; + } else { + vfs_bio_clrbuf(bp); + } + } vfs_bio_set_flags(bp, ioflag); From nobody Thu Dec 21 15:21:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwvK52l1Tz54vQb; Thu, 21 Dec 2023 15:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwvK51pZXz3DLZ; Thu, 21 Dec 2023 15:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703172073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKxe7+TOdjNrAmGWaogYo/f6dPAiU9HKXRvZERdeiz8=; b=HujLgkCNHHuxxjK6oHxLR/RFyoFqV23uVYMvVvKtdBYg5SkZPZ2YLwmaI4FhBTKkh/8ivr tSglZhvkc4Lzi2ccCiA8977Uh+nGUSYYZdYCW5ot911X/SGaewBOaczlX7yCVnAZcEbofQ szz7gud8hPmIKgPsEwPd2yrWjNsgSKriU8xEjtt0MO3dlTMkHGJRaXBE7d6TPGpDOKtX/R sUT4MqJfHRCaCZiPQU4yGS5QhVvSebz1Xd2vO25cLbqV6YB+8ZUZVnspm8cUMABd/mE5tV khvQmdlbbBjEmhv2vt/kEgsgANOFkOotTtJ/8DgtjG1S4lhxuoVJ6u1ba0HURA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703172073; a=rsa-sha256; cv=none; b=Upwa8nbIx5CuBOJjOmJXM2AxLUYma16fLFz/ablcLUvQIPG2ag7+UylTSEYJiwGa9r608v Wxj6h7frDYR8UcDi2SeJjMRnFSZCdGXCwnrqi79nx6Cbv48ZNusS1jrTGRXuue3CrNb2gO IPgMLZYUzpNc3ofZuQ+aNq6nvD6bOFXhmKvv/46GH6f1hn5Qo2SSpA6P2FIYZAV2mGk34m qojdVmxFaCQoxX1GB6P/2Q8lhKhpZLDFUP3tJEDTV4bkFCWDCRbw30wgKf0h3ttVvb4Zcn liFiCjirhDM55buCqxP8JI1IY+M5mc6BSpnNOXXm2qnq5jKPaX6RBbGvNnvi2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703172073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKxe7+TOdjNrAmGWaogYo/f6dPAiU9HKXRvZERdeiz8=; b=LxTvdqgopy1+BEG0dvylsllH5azgrzKkJ59tO5sFIpsrhhJigN5bpECXfkGHUOBDFW57uu gyBHJdFafRFGi8Pw43rqtH4qR0oVCMtFmaGW/LnHB2RvieeQfm0oyT3Rr6rxho6YTLbE54 NtQ15Qtyy1tCdmvNIjlfh/jyS/p9+/UeflUq3Yg1lWXABl+5REJdYdHc5WaaLNFEAnxX0e 4xqRdCtYHb3pQbOWipzVniBrhoB3MgsrXgVtVjPX89G+TYZeUpWhFPQXLqFA+SbMbgcEoX DHwGRtWuP5o+1xl5AhfJ3XXrEZ0uiK2M6bTfE//rrsVg1BCxcmIx/j4Ck9SaUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwvK50vbLzdCs; Thu, 21 Dec 2023 15:21:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLFLDVX043359; Thu, 21 Dec 2023 15:21:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLFLDS7043356; Thu, 21 Dec 2023 15:21:13 GMT (envelope-from git) Date: Thu, 21 Dec 2023 15:21:13 GMT Message-Id: <202312211521.3BLFLDS7043356@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: 98693e7a99c4 - stable/13 - libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 98693e7a99c489e7f095c3600c974b0f61a060f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=98693e7a99c489e7f095c3600c974b0f61a060f1 commit 98693e7a99c489e7f095c3600c974b0f61a060f1 Author: Peter Eriksson AuthorDate: 2023-12-17 22:03:13 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-21 15:20:39 +0000 libc: correct some memory leaks in acl_to_text(3) and acl_to_text_np(3) PR: 275232 (cherry picked from commit 7aa375dcc61e48cc56da45c9d5a11371693c8043) --- lib/libc/posix1e/acl_to_text_nfs4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/posix1e/acl_to_text_nfs4.c b/lib/libc/posix1e/acl_to_text_nfs4.c index 522ebe3d4373..8a4783736aa6 100644 --- a/lib/libc/posix1e/acl_to_text_nfs4.c +++ b/lib/libc/posix1e/acl_to_text_nfs4.c @@ -73,6 +73,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "user:%d", (unsigned int)*id); else snprintf(str, size, "user:%s", pwd->pw_name); + acl_free(id); break; case ACL_GROUP_OBJ: @@ -92,6 +93,7 @@ format_who(char *str, size_t size, const acl_entry_t entry, int numeric) snprintf(str, size, "group:%d", (unsigned int)*id); else snprintf(str, size, "group:%s", grp->gr_name); + acl_free(id); break; case ACL_EVERYONE: @@ -158,6 +160,7 @@ format_additional_id(char *str, size_t size, const acl_entry_t entry) if (id == NULL) return (-1); snprintf(str, size, ":%d", (unsigned int)*id); + acl_free(id); } return (0); From nobody Thu Dec 21 15:31:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwvYL01kSz54vW6 for ; Thu, 21 Dec 2023 15:31:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwvYK5Hjfz3FCC for ; Thu, 21 Dec 2023 15:31:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50e33fe3856so1098811e87.1 for ; Thu, 21 Dec 2023 07:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1703172708; x=1703777508; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lrPfM/b3ARsahhveNgyoFzcS3lDniNCcXxaOT1wFwQM=; b=e9SlRabeisadG/gvhYAOKjZ8g3fCPD1uTfkfvtIqqE+q03BwT7iB0xkj4ZR4U+x9j+ QmtFFO1cA429XD7EHL+WBvPeUWHy3foL5YM4AP5i9tFxmbbNezsUku3naY4BIRKhsZgx SI55oT8iddMWQLH4S2W44VNgHgjXJFC3oReihI6iYH2tP7pMn+OScwklACR4E1HePMKg Be7rwktZiM2IDxPKWulwfQxG2Ni69f4pD/67le2rA1FNvcPLm9z2xkpO9yLw7c0uO9kU /Swzh7tFbyzUx/3ZppX+83VceQECjCUJGVQPR6oz7YCo/QBF5r0gXcLNdK/rO/idiILR POkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703172708; x=1703777508; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lrPfM/b3ARsahhveNgyoFzcS3lDniNCcXxaOT1wFwQM=; b=pXX1Fg10hDlDlC/mK+DvsM25ipDxPyEbPozRuSGraC1CzOr82IOVnBqwmkHCxKWWiH GXGCW1xW3w9VzvQVCgCnqv8ddFIoKDBEud1jBMfWnE/QTBAgp5E7WaxhHz/17aqBLXVc 39DL/2Q4TnQupR9m0lLYwUnrfaQXYzYVQGwxBORwogsXrwhRfGdDDUFM41O+qAnGyN6B ESCvDR7E0VGRCvbuTBsnoFfoyo5W0MMUEAn9HX5TJXkhOpVwEK65SSg6jAB9A4hF/9/X g1TqbJK+Y2FsIARF44zhjW5CO3wcuqsGpLWgPJD4l+dx6/MC+vCFzi2IRUiRxasBs7qw 8BGA== X-Gm-Message-State: AOJu0YxwWVepFlzonQ1gjM5/+6Q3tp6OFcnk+poe/kNbPO9DxHEUy8Fb ZlmAxUDvT0FT+jGCfLiIh9RwUdmOGid2bPa2M2kaRA== X-Google-Smtp-Source: AGHT+IHQQPFScrDB9ZiylUmdon2XtmQ+sIi1cGYaK2zObYZ+f9IG+Et8P9MLjZ75qEET/uoDkb7UrdJfvfDL6WaI5hU= X-Received: by 2002:ac2:5f5b:0:b0:50e:2ab0:3c45 with SMTP id 27-20020ac25f5b000000b0050e2ab03c45mr2491787lfz.74.1703172707394; Thu, 21 Dec 2023 07:31:47 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202312210421.3BL4Lb9T036317@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 21 Dec 2023 08:31:36 -0700 Message-ID: Subject: Re: git: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned To: Mark Johnston Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000374067060d06cc61" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SwvYK5Hjfz3FCC --000000000000374067060d06cc61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023 at 8:13=E2=80=AFAM Mark Johnston w= rote: > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4e= 9188a2ba4 > > > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > > Author: Warner Losh > > AuthorDate: 2023-12-20 19:09:09 +0000 > > Commit: Warner Losh > > CommitDate: 2023-12-21 04:16:45 +0000 > > > > vtnet: Adjust rx buffer so IP header 32-bit aligned > > > > Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them= . > > This improves performance everywhere, and allows armv7 to work at > all. > > > > PR: 271288 (PR had a different fix than I wound > up with) > > MFC After: 3 days > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D43136 > > --- > > sys/dev/virtio/network/if_vtnet.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/sys/dev/virtio/network/if_vtnet.c > b/sys/dev/virtio/network/if_vtnet.c > > index 287af7751066..360176e4f845 100644 > > --- a/sys/dev/virtio/network/if_vtnet.c > > +++ b/sys/dev/virtio/network/if_vtnet.c > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int > nbufs, struct mbuf **m_tailp) > > m_freem(m_head); > > return (NULL); > > } > > - > > m->m_len =3D size; > > + m_adj(m, ETHER_ALIGN); > > The driver is expecting to get a cluster of size sc->vtnet_rx_clustersz, > but now it's getting one of size sc->vtnet_rx_clustersz - 2. I don't > see how this change can be sufficient on its own: what prevents virtio > from writing sc->vtnet_rx_clustersz bytes and thereby overwriting the > two bytes following the cluster? > The only trouble that I saw was here: /* * Every mbuf should have the expected cluster size since that * is also used to allocate the replacements. */ KASSERT(m->m_len =3D=3D clustersz, ("%s: mbuf size %d not expected cluster size %d", __func__, m->m_len, clustersz)); and even that's fine: We can adjust that assert. The next lines I think make it fine: m->m_len =3D MIN(m->m_len, len); so we only use what we say is there to land bytes into the mbuf. I'm now not sure though what to do about a few lines later: m_new =3D vtnet_rx_alloc_buf(sc, nreplace, &m_tail); if (m_new =3D=3D NULL) { m_prev->m_len =3D clustersz; return (ENOBUFS); } which likely needs to be adjusted (or the old saved size). I likely didn't see asserts in my testing because I didn't have LRO slow path packets. Do you see other places that would need adjusting? All the other places seem to use m_len correctly on the rx path, but I'm not a nic driver guy, and I might be missing something. Warner > > if (m_head !=3D NULL) { > > m_tail->m_next =3D m; > > m_tail =3D m; > --000000000000374067060d06cc61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



=
= On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4<= /a>
>
> commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-12-20 19:09:09 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-12-21 04:16:45 +0000
>
>=C2=A0 =C2=A0 =C2=A0vtnet: Adjust rx buffer so IP header 32-bit aligned=
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Call madj(m, ETHER_ALIGN) to offset rx buffers when= allocating them.
>=C2=A0 =C2=A0 =C2=A0This improves performance everywhere, and allows ar= mv7 to work at all.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0271288 (PR had a different fix than I wound up = with)
>=C2=A0 =C2=A0 =C2=A0MFC After:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 3 days
>=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0Netflix
>=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0
https://revie= ws.freebsd.org/D43136
> ---
>=C2=A0 sys/dev/virtio/network/if_vtnet.c | 2 +-
>=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/networ= k/if_vtnet.c
> index 287af7751066..360176e4f845 100644
> --- a/sys/dev/virtio/network/if_vtnet.c
> +++ b/sys/dev/virtio/network/if_vtnet.c
> @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int n= bufs, struct mbuf **m_tailp)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0m_freem(m_head);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return (NULL);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> -
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m->m_len =3D = size;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m_adj(m, ETHER_ALIGN)= ;

The driver is expecting to get a cluster of size sc->vtnet_rx_clustersz,=
but now it's getting one of size sc->vtnet_rx_clustersz - 2.=C2=A0 I= don't
see how this change can be sufficient on its own: what prevents virtio
from writing sc->vtnet_rx_clustersz bytes and thereby overwriting the two bytes following the cluster?

The on= ly trouble that I saw was here:

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Every mbuf should have the expected clu= ster size since that
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0* is also used to allocate the replacements.
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 KASSERT(m->m_len =3D=3D clustersz,=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (&qu= ot;%s: mbuf size %d not expected cluster size %d", __func__,
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 m->m_len= , clustersz));

and even that's fine: We ca= n adjust that assert. The next lines I think make it fine:
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 m->m_len =3D MIN(m->= ;m_len, len);

so we only use what we say is th= ere to land bytes into the mbuf.=C2=A0 I'm now not sure though what to = do about a few lines later:

=C2=A0 =C2=A0 =C2=A0 = =C2=A0m_new =3D vtnet_rx_alloc_buf(sc, nreplace, &m_tail);
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 if (m_new =3D=3D NULL) {
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 m_prev->m_len =3D clustersz;
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (ENOBUFS);
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 }

which likely needs = to be adjusted (or the old saved size).

I likely d= idn't see asserts in my testing because I didn't have LRO slow path= packets.

Do you see other places that would need = adjusting? All the other places seem to use m_len correctly on the rx path,= but I'm not a nic driver guy, and I might be missing something.
<= div>
Warner

=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (m_head !=3D = NULL) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0m_tail->m_next =3D m;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0m_tail =3D m;
--000000000000374067060d06cc61-- From nobody Thu Dec 21 15:51:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swvzv1SdHz54wPH; Thu, 21 Dec 2023 15:51: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swvzv120Bz3J04; Thu, 21 Dec 2023 15:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703173883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUE9f7XnU8qjOSJ4lX62LR/799h/qcqIty0ZN9uaVwo=; b=MF8GXQjj1CzvXyigpQvkzaaWg5CgMazvtTtB/NQ5CJOIrj+y070Ra3goMhrwAaELW20VI0 wPJDm1Gz2yKgWrrh7Lem5VrOMre/nd+0izwUtkVbJFnkKGZjXtZ+TWtHDsrZHgfrNX3OV3 7isnTyURmGpfq20xUrtAlVTXiIslKwItXap1uUmJcCOlS+xdFqK9jDjZtFneX0WY8VAWzN WaDnP7taYW05P/Sut9LDoxOiX1E5ZrB65f2tRCpsabOSkkeD95/amuJeK3PIBRGht2xHmO dnTHlc0CPSLiGPhr4sCJM3N2HF+88MG5MNWrnYM+lCURMPgSBo+qClolhEIr8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703173883; a=rsa-sha256; cv=none; b=LduaNBhr0PpBj6qd0m7Z8Q5tcX39S8LtKI9hcK5T0ivnjuLhqkj0W5GgEhNaK71QdJJszK /imSw73aBA6qVbp/YjmKuZ1PdZ156lZv2N+oYJ9oFLH6Kh7mmHRIMlVXr0CnOO8/lkN73k Z5/gv6yAqUDfOeKf6He5e2tfqomOGR03vI/B7+KqNL1j1uzvWylbcOWE45z6lGvC/4K3Gp Wan2SLDiZOvoO2D8SdQfdVv3yUCnhbNcVwjl8p6X8I+saAzJgh1oevz7ta1t3lJFfCrSo2 TMfKzvoHwdbVvqhA4stOmTsLwZm9zSuuTnEMQsIUI553a/ODaANiPUOQ/gXiJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703173883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cUE9f7XnU8qjOSJ4lX62LR/799h/qcqIty0ZN9uaVwo=; b=ZEmFkywvcxDoj3z1IIyHKiURSDPtfR2gPgGB/uAWtcyHl2Nm8KzetVtU0ajh3mdf0uCn6x t9FPcFMqDpH5PLsshOcEIqL/2maDkJd6zNXXOBE8l0m0x4P6bMxmgmjxVqgI94irMqWX+o Nmqge/FxdASSY2x19OkyIpiOF8+aFI8ewxPTrBe7B+JEz4Ny14t5zX+TLQ7ez5cQilmq80 ToaPoddrYaxkBntLKlNKKQydyJqx/uTD1CK/1Nc9tPAUumpravM9dj41yvTc0HbrBIBKIu kJpP91Lsp097fU1s1oS2Q6TTycXynIYRtMuknVgDXppuHq+JbNUXS/Yuxr4gTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swvzt6wGbzf6M; Thu, 21 Dec 2023 15:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLFpMvR093608; Thu, 21 Dec 2023 15:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLFpM2e093605; Thu, 21 Dec 2023 15:51:22 GMT (envelope-from git) Date: Thu, 21 Dec 2023 15:51:22 GMT Message-Id: <202312211551.3BLFpM2e093605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Gmelin Subject: git: 3d36053ca6d6 - main - libifconfig: Fix bridge status member list List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d36053ca6d6a17d408c8f92c504e6135dc9d8df Auto-Submitted: auto-generated The branch main has been updated by grembo: URL: https://cgit.FreeBSD.org/src/commit/?id=3d36053ca6d6a17d408c8f92c504e6135dc9d8df commit 3d36053ca6d6a17d408c8f92c504e6135dc9d8df Author: Michael Gmelin AuthorDate: 2023-12-20 20:21:55 +0000 Commit: Michael Gmelin CommitDate: 2023-12-21 15:50:27 +0000 libifconfig: Fix bridge status member list When this functionality was moved to libifconfig in 3dfbda3401abea84da9, the end of list calculation was modified for unknown reasons, practically limiting the number of bridge member returned to (about) 102. This patch changes the calculation back to what it was originally and adds a unit test to verify it works as expected. Reported by: Patrick M. Hausen (via ML) Reviewed by: kp Approved by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43135 --- lib/libifconfig/libifconfig_bridge.c | 2 +- tests/sys/net/if_bridge_test.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/libifconfig/libifconfig_bridge.c b/lib/libifconfig/libifconfig_bridge.c index e4db90f373d6..2a9bbc35858b 100644 --- a/lib/libifconfig/libifconfig_bridge.c +++ b/lib/libifconfig/libifconfig_bridge.c @@ -111,7 +111,7 @@ ifconfig_bridge_get_bridge_status(ifconfig_handle_t *h, free(bridge); return (-1); } - if (members.ifbic_len <= len) + if ((members.ifbic_len + sizeof(*members.ifbic_req)) < len) break; } if (buf == NULL) { diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index cf0c81d6f682..44370a905223 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -663,6 +663,33 @@ vlan_cleanup() vnet_cleanup } +atf_test_case "many_bridge_members" "cleanup" +many_bridge_members_head() +{ + atf_set descr 'many_bridge_members ifconfig test' + atf_set require.user root +} + +many_bridge_members_body() +{ + vnet_init + + bridge=$(vnet_mkbridge) + ifcount=256 + for _ in $(seq 1 $ifcount); do + epair=$(vnet_mkepair) + ifconfig "${bridge}" addm "${epair}"a + done + + atf_check -s exit:0 -o inline:"$ifcount\n" \ + sh -c "ifconfig ${bridge} | grep member: | wc -l | xargs" +} + +many_bridge_members_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -677,4 +704,5 @@ atf_init_test_cases() atf_add_test_case "gif" atf_add_test_case "mtu" atf_add_test_case "vlan" + atf_add_test_case "many_bridge_members" } From nobody Thu Dec 21 15:53:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sww2x4Q2nz54wPR; Thu, 21 Dec 2023 15:54:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sww2w6f2Lz3JWj; Thu, 21 Dec 2023 15:54:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7811db57cb4so59129085a.0; Thu, 21 Dec 2023 07:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703174040; x=1703778840; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=lAgGOBL3v9bbphEGuE/fAKgEPnyjUFURn9U+FBKtj78=; b=crW0hT886UhhtqTXg+f/8WjR2EdK2v4TU7dnDv4Hs/+OXIgMBctncvifdxT1vwUEYK QotZFQTypONg7xSp1iBflpB4oH7ELr5+LXBfpaMOlMP6N+ue/22RxrSD4GbrpUSUntil dcCwHdUrhVwH7Nc0V8cYFPgBF+EGBFfsEAGrRyxYHyuQdyOjiuyKLTWqW3usQAPur7uI uSCeJLiwXbxwyCvXSZQu7zvkdIIw3etquJOKBMzpOIxicobqb55FmMy6JcQo5QsjwiIm 5imKqffwrCX2jb5KqrGOJaTofkns0BPBEftfnfoMTSvucrk2ebi4qs2sXYxST7jXvqu9 5ixQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703174040; x=1703778840; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lAgGOBL3v9bbphEGuE/fAKgEPnyjUFURn9U+FBKtj78=; b=sgyDK05RpDiOU8Flvf4+IDTCOP93gV4QjxM9jF4HvwWo5CJN7Qcz2WIIJBen7Ur6jI fefZdgXu0IT8PzvxZOxtYfRHrSlQiD2/ae+Jpw5JiNVxXRABdTSrIrXhti6slKscYX1l F0tYFwfJ+gNRe9ydUCsc9fL/KgY6uazfUQuXOFnbfyOoa81OByoOPFxnpIgLbt0egSth x1MncDasb9TL+14tk8WSmCNQEdJetGnZTbpjWxan8lY+p5rGBz5OuhF11ARG78TNoR7r J74tGFSsnDT7gwXPzq36bZ0m9IspK/tu0Qw+21Mejl0bgz423sXaMzvAC/tkkKz7hmmX dXHQ== X-Gm-Message-State: AOJu0YzEjoVrYYZmIzbDSCIfEYYCel4bHVe6Fm5WTSa0uLNaKaOWHZss R5jcJM96ZW1/ukwRWSN1KODySIo9uQsfgw== X-Google-Smtp-Source: AGHT+IE6vSyPhZmxOgSNZ/aEoDeLyaa5MiXcGotOt7eNQcj1uO/furMqcKsXlC8hhu8lrAB4Gwr+qw== X-Received: by 2002:a05:620a:29d1:b0:77f:746d:2f61 with SMTP id s17-20020a05620a29d100b0077f746d2f61mr1425050qkp.1.1703174039781; Thu, 21 Dec 2023 07:53:59 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id o4-20020a05620a110400b0078105826d55sm739933qkk.74.2023.12.21.07.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 07:53:58 -0800 (PST) Date: Thu, 21 Dec 2023 10:53:56 -0500 From: Mark Johnston To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned Message-ID: References: <202312210421.3BL4Lb9T036317@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Sww2w6f2Lz3JWj On Thu, Dec 21, 2023 at 08:31:36AM -0700, Warner Losh wrote: > On Thu, Dec 21, 2023 at 8:13 AM Mark Johnston wrote: > > > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote: > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > > > > > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > > > Author: Warner Losh > > > AuthorDate: 2023-12-20 19:09:09 +0000 > > > Commit: Warner Losh > > > CommitDate: 2023-12-21 04:16:45 +0000 > > > > > > vtnet: Adjust rx buffer so IP header 32-bit aligned > > > > > > Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them. > > > This improves performance everywhere, and allows armv7 to work at > > all. > > > > > > PR: 271288 (PR had a different fix than I wound > > up with) > > > MFC After: 3 days > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D43136 > > > --- > > > sys/dev/virtio/network/if_vtnet.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/sys/dev/virtio/network/if_vtnet.c > > b/sys/dev/virtio/network/if_vtnet.c > > > index 287af7751066..360176e4f845 100644 > > > --- a/sys/dev/virtio/network/if_vtnet.c > > > +++ b/sys/dev/virtio/network/if_vtnet.c > > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int > > nbufs, struct mbuf **m_tailp) > > > m_freem(m_head); > > > return (NULL); > > > } > > > - > > > m->m_len = size; > > > + m_adj(m, ETHER_ALIGN); > > > > The driver is expecting to get a cluster of size sc->vtnet_rx_clustersz, > > but now it's getting one of size sc->vtnet_rx_clustersz - 2. I don't > > see how this change can be sufficient on its own: what prevents virtio > > from writing sc->vtnet_rx_clustersz bytes and thereby overwriting the > > two bytes following the cluster? > > > > The only trouble that I saw was here: > > /* > * Every mbuf should have the expected cluster size since > that > * is also used to allocate the replacements. > */ > KASSERT(m->m_len == clustersz, > ("%s: mbuf size %d not expected cluster size %d", > __func__, > m->m_len, clustersz)); > > and even that's fine: We can adjust that assert. The next lines I think > make it fine: > m->m_len = MIN(m->m_len, len); > > so we only use what we say is there to land bytes into the mbuf. I'm now > not sure though what to do about a few lines later: > > m_new = vtnet_rx_alloc_buf(sc, nreplace, &m_tail); > if (m_new == NULL) { > m_prev->m_len = clustersz; > return (ENOBUFS); > } > > which likely needs to be adjusted (or the old saved size). I'm not certain about what it should be doing instead, but yes this code looks wrong now. > I likely didn't see asserts in my testing because I didn't have LRO slow > path packets. > > Do you see other places that would need adjusting? Presumably vtnet_rx_cluster_size() needs to be adjusted too? I also don't understand why we do this adjustment unconditionally instead of only when __NO_STRICT_ALIGNMENT is not defined, as almost all other NIC drivers do. > All the other places > seem to use m_len correctly on the rx path, but I'm not a nic driver guy, > and I might be missing something. From nobody Thu Dec 21 16:53:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwxMN20fCz550cj for ; Thu, 21 Dec 2023 16:53:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwxMN08zhz3PlP for ; Thu, 21 Dec 2023 16:53:20 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-55370780c74so1210442a12.1 for ; Thu, 21 Dec 2023 08:53:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1703177597; x=1703782397; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3SiH5TwXpxn0G8RhsmOaPmvyOsgheDE+zkydkmnAfr4=; b=ZL+ujJCNy771CJER1ZBGBo7Utv4/1Wjrhhp3E1jPSyyr8wmJsLx8iRgV4qeKQKtSaC IgTVxnTYMEZF4bI7eE6pY1KqkTNnejgGFrWJv5MCSgiYOOzEIoJuDwZB2DLfnuipaHTW NdeTUBvAj8zPlBHky3xCw/d5Q8A5kYe8zB5JTPfUUu12J08WWOElGV5BHnK9mqBa9p+s DP8gixQtE9YqTMVBE9pMkhNEu5t2UPKvAgHdYdohdZ55r8lQ0Zq9VIWbIS9XN/QSBQzK H97TiwIWdtyaC/aV0iYbcmI5aUBNYF6f3DiIGBsK6HDEgztmSfnVS2tsr/MualRWCLgh TKVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703177597; x=1703782397; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3SiH5TwXpxn0G8RhsmOaPmvyOsgheDE+zkydkmnAfr4=; b=gIIwvuZs42iqr/PRONNxhxvHX0eE1efKR0a1ZByKGFkat6FqygmECIfwQQh/VP+lOD OEt3AElOYcHjKJxwrs5F7yAzv85l04MRHI+5H+mtPwaYpwBw5FJZlGMD5TbRQsvMkPsW +39Gdc60SOskmXmj/4vTvAMNQvP+TzvYWWLQ5J/oMsXVCg8qutjwJugEegoxSzXltYSi zHJFGSG+etXGjg2/BhsXjSvvVKS9QTtIIWY110g0kZuksLmf5vmJ5jVvcOT7dAVcUVtp q/u/bApHyVYahthhSmXXw9G59loyuDl1NbUK9eGLbGDiTPkV8mWlINATtFNN41vFIZvu k/RQ== X-Gm-Message-State: AOJu0YxmU47CA4p14s1GHtE4h4la+TMdMhRcjIO7HLByJfzarXbPMpA8 B6C3/2m7eNPUGw5cvWAvJOxC6iBYHmfW5HMm34VAPhMAgXAKpQ== X-Google-Smtp-Source: AGHT+IF99LuiRyBup7uq9Cxbp1Gok3NHtXWc1rXm4pFuGBRTd8+7HbCb+/KmsjvsElv1YFuyFCkJbg8vHWgnV0wGq/U= X-Received: by 2002:a17:906:3b0d:b0:a23:f86:f2c4 with SMTP id g13-20020a1709063b0d00b00a230f86f2c4mr45653ejf.67.1703177597559; Thu, 21 Dec 2023 08:53:17 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202312210421.3BL4Lb9T036317@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 21 Dec 2023 09:53:05 -0700 Message-ID: Subject: Re: git: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned To: Mark Johnston Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000b137bf060d07efbc" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SwxMN08zhz3PlP --000000000000b137bf060d07efbc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023, 8:54=E2=80=AFAM Mark Johnston wro= te: > On Thu, Dec 21, 2023 at 08:31:36AM -0700, Warner Losh wrote: > > On Thu, Dec 21, 2023 at 8:13=E2=80=AFAM Mark Johnston wrote: > > > > > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote: > > > > The branch main has been updated by imp: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4e= 9188a2ba4 > > > > > > > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 > > > > Author: Warner Losh > > > > AuthorDate: 2023-12-20 19:09:09 +0000 > > > > Commit: Warner Losh > > > > CommitDate: 2023-12-21 04:16:45 +0000 > > > > > > > > vtnet: Adjust rx buffer so IP header 32-bit aligned > > > > > > > > Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating > them. > > > > This improves performance everywhere, and allows armv7 to work = at > > > all. > > > > > > > > PR: 271288 (PR had a different fix than I > wound > > > up with) > > > > MFC After: 3 days > > > > Sponsored by: Netflix > > > > Differential Revision: https://reviews.freebsd.org/D43136 > > > > --- > > > > sys/dev/virtio/network/if_vtnet.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/sys/dev/virtio/network/if_vtnet.c > > > b/sys/dev/virtio/network/if_vtnet.c > > > > index 287af7751066..360176e4f845 100644 > > > > --- a/sys/dev/virtio/network/if_vtnet.c > > > > +++ b/sys/dev/virtio/network/if_vtnet.c > > > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, in= t > > > nbufs, struct mbuf **m_tailp) > > > > m_freem(m_head); > > > > return (NULL); > > > > } > > > > - > > > > m->m_len =3D size; > > > > + m_adj(m, ETHER_ALIGN); > > > > > > The driver is expecting to get a cluster of size > sc->vtnet_rx_clustersz, > > > but now it's getting one of size sc->vtnet_rx_clustersz - 2. I don't > > > see how this change can be sufficient on its own: what prevents virti= o > > > from writing sc->vtnet_rx_clustersz bytes and thereby overwriting the > > > two bytes following the cluster? > > > > > > > The only trouble that I saw was here: > > > > /* > > * Every mbuf should have the expected cluster size sin= ce > > that > > * is also used to allocate the replacements. > > */ > > KASSERT(m->m_len =3D=3D clustersz, > > ("%s: mbuf size %d not expected cluster size %d", > > __func__, > > m->m_len, clustersz)); > > > > and even that's fine: We can adjust that assert. The next lines I think > > make it fine: > > m->m_len =3D MIN(m->m_len, len); > > > > so we only use what we say is there to land bytes into the mbuf. I'm n= ow > > not sure though what to do about a few lines later: > > > > m_new =3D vtnet_rx_alloc_buf(sc, nreplace, &m_tail); > > if (m_new =3D=3D NULL) { > > m_prev->m_len =3D clustersz; > > return (ENOBUFS); > > } > > > > which likely needs to be adjusted (or the old saved size). > > I'm not certain about what it should be doing instead, but yes this code > looks wrong now. > Yea. We need to do this at time of use not time of alloc. > I likely didn't see asserts in my testing because I didn't have LRO slow > > path packets. > > > > Do you see other places that would need adjusting? > > Presumably vtnet_rx_cluster_size() needs to be adjusted too? > > I also don't understand why we do this adjustment unconditionally > instead of only when __NO_STRICT_ALIGNMENT is not defined, as almost all > other NIC drivers do. > None of the ones I looked at had this... maybe I got unlucky. I'd think we'd have better performance if things are aligned all the way... is there a reason not to? Warner > > > All the other places > > seem to use m_len correctly on the rx path, but I'm not a nic driver gu= y, > > and I might be missing something. > --000000000000b137bf060d07efbc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Dec 21, 2023, 8:54=E2=80=AFAM Mark Johnston &l= t;markj@freebsd.org> wrote:
=
On Thu, Dec 21, 2023 at 08:31:36AM -07= 00, Warner Losh wrote:
> On Thu, Dec 21, 2023 at 8:13=E2=80=AFAM Mark Johnston <markj@freebsd= .org> wrote:
>
> > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote:
> > > The branch main has been updated by imp:
> > >
> > > URL:
> > https://cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4= e9188a2ba4
> > >
> > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4
> > > Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > AuthorDate: 2023-12-20 19:09:09 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > CommitDate: 2023-12-21 04:16:45 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0vtnet: Adjust rx buffer so IP header 32-b= it aligned
> > >
> > >=C2=A0 =C2=A0 =C2=A0Call madj(m, ETHER_ALIGN) to offset rx bu= ffers when allocating them.
> > >=C2=A0 =C2=A0 =C2=A0This improves performance everywhere, and= allows armv7 to work at
> > all.
> > >
> > >=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0271288 (PR had a different fix than I= wound
> > up with)
> > >=C2=A0 =C2=A0 =C2=A0MFC After:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 3 days
> > >=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0Netflix
> > >=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 https://reviews.freebsd.org/D43136
> > > ---
> > >=C2=A0 sys/dev/virtio/network/if_vtnet.c | 2 +-
> > >=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/sys/dev/virtio/network/if_vtnet.c
> > b/sys/dev/virtio/network/if_vtnet.c
> > > index 287af7751066..360176e4f845 100644
> > > --- a/sys/dev/virtio/network/if_vtnet.c
> > > +++ b/sys/dev/virtio/network/if_vtnet.c
> > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc = *sc, int
> > nbufs, struct mbuf **m_tailp)
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0m_freem(m_head);
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0return (NULL);
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> > > -
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m->= m_len =3D size;
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m_adj(m, ET= HER_ALIGN);
> >
> > The driver is expecting to get a cluster of size sc->vtnet_rx_= clustersz,
> > but now it's getting one of size sc->vtnet_rx_clustersz - = 2.=C2=A0 I don't
> > see how this change can be sufficient on its own: what prevents v= irtio
> > from writing sc->vtnet_rx_clustersz bytes and thereby overwrit= ing the
> > two bytes following the cluster?
> >
>
> The only trouble that I saw was here:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Every = mbuf should have the expected cluster size since
> that
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * is als= o used to allocate the replacements.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KASSERT(m= ->m_len =3D=3D clustersz,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0("%s: mbuf size %d not expected cluster size %d",
> __func__,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0m->m_len, clustersz));
>
> and even that's fine: We can adjust that assert. The next lines I = think
> make it fine:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m->m_l= en =3D MIN(m->m_len, len);
>
> so we only use what we say is there to land bytes into the mbuf.=C2=A0= I'm now
> not sure though what to do about a few lines later:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 m_new =3D vtnet_rx_alloc_buf(sc, nreplace, = &m_tail);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (m_new =3D=3D NULL) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m_prev-&g= t;m_len =3D clustersz;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (E= NOBUFS);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> which likely needs to be adjusted (or the old saved size).

I'm not certain about what it should be doing instead, but yes this cod= e
looks wrong now.

Yea. We need to do this at time of use not time of alloc.

> I likely didn't see asserts in my testing because I didn't hav= e LRO slow
> path packets.
>
> Do you see other places that would need adjusting?

Presumably vtnet_rx_cluster_size() needs to be adjusted too?

I also don't understand why we do this adjustment unconditionally
instead of only when __NO_STRICT_ALIGNMENT is not defined, as almost all other NIC drivers do.

None of the ones I looked at had this... maybe I got u= nlucky. I'd think we'd have better performance if things are aligne= d all the way... is there a reason not to?

Warner

> All the other places
> seem to use m_len correctly on the rx path, but I'm not a nic driv= er guy,
> and I might be missing something.
--000000000000b137bf060d07efbc-- From nobody Thu Dec 21 16:59:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwxVv0fPxz550dc; Thu, 21 Dec 2023 16:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwxVt6mRTz3QT9; Thu, 21 Dec 2023 16:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703177991; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BB6Pt1hvHBEcRZTTRI3OsramhN14a5ikPx7QChmZrY=; b=bRGHkB7vMHefvvPZRhmcLsNPQfw3suUNzL4s2+rbKft0bggkKJbaqiljhX8unHg3cCn+XO dpswayTR75pCL0O1MPwXe9ugXUHqimRZ7eufsow4Zciueyxe93GcmxczCkdlyfU89QL4D5 3+5jw5q2G1Z9aMIKFOb60duwM84HvymbQp4fSnigf1T9KtsqHHY+Vq2Q7eQh3nJBrLiXS7 6t3bnXDwvkogL4pDUh1ebfEH/Lks7KaRsgxB8w+WPM5SI36tgfD03gntKvKOqY0uDW5zjk duUu+uHO9ol9Yus1r3g1GqJbWPYb/6eiLAIJewLLfO1RN2ExsQHK5vIs96qx2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703177991; a=rsa-sha256; cv=none; b=bJ/0QjLnF5Ot+4ZwJTepUUVmIf32CO7lurys8ArGaZybBdAsWG+sa+9teiCRjneu1PQ6UV ykOcRmowTBF1F+fJurYDUXbcTuxK8Y6GZyn2O6cNGWx/2xN2r3zaqHexkBMODAPL7yt3fM 0w0VeKK1I3W1JwbU4GA3OdJP52lj3ixJXhVxES7rmvq24ZM1FJF4clNj9ah1MWQFsad0lZ Db2b2+qlm0KafoY1e8NuvIY+nBJ+eUU9RdZjajJpr8CcCE8Z1M2gbVJktK0wyLR8VrtPmZ 5nsAnZgKaZYTxxNKaY3kV49kCFuAej3TKwRnzrTRTLT0DSxBUFzqeqCZOJERCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703177990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BB6Pt1hvHBEcRZTTRI3OsramhN14a5ikPx7QChmZrY=; b=aDgdP0CV2EimNJOmXf0aM/EEW2SOniZ2P6nOCYMIhLUXR+dpfMp0htoyVLWmF/uCIDvQJw jmxOq3Opd6AcU7q6EUKPfShZZpoEKa97Ya6ajKZzIsCSqdzosDh98tJZtFC/sBWub75l1x noL7rSrRBBwcnyL0O4/fcEh0gVa4yYeH1axzxzhEUnobsnLKPa5T8V1w8qn6aQ9cfLYMQb eXJ2GRVFUB3rXqpnDlErkNcrVY2Vx/4wwWzUsRkAGv7a+U/g0BXsj95dA17TMPQmGjTepD vZGo5/wP2s7nQygRy5I//HXOPEPFZSu469lqf1mPqZfnz8lQI7NpAlaMDBn6uQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwxVt5ny3zgTp; Thu, 21 Dec 2023 16:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLGxoT0099912; Thu, 21 Dec 2023 16:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLGxo9S099909; Thu, 21 Dec 2023 16:59:50 GMT (envelope-from git) Date: Thu, 21 Dec 2023 16:59:50 GMT Message-Id: <202312211659.3BLGxo9S099909@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: bd1654ce9256 - main - freebsd32: Fix error handling for suword32() calls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: bd1654ce92569bbfbe513749db08cdd781b3a036 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd1654ce92569bbfbe513749db08cdd781b3a036 commit bd1654ce92569bbfbe513749db08cdd781b3a036 Author: Mark Johnston AuthorDate: 2023-12-21 16:51:29 +0000 Commit: Mark Johnston CommitDate: 2023-12-21 16:54:05 +0000 freebsd32: Fix error handling for suword32() calls suword32() returns -1 upon an error, not an errno value. MFC after: 1 week --- sys/compat/freebsd32/freebsd32_capability.c | 5 +++-- sys/compat/freebsd32/freebsd32_misc.c | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_capability.c b/sys/compat/freebsd32/freebsd32_capability.c index 82db5da5898a..681e511a59de 100644 --- a/sys/compat/freebsd32/freebsd32_capability.c +++ b/sys/compat/freebsd32/freebsd32_capability.c @@ -117,9 +117,10 @@ freebsd32_cap_ioctls_get(struct thread *td, cmds = fdep->fde_ioctls; if (cmds32 != NULL && cmds != NULL) { for (i = 0; i < MIN(fdep->fde_nioctls, maxcmds); i++) { - error = suword32(&cmds32[i], cmds[i]); - if (error != 0) + if (suword32(&cmds32[i], cmds[i]) != 0) { + error = EFAULT; goto out; + } } } if (fdep->fde_nioctls == -1) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 2f5cf95b4e4a..5aafc459d60a 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2700,9 +2700,8 @@ freebsd32___sysctlbyname(struct thread *td, &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1); if (error != 0) return (error); - if (uap->oldlenp != NULL) - error = suword32(uap->oldlenp, rv); - + if (uap->oldlenp != NULL && suword32(uap->oldlenp, rv) != 0) + error = EFAULT; return (error); } From nobody Thu Dec 21 17:58:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Swyq54lBhz553n0; Thu, 21 Dec 2023 17:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Swyq54JC7z3VLF; Thu, 21 Dec 2023 17:58:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703181537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ocyYb0K5YZPCW/h12/0TPgGcdmI23ZgO8PY3jAj/ek=; b=Y4dgFm/d56B7iwPTUqPJS8qunZ1yPf65ERoJ8+oP56+1SDZKb6tXrrbEJCT02wj46apkGp Eic9BpOplrUYZ+8oI3UNMYPcxz/ex8iGzSEEtCcNiQsjIFCk+vnuJ48MR+YuwB30amfIxh zfroQlwojnq8GW47/eR68ZtXijEGTOyKwAILBwjVa2CJIslwu8YBK2Z9XXlRUd8PLQVrAB otApkhpjwl3XvIBUmqfUuKsTC33+QT00n6sWkd4TcLIifgzHeEf0CrBpDFl8O472HrcCYZ +6dtyayJqlueYxSFdfIhOAtxxygfxzHFQdMQpmdzDxCKOR5++zuSgGZ8CTG7Pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703181537; a=rsa-sha256; cv=none; b=YaVqzyIY+3uu9njMXlpOZHhdjXy9md2WSRe8tgOFA3Gf3Pw4g3+DpY9kNqRDoEnDSwitjH SheAOP6xbeldnmM9jA7f4begThBJvKfJYmf9tC1CB/yg6s8gMdknm/Wz+faFJVlo0znBRk nUXyTGvvWs8f+kdBFqHmHzCO9sx0IgOPF9P+mwyT5tdwTDMCmxsuZhIki9wes+22b3gs9O WjlvJxsxdYRT8qxOkzpsBX1N9/AWi2s5EZrklC+rw4zwO+GEDAzoyccS8F/QEi+l4X3DnX xxhGFVv4IP6SYid6+9J9nbWYc5x0KdzhEjUcakB2tCko+cwib2d3OB4IhScwNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703181537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ocyYb0K5YZPCW/h12/0TPgGcdmI23ZgO8PY3jAj/ek=; b=vBfZwPPuXQmRAYAvoY3jGs7bc+579wv/i1VB7GVRwri1NmIQZO1vlDo42hoY/VFYNwnkeC W02ra0KRkVsUiura/fMmJjTp/Rpj/CjjYij0IvXtBBkJQcYWfmaMFtchbCkKV4QXrkOlEg QnYGDWFWVHDK7nsMpVxu+76fFzg4Y9QSNR1OdfDK4SkWsr0GP/qbG4EA+NlzufCWxOovGb tRzkBTh3VYAepgU+rZHkF3+pb7BFvxm7BuiIVJK5mIKx4WyUJgmqw+n5F7JDbVR+bYwdbd YCTs8GQHTWEpvKXq416UL0CxulNh8Jxs+PBwsGCp47xd/mDpBGxFnbmnLh1eSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Swyq53M4bzjR5; Thu, 21 Dec 2023 17:58:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLHwvQM099361; Thu, 21 Dec 2023 17:58:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLHwvMx099358; Thu, 21 Dec 2023 17:58:57 GMT (envelope-from git) Date: Thu, 21 Dec 2023 17:58:57 GMT Message-Id: <202312211758.3BLHwvMx099358@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: e88e1272792e - main - power*/SYS.h: implement _SYSCALL_BODY() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e88e1272792e41cbf0a5af1f5f0a858afece0475 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e88e1272792e41cbf0a5af1f5f0a858afece0475 commit e88e1272792e41cbf0a5af1f5f0a858afece0475 Author: Brooks Davis AuthorDate: 2023-12-21 17:57:14 +0000 Commit: Brooks Davis CommitDate: 2023-12-21 17:57:14 +0000 power*/SYS.h: implement _SYSCALL_BODY() macro Add _SYSCALL_BODY() macro which invokes the syscall via _SYCALL() and calls cerror as required. Use to implement PSEUDO() and RSYSCALL(). Reviewed by: jhibbits Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43056 --- lib/libc/powerpc/SYS.h | 13 +++++++------ lib/libc/powerpc64/SYS.h | 28 ++++++++++------------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/lib/libc/powerpc/SYS.h b/lib/libc/powerpc/SYS.h index 8c47a65735f5..24315f369531 100644 --- a/lib/libc/powerpc/SYS.h +++ b/lib/libc/powerpc/SYS.h @@ -40,14 +40,17 @@ li 0,(SYS_##name); \ sc +#define _SYSCALL_BODY(name) \ + _SYSCALL(name) \ + bnslr; \ + b CNAME(HIDENAME(cerror)) + #define PSEUDO(name) \ .text; \ .align 2; \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL(name); \ - bnslr; \ - b CNAME(HIDENAME(cerror)); \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define RSYSCALL(name) \ @@ -56,7 +59,5 @@ END(__sys_##name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL(name); \ - bnslr; \ - b CNAME(HIDENAME(cerror)); \ + _SYSCALL_BODY(name); \ END(__sys_##name) diff --git a/lib/libc/powerpc64/SYS.h b/lib/libc/powerpc64/SYS.h index dccd08b63541..bf8bc6cc0e27 100644 --- a/lib/libc/powerpc64/SYS.h +++ b/lib/libc/powerpc64/SYS.h @@ -40,11 +40,7 @@ li 0,(SYS_##name); \ sc -#define PSEUDO(name) \ - .text; \ - .align 2; \ -ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ +#define _SYSCALL_BODY(name) \ _SYSCALL(name); \ bnslr; \ mflr %r0; \ @@ -55,7 +51,14 @@ ENTRY(__sys_##name); \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ mtlr %r0; \ - blr; \ + blr + +#define PSEUDO(name) \ + .text; \ + .align 2; \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define RSYSCALL(name) \ @@ -64,16 +67,5 @@ END(__sys_##name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL(name); \ - bnslr; \ - \ - mflr %r0; \ - std %r0,16(%r1); \ - stdu %r1,-48(%r1); \ - bl CNAME(HIDENAME(cerror)); \ - nop; \ - addi %r1,%r1,48; \ - ld %r0,16(%r1); \ - mtlr %r0; \ - blr; \ + _SYSCALL_BODY(name); \ END(__sys_##name) From nobody Thu Dec 21 18:15:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwzBD07GWz554rL; Thu, 21 Dec 2023 18:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwzBC6jbfz3Wk2; Thu, 21 Dec 2023 18:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8FRkMmlNkmIfWbbVD5tug24BVkM5gioiNS1Qt6ZfW0=; b=h4BsqO+M5ffPMAfEvA+2NuFh5HQnJ4rywkhLFZc0neT7ZEkFxA1dWO0LMUm029r2fISdxc 7N63d6WU/Sb+/6Qdy955GF2FFOPwhVj4O9+DYCoLhQQvzM4SHW6DmA60xKDPSyjyNtEvsX 06es4wuusWwJX0J8aAcDqyyBER1pXqcBIlIsHVsbnv2NxY+fDakwvjg14j/nEn7MsKZWnl ypevVYGHPeMGuOLPm24G35yDSqYwSz1YrB1yW9hFhT+RIYJZL7llp2SuD4Fn/vWadmVn0L 3LrT2sPVbDb3A70+J/eGzLCkXx7T8dCz4ZPWPC/Swy3JDsJ3ss/A2yQaLNSEhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703182531; a=rsa-sha256; cv=none; b=xWgz2NX4a+KA75HHoXobDtaNFt/k67JsOVXQTjF5eMwJtszC/zxtPxo4ugqFwo5hBs4SCT +5zBDXBRq0TcWHVZEwkMUzn/usX8eOEthmmkmAAU6o1UfZ3RYQMErt+6KA+9zZwOcdEcas 2MRmgIQdnqVtwFTBjCsp+emw8+Vs7zv9y1G17NMkt7/HB5HLhgfNWqj3dqTlBbvWYAkQCI 0/70kr6lG/1w+nVItCW1AGpNVS22HldKWlpcMu1ZMTy4z/jhEJEScKvSFFtzqysCmm4uk1 8vb7l8MCtP54FbOnYnSSoWLenxt9bSM7n0N9sLhmqvUgBuwBv5/l0fKKwsWTzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g8FRkMmlNkmIfWbbVD5tug24BVkM5gioiNS1Qt6ZfW0=; b=uzainVxpCWw0bnixt6Mvv/C0OA3ELgZCC4voox9mQdWfCVE6qOsLsJdYCp1uTXERh8jluV 3JcE16jWNCmPcCSfrdeIvRM9bchp8wufpdNSKs+/90/WewdSqHpeJ4/hHNEk2bGGPqtYem zpEHOcfcPCKkpA0mn7Mcozo4qcaSQ/IJGTj/j1wNF1/k92lvqgs/0OkSa+CCiHvDwEfvAJ /smirr0C4Txx6rX7DR2PL165M+yhcx01rcOgjOaXagaYj16Vs6Rxn3iSVEIlx/dpYqZvfK Bil/hSu1kfAzBtuxkShf7Izw6e9HjVdaJY+LrM9DstMi7VpFSp8GJ6Aw+NSLNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwzBC5mVGzjsZ; Thu, 21 Dec 2023 18:15:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIFVvt033625; Thu, 21 Dec 2023 18:15:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIFVLi033622; Thu, 21 Dec 2023 18:15:31 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:15:31 GMT Message-Id: <202312211815.3BLIFVLi033622@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: 330089470f56 - main - nanobsd: Fix the fix to a 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 330089470f56d502c629352b85e11522691e3368 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=330089470f56d502c629352b85e11522691e3368 commit 330089470f56d502c629352b85e11522691e3368 Author: Gleb Smirnoff AuthorDate: 2023-12-21 18:13:44 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-21 18:13:44 +0000 nanobsd: Fix the fix to a typo Submitted by: jlduran@gmail.com Reviewed by: imp, glebius, emaste PR: 275691 Differential Revision: https://reviews.freebsd.org/D43035 Fixes: d8c70d6dfb65218dd3272b34512083621d3ed46d --- tools/tools/nanobsd/defaults.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/defaults.sh b/tools/tools/nanobsd/defaults.sh index 1fa7a74fd27b..165c967de807 100755 --- a/tools/tools/nanobsd/defaults.sh +++ b/tools/tools/nanobsd/defaults.sh @@ -884,7 +884,7 @@ export_var ( ) { # Don't wawnt a subshell # Call this function to set defaults _after_ parsing options. # dont want a subshell otherwise variable setting is thrown away. set_defaults_and_export ( ) { - : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}${NANO_LAYOUT}:+.${NANO_LAYOUT}} + : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}${NANO_LAYOUT:+.${NANO_LAYOUT}}} : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} : ${NANO_DISKIMGDIR:=${NANO_OBJ}} : ${NANO_WORLDDIR:=${NANO_OBJ}/_.w} From nobody Thu Dec 21 18:17:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwzDn3vV2z554v1; Thu, 21 Dec 2023 18:17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwzDn3S9Cz3Y4v; Thu, 21 Dec 2023 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mSVagYTHvCGXKGwwsB5jyYxFnp29QffP9+7GRAegtCM=; b=RYb3rK6Mi8y708HjKPpFUhsJ3Dw1s3nMQRgzjl8D0RvT9t39Fq+nDMK7Bqq1E1ogDQbyJ+ DtKIKzQ6tTioSAecrHVGEgp8v+cHiiRnifSjid8ESmE2cArFp1EvmTOLt2IcAsE469yBOt o3xp6xS90bJYK943CQVdj/TZ+wMMwdeobeWvOqyGqmMEMO0snji5PPdymviyuUHPb0bzxn LS/SfskO+0S8J3JP0DDKY0uHcvjHMJH9tl3+B89135zY623NyaoLHOlR6Ii3/pyyvEXcJP sfxVJLVbFt6t1AoMKJQqPEbTtjdNAXBk5EcqChBNxE6ojHP3TFO/SfRwWkqIVw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703182665; a=rsa-sha256; cv=none; b=odkKdC36/hdckJmVPtFP2o1Gtda2L/k8Qv4ZZL6U0RBBPCToeskpycz4bLJP1ZduDfIa6Y rWYDdmxiRnARLlrM7xpRCND+tbF135Cvx88VTYP4ip06P2d+A805edauBqBD7PHjz8ucXu M8llEMKhXb547IdtDM2ngrUVYNsep1igrOBtJyCGf8phsSmmLIImwhDfoqck+tIAbmic5s VdCQh+wI+5WaTfKkgm/CtMhNwKeV/tWgaHjYA6aNjSTcJailebGjAUserTVMTuG2LvxF1o 1o4mCUPpWrzuKjUxv0CZRqYwfotM23rW0e2N6wldJx62NA9KMBynxYUjcNkF4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mSVagYTHvCGXKGwwsB5jyYxFnp29QffP9+7GRAegtCM=; b=oMMBHJi2XCDEmvwm1Pgl30L+tjA1ur9jf2v9z5lHq25gBg91kdd1lN8EFRW7Je8U9RWlse dh4KUu7zzYskTAvTF88oJUCdtAvn6lDt1vfVfvC7H/YOMVaK9szGlQ+9Jg37EhJgDwYxcC l7s36SnqCNu0Qvr6d5dpiVlprV8O43JjSlM5QtOnbvJfbb+qcbrSqNzMU9GVVnGUjDPFKy 3i1FiDSo4sB0CbsiCC1Lmqwe7CiKN1d5UzIhEYDT6alJ9EIz9ud0AK06DV7rIrixjR3QGY wlFc4QJN93uqKa31WmzNrJjToAnK892x6Xljd835DTyk327soKkYlc2AJiwomg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwzDn2XBbzjsR; Thu, 21 Dec 2023 18:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIHj7Y034081; Thu, 21 Dec 2023 18:17:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIHjAt034078; Thu, 21 Dec 2023 18:17:45 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:17:45 GMT Message-Id: <202312211817.3BLIHjAt034078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 89ebe0ce1f53 - stable/14 - memfd_create: move implementation to libc/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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 89ebe0ce1f539ec7629a15e35f31eef956f1b603 Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=89ebe0ce1f539ec7629a15e35f31eef956f1b603 commit 89ebe0ce1f539ec7629a15e35f31eef956f1b603 Author: Brooks Davis AuthorDate: 2023-11-27 17:06:33 +0000 Commit: Brooks Davis CommitDate: 2023-12-21 18:13:18 +0000 memfd_create: move implementation to libc/gen Due to memfd_create(3)'s construction of a path to pass to shm_open2(2), it has a much larger than typical dependency footprint for a system call wrapper (the list currently includes calloc, memset, sprintf, and strlen). As such, split it off into its own file under libc/gen to lighten libc/sys's dependency list. Reviewed by: kevans, imp, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42709 (cherry picked from commit c3207e2d2554c8e36f9cf5950f8cd52a19fedfd5) --- lib/libc/gen/Makefile.inc | 1 + lib/libc/gen/Symbol.map | 1 + lib/libc/gen/memfd_create.c | 131 ++++++++++++++++++++++++++++++++++++++++++++ lib/libc/sys/Symbol.map | 1 - lib/libc/sys/shm_open.c | 93 ------------------------------- 5 files changed, 133 insertions(+), 94 deletions(-) diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 655843f03715..3a3aa41c7d59 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -102,6 +102,7 @@ SRCS+= __getosreldate.c \ lockf.c \ lrand48.c \ memalign.c \ + memfd_create.c \ mrand48.c \ nftw.c \ nftw-compat11.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index 559c0252c338..b68d63b279f3 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -433,6 +433,7 @@ FBSD_1.6 { eventfd_write; getlogin_r; memalign; + memfd_create; pthread_getname_np; scandir_b; sigandset; diff --git a/lib/libc/gen/memfd_create.c b/lib/libc/gen/memfd_create.c new file mode 100644 index 000000000000..b26d638656a4 --- /dev/null +++ b/lib/libc/gen/memfd_create.c @@ -0,0 +1,131 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Kyle Evans + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "libc_private.h" + +#define MEMFD_NAME_PREFIX "memfd:" + +/* + * The path argument is passed to the kernel, but the kernel doesn't currently + * do anything with it. Linux exposes it in linprocfs for debugging purposes + * only, but our kernel currently will not do the same. + */ +int +memfd_create(const char *name, unsigned int flags) +{ + char memfd_name[NAME_MAX + 1]; + size_t namelen, *pgs, pgsize; + struct shm_largepage_conf slc; + int error, fd, npgs, oflags, pgidx, saved_errno, shmflags; + + if (name == NULL) { + errno = EBADF; + return (-1); + } + namelen = strlen(name); + if (namelen + sizeof(MEMFD_NAME_PREFIX) - 1 > NAME_MAX) { + errno = EINVAL; + return (-1); + } + if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | + MFD_HUGE_MASK)) != 0) { + errno = EINVAL; + return (-1); + } + /* Size specified but no HUGETLB. */ + if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) { + errno = EINVAL; + return (-1); + } + + /* We've already validated that we're sufficiently sized. */ + snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); + oflags = O_RDWR; + shmflags = 0; + if ((flags & MFD_CLOEXEC) != 0) + oflags |= O_CLOEXEC; + if ((flags & MFD_ALLOW_SEALING) != 0) + shmflags |= SHM_ALLOW_SEALING; + if ((flags & MFD_HUGETLB) != 0) + shmflags |= SHM_LARGEPAGE; + else + shmflags |= SHM_GROW_ON_WRITE; + fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name); + if (fd == -1 || (flags & MFD_HUGETLB) == 0) + return (fd); + + pgs = NULL; + npgs = getpagesizes(NULL, 0); + if (npgs == -1) + goto clean; + pgs = calloc(npgs, sizeof(size_t)); + if (pgs == NULL) + goto clean; + error = getpagesizes(pgs, npgs); + if (error == -1) + goto clean; + pgsize = (size_t)1 << ((flags & MFD_HUGE_MASK) >> MFD_HUGE_SHIFT); + for (pgidx = 0; pgidx < npgs; pgidx++) { + if (pgsize == pgs[pgidx]) + break; + } + if (pgidx == npgs) { + errno = EOPNOTSUPP; + goto clean; + } + free(pgs); + pgs = NULL; + + memset(&slc, 0, sizeof(slc)); + slc.psind = pgidx; + slc.alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; + error = ioctl(fd, FIOSSHMLPGCNF, &slc); + if (error == -1) + goto clean; + return (fd); + +clean: + saved_errno = errno; + close(fd); + free(pgs); + errno = saved_errno; + return (-1); +} diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map index b59ec1858ffd..f17aae279b8d 100644 --- a/lib/libc/sys/Symbol.map +++ b/lib/libc/sys/Symbol.map @@ -409,7 +409,6 @@ FBSD_1.6 { fhreadlink; getfhat; funlinkat; - memfd_create; shm_create_largepage; shm_rename; }; diff --git a/lib/libc/sys/shm_open.c b/lib/libc/sys/shm_open.c index b2c1532133bf..eb3022c857b1 100644 --- a/lib/libc/sys/shm_open.c +++ b/lib/libc/sys/shm_open.c @@ -34,9 +34,6 @@ #include #include -#include -#include -#include #include #include @@ -45,12 +42,9 @@ __weak_reference(shm_open, _shm_open); __weak_reference(shm_open, __sys_shm_open); -#define MEMFD_NAME_PREFIX "memfd:" - int shm_open(const char *path, int flags, mode_t mode) { - return (__sys_shm_open2(path, flags | O_CLOEXEC, mode, 0, NULL)); } @@ -77,90 +71,3 @@ shm_create_largepage(const char *path, int flags, int psind, int alloc_policy, } return (fd); } - -/* - * The path argument is passed to the kernel, but the kernel doesn't currently - * do anything with it. Linux exposes it in linprocfs for debugging purposes - * only, but our kernel currently will not do the same. - */ -int -memfd_create(const char *name, unsigned int flags) -{ - char memfd_name[NAME_MAX + 1]; - size_t namelen, *pgs, pgsize; - struct shm_largepage_conf slc; - int error, fd, npgs, oflags, pgidx, saved_errno, shmflags; - - if (name == NULL) { - errno = EBADF; - return (-1); - } - namelen = strlen(name); - if (namelen + sizeof(MEMFD_NAME_PREFIX) - 1 > NAME_MAX) { - errno = EINVAL; - return (-1); - } - if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | - MFD_HUGE_MASK)) != 0) { - errno = EINVAL; - return (-1); - } - /* Size specified but no HUGETLB. */ - if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) { - errno = EINVAL; - return (-1); - } - - /* We've already validated that we're sufficiently sized. */ - snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); - oflags = O_RDWR; - shmflags = 0; - if ((flags & MFD_CLOEXEC) != 0) - oflags |= O_CLOEXEC; - if ((flags & MFD_ALLOW_SEALING) != 0) - shmflags |= SHM_ALLOW_SEALING; - if ((flags & MFD_HUGETLB) != 0) - shmflags |= SHM_LARGEPAGE; - else - shmflags |= SHM_GROW_ON_WRITE; - fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name); - if (fd == -1 || (flags & MFD_HUGETLB) == 0) - return (fd); - - pgs = NULL; - npgs = getpagesizes(NULL, 0); - if (npgs == -1) - goto clean; - pgs = calloc(npgs, sizeof(size_t)); - if (pgs == NULL) - goto clean; - error = getpagesizes(pgs, npgs); - if (error == -1) - goto clean; - pgsize = (size_t)1 << ((flags & MFD_HUGE_MASK) >> MFD_HUGE_SHIFT); - for (pgidx = 0; pgidx < npgs; pgidx++) { - if (pgsize == pgs[pgidx]) - break; - } - if (pgidx == npgs) { - errno = EOPNOTSUPP; - goto clean; - } - free(pgs); - pgs = NULL; - - memset(&slc, 0, sizeof(slc)); - slc.psind = pgidx; - slc.alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; - error = ioctl(fd, FIOSSHMLPGCNF, &slc); - if (error == -1) - goto clean; - return (fd); - -clean: - saved_errno = errno; - close(fd); - free(pgs); - errno = saved_errno; - return (-1); -} From nobody Thu Dec 21 18:17:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwzDp6ccYz554s5; Thu, 21 Dec 2023 18:17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwzDp51myz3Y0Z; Thu, 21 Dec 2023 18:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hw2pCaq1JgPRImFfwnsEWbQN7kzpjlSYNwZdbV8QTJ0=; b=VJjxWjQZdm2UiQNQG1Rv4g1loqrV51JT8Rs82nfvFIOrHdYmkTFYckojI0E7nAVy7NLDbt M1TYmKGrQXTdUAnb8BtPFULF/MwZVko0FJ/fzawOX4HEmnxhV7sBzTlkAo9LDI7NvUIeRx vvzvIwepHrh/1tjbM5ppyJxDykfWMmA/h4zCCb0/kpkr4XebEvT8UZbcbZScNcIC+tRWzY Lb1X6t6jJecloud0lGvDYAOBsUffODiPbENT0Qa2q6rQmB1tDXZ3F78m5ZPH2MMi+ym6LC iVTrR4CRhqBnszOpm2MUXb/Nl+FEVpH3/F0o6UeJJlckEa/QDmmslZhiX6x3tA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703182666; a=rsa-sha256; cv=none; b=aao3iH+n0N3Bv95jNYqWpcTEPahfKQjo1V5kR6Qn4dBWW3fnE9asGZ9Ptz2H9w8pf6vaBl 00UY86E/Z6xmKC4ARlgmqyOwyvE8yaVO5kK8nPgpy/8RDKaAWKa0lgSVsuBCYCRiEZvj5e Nm2lYQ+uqQ0Lr2HIk1WSRHPqjOS4PX6TPqX/hiZ4VOkMHxU67oVIieVNMUkD3dwD2w8adl +1Yl/f5UA5u2ZVtEWTBJpVrcCeo9POuVstrtS8/mgK1GGx+jgfA6GoIfJ966OfmNGfMk4x ye9lrRstOrzvu2p31f4DpSbIgxHTOvd/rHHpOjc1KccEbIwQUzEU3QXx0N/mhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hw2pCaq1JgPRImFfwnsEWbQN7kzpjlSYNwZdbV8QTJ0=; b=WALKJmrQpI3bR/ZseBty/EmA2VUkD1e9Fd8LtSgJEbi8mYeyQSfqJEAAWLcw4ay/Z96B2B Ia9dck1VgsHRPbSvsxoSZA6cIWV5C8SoW3MZb1xDCYSzc+pTlFoI7ahpOFhoMxQY4Nc+Ud Gs8/gEeQtpPlrj0JlT1Openp6i0iibQOIGkOMJeBYh071DaJ2yH92KgGSiuS2Fzbhl3Qm6 oVpgpzILvIp/9cBpOHEbiVT0YgcotGMbZSJrC7D9wvYAwMO0cjT8pU82gSbN+BUQCq72Sl 0a98SyJdh0D1+Cf1RFkdpHyS6uKCaz40GAkgGM2Uj9zj6azV6Del1Z4FZFsdzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwzDp3nvqzjfC; Thu, 21 Dec 2023 18:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIHkxj034127; Thu, 21 Dec 2023 18:17:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIHklI034124; Thu, 21 Dec 2023 18:17:46 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:17:46 GMT Message-Id: <202312211817.3BLIHklI034124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: c6e072f15c98 - stable/14 - memfd_create: don't allocate heap memory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6e072f15c98097bdfb9583345f910220f97093e Auto-Submitted: auto-generated The branch stable/14 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=c6e072f15c98097bdfb9583345f910220f97093e commit c6e072f15c98097bdfb9583345f910220f97093e Author: Brooks Davis AuthorDate: 2023-11-27 17:07:06 +0000 Commit: Brooks Davis CommitDate: 2023-12-21 18:13:19 +0000 memfd_create: don't allocate heap memory Rather than calling calloc() to allocate space for a page size array to pass to getpagesizes(), just follow the getpagesizes() implementation and allocate MAXPAGESIZES elements on the stack. This avoids the need for the allocation. While this does mean that a new libc is required to take advantage of a new huge page size, that was already true due to getpagesizes() using a static buffer of MAXPAGESIZES elements. Reviewed by: kevans, imp, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42710 (cherry picked from commit c96772227b7dfcaf4eec4d07acb5c916643aca3a) --- lib/libc/gen/memfd_create.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/libc/gen/memfd_create.c b/lib/libc/gen/memfd_create.c index b26d638656a4..78131f46d7b1 100644 --- a/lib/libc/gen/memfd_create.c +++ b/lib/libc/gen/memfd_create.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -52,7 +51,8 @@ int memfd_create(const char *name, unsigned int flags) { char memfd_name[NAME_MAX + 1]; - size_t namelen, *pgs, pgsize; + size_t pgs[MAXPAGESIZES]; + size_t namelen, pgsize; struct shm_largepage_conf slc; int error, fd, npgs, oflags, pgidx, saved_errno, shmflags; @@ -92,16 +92,9 @@ memfd_create(const char *name, unsigned int flags) if (fd == -1 || (flags & MFD_HUGETLB) == 0) return (fd); - pgs = NULL; - npgs = getpagesizes(NULL, 0); + npgs = getpagesizes(pgs, nitems(pgs)); if (npgs == -1) goto clean; - pgs = calloc(npgs, sizeof(size_t)); - if (pgs == NULL) - goto clean; - error = getpagesizes(pgs, npgs); - if (error == -1) - goto clean; pgsize = (size_t)1 << ((flags & MFD_HUGE_MASK) >> MFD_HUGE_SHIFT); for (pgidx = 0; pgidx < npgs; pgidx++) { if (pgsize == pgs[pgidx]) @@ -111,8 +104,6 @@ memfd_create(const char *name, unsigned int flags) errno = EOPNOTSUPP; goto clean; } - free(pgs); - pgs = NULL; memset(&slc, 0, sizeof(slc)); slc.psind = pgidx; @@ -125,7 +116,6 @@ memfd_create(const char *name, unsigned int flags) clean: saved_errno = errno; close(fd); - free(pgs); errno = saved_errno; return (-1); } From nobody Thu Dec 21 18:22:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwzL96BpVz555Qn; Thu, 21 Dec 2023 18:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwzL95mL2z3Yxl; Thu, 21 Dec 2023 18:22:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e5NIM+IfOwO9I+EzC5s3WSmj8akclyH9KfbMKqravSQ=; b=IDKbLdFriLRcTsQPyBV59K2cRzY861B7RpcQ/CHtd8NBt11CV1l0NJWqE+V0+X5aO7ntqd +LrcJUAkn4m4JheOskaE1SWesljBrhAJz+ImlT2CFuFQuNmS/cbZTte7ui+QG32yT6uM9b mR1nBwME0B7s6iT53aw1dQgbcH1l83BI8f6tkiA/PmkRT5cotXHb1vtvZ3ypzRMXhtZM0T IJ4WAAhbuSw5eowtV6T7npRk2vRQ/ShTdwOI+9vA0OAwYIWWxGuaIDFRBgr6xX8Sa49VGs 45n1PP8KNqnbgWwhsih7a6YZU5O+oX3GWYyvCBwrONEAiGYAEE5oPzbJtT4SbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703182945; a=rsa-sha256; cv=none; b=g+CYnveXqrA63aoYJsaZxpuGOaj/Y8djfNOzCDXgByECUS6SjHjPXoOlMdRkV1j3nt068d Mtm6cU5qydT74tRKPD5Iep+PpN8+e8PC6REWt2YYCiYX6O3+q2tr0OVLm0Yj1i6jSeAVpi sg2GXLIa67Shexn299QMYVzx6Yxs6xGhQQG4vgt0OyPk3CJIGWV/3xN8QpLo4gkDOWZRc2 zNEfG+mZvcCC2jkNZ/a9FhAmz1mka3HkhdiWlDcF60L+iep1Ipuum5BJnDt87yvY3VT/VC TeIU5relvor8j8UABEI+/W85miD0qlHu7VuPT9bVdDfVB5ICNLRC97QQGiWRrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703182945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e5NIM+IfOwO9I+EzC5s3WSmj8akclyH9KfbMKqravSQ=; b=R77q90vha5Q1OEJvxzZas/UiAh4DkwjoJVyWj56eT+1paklqqqg8fKyVIiPXBnIyuST369 1pGrkYOUceTamgIKdLr/Uz1FAcO64/LBXMzerq0d3Rvi30vkyWUPHsmWVcN+R7V7hZ8tnO rmiRZRpn/fVtuVGKuOd8NN7pYvlZ2Pznz3vAxwaTFfYHo063BmiqfzNCdxS+sfXRdKqmWR fMSYqBiN2lnipGjEBJlHxYHt8E1KSUaLvgQMOwE5o33QVE8WgzLxJXAifivT5hd4XZvLaM eEpEE11Xd+I6e0/vw3w9phPmE0ucKv3zgLlt9DdnExRhBfzS/RSEY3qY0KCgfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwzL94qJXzjQW; Thu, 21 Dec 2023 18:22:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIMPsp049790; Thu, 21 Dec 2023 18:22:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIMPMX049787; Thu, 21 Dec 2023 18:22:25 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:22:25 GMT Message-Id: <202312211822.3BLIMPMX049787@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: 881bf8814a25 - main - pf: export missing state information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 881bf8814a250477850b83ee6ebbb052303051c8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=881bf8814a250477850b83ee6ebbb052303051c8 commit 881bf8814a250477850b83ee6ebbb052303051c8 Author: Kristof Provost AuthorDate: 2023-12-21 17:20:37 +0000 Commit: Kristof Provost CommitDate: 2023-12-21 18:21:17 +0000 pf: export missing state information We did not export all of the information pfctl expected to print via the new netlink code. This manifested as pfctl printing 'rtableid: 0', even when there is no rtable set. While we're addressing that also export other missing fields such as dummynet, min_ttl, max_mss, .. Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 7 +++++++ sys/netpfil/pf/pf_nl.c | 8 ++++++++ sys/netpfil/pf/pf_nl.h | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 10a63f15e2f8..f915072c4ea1 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -1386,6 +1386,13 @@ static struct snl_attr_parser ap_state[] = { { .type = PF_ST_LOG, .off = _OUT(log), .cb = snl_attr_get_uint8 }, { .type = PF_ST_STATE_FLAGS, .off = _OUT(state_flags), .cb = snl_attr_get_uint16 }, { .type = PF_ST_SYNC_FLAGS, .off = _OUT(sync_flags), .cb = snl_attr_get_uint8 }, + { .type = PF_ST_RTABLEID, .off = _OUT(rtableid), .cb = snl_attr_get_int32 }, + { .type = PF_ST_MIN_TTL, .off = _OUT(min_ttl), .cb = snl_attr_get_uint8 }, + { .type = PF_ST_MAX_MSS, .off = _OUT(max_mss), .cb = snl_attr_get_uint16 }, + { .type = PF_ST_DNPIPE, .off = _OUT(dnpipe), .cb = snl_attr_get_uint16 }, + { .type = PF_ST_DNRPIPE, .off = _OUT(dnrpipe), .cb = snl_attr_get_uint16 }, + { .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[] = { }; diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 67a7392ae448..8fe12f3762b9 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -194,6 +194,14 @@ dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, struct pf_kstate *s, nlattr_add_u64(nw, PF_ST_PACKETS1, s->packets[1]); nlattr_add_u64(nw, PF_ST_BYTES0, s->bytes[0]); nlattr_add_u64(nw, PF_ST_BYTES1, s->bytes[1]); + nlattr_add_u32(nw, PF_ST_RTABLEID, s->act.rtableid); + nlattr_add_u8(nw, PF_ST_MIN_TTL, s->act.min_ttl); + nlattr_add_u16(nw, PF_ST_MAX_MSS, s->act.max_mss); + nlattr_add_u16(nw, PF_ST_DNPIPE, s->act.dnpipe); + nlattr_add_u16(nw, PF_ST_DNRPIPE, s->act.dnrpipe); + nlattr_add_u8(nw, PF_ST_RT, s->rt); + if (s->rt_kif != NULL) + nlattr_add_string(nw, PF_ST_RT_IFNAME, s->rt_kif->pfik_name); if (!dump_state_peer(nw, PF_ST_PEER_SRC, &s->src)) goto enomem; diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 3ae77ffd3790..d8b494a54cf7 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -100,6 +100,13 @@ enum pfstate_type_t { PF_ST_VERSION = 28, /* u64 */ PF_ST_FILTER_ADDR = 29, /* in6_addr */ PF_ST_FILTER_MASK = 30, /* in6_addr */ + PF_ST_RTABLEID = 31, /* i32 */ + PF_ST_MIN_TTL = 32, /* u8 */ + PF_ST_MAX_MSS = 33, /* u16 */ + PF_ST_DNPIPE = 34, /* u16 */ + PF_ST_DNRPIPE = 35, /* u16 */ + PF_ST_RT = 36, /* u8 */ + PF_ST_RT_IFNAME = 37, /* string */ }; enum pf_addr_type_t { From nobody Thu Dec 21 18:27:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwzRq22Tzz555RB; Thu, 21 Dec 2023 18: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwzRq1bGcz3ZY1; Thu, 21 Dec 2023 18: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=1703183239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XDu1DZjE5fZ2WWKe5TnBMieDVgwbxCgOWjKKIs3FV9Q=; b=g18OcgjW/XXPtv3i4T+EyTTt7Jxa6mg/Mo8w34TU8cMyG7fDMvmmi74r4QDq0Dd0Z9D/Ee lP0VMpuA0wlAXnrNOR0YgWAsLEjoYniDQJlHMLzSP0mF/UJNKw1rgvUseRX+SM8ayoljvy eaH+/2TPxwXxyFPbKYngXj0FaGYYC04W8JAM/HXwBZmY3n9l4xxJJo35Gt4psgoR2JxL6u pqV+NG0cPAZ7a/xz9/xEl/A/4QqCsZO3/OVpI43G85Tuo2kH5d6b0iJdpY1014+P+S1lbV OFIOV90yI8vfa8tLOF2aeRrUWTUWnqhafxxiZCBLIai+rdU2ofpl9IkWTaIIHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703183239; a=rsa-sha256; cv=none; b=crPoY1+qBuTNKuBChZpucXRWfuUKNDWH4v7Rvw+HsUOLLxgL1WCSfMUADb/LOtY5YMZGLj FW8w0pTJ6+K1gxdDmY7UrqEXF+Qfhbcq3L1fR7rIUar9Sfqm/Dx96nmMXTUL+KqWRmGUNc fo63aBwdCwnkWhXC9MW99ADhnvBdVUqjxsgiWrf03ptLWhULGn4hHSexAoWuV+v84ddh7g an41gtZ9IbFm+kXlRyjU7PQdTWAz+5sIvmu5dr+t0GE5YnNOmcH/GITLELemRjNqUERZQV BfH6ZZJRUl+JECAzsba0Y0oei++/G+mP1eQj3USGbsuoLvO1MP4J3LYQN8v4zQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703183239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XDu1DZjE5fZ2WWKe5TnBMieDVgwbxCgOWjKKIs3FV9Q=; b=qCqWJU4KVoXhNTLPjuAiMGa2BvP1czOIGQyUylWFBPFy/xGg8pVoCtCTBRMrRpVXNZDfRn YhTM4mQJ8Glops6/BPsg3bMqHu6ib6GVPiZJvjbUObQCy5bbNg6VMSY9K+X/Clr8b1kSix TtMChP4KjrcjJp1LjZ2qFPEvC5Aav0/B5RaZfjI8AUTAu7g9UGdr+uPPBU+RUho46QitU0 B0hdLg9K/lONnPnk5qfRNaS33ppTni24V+5xPU6a9q2ChkdFvf+sPYQ1rdydgRjLGSIUHB qgGUMMx3fpq4bKkZqgdt0Hzo+HK9QlQvzcXB1NulIEkJyXr8A5Y4jGbNylg5Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwzRq0Xl7zk0D; Thu, 21 Dec 2023 18:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIRIsa050572; Thu, 21 Dec 2023 18:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIRI9d050569; Thu, 21 Dec 2023 18:27:18 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:27:18 GMT Message-Id: <202312211827.3BLIRI9d050569@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: 3ff574c5e1d1 - main - ufs: Update *eofflag upon a read of an unlinked directory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 3ff574c5e1d1d5d07763a14f22d6f9d7291550c6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3ff574c5e1d1d5d07763a14f22d6f9d7291550c6 commit 3ff574c5e1d1d5d07763a14f22d6f9d7291550c6 Author: Mark Johnston AuthorDate: 2023-12-21 18:26:13 +0000 Commit: Mark Johnston CommitDate: 2023-12-21 18:26:46 +0000 ufs: Update *eofflag upon a read of an unlinked directory If the directory is unlinked, no further entries will be returned, but we return no error. At least one caller (vn_dir_next_dirent()) asserts that a VOP_READDIR call which returns no error and no entries will set *eofflag != 0, so the current behaviour of UFS can trigger an assertion failure. Simply set *eofflag in this scenario. Reviewed by: olce, kib Reported by: syzkaller MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43089 --- sys/ufs/ufs/ufs_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 3bfa2019739a..c62583afaab6 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -2417,8 +2417,10 @@ ufs_readdir( if (uio->uio_offset < 0) return (EINVAL); ip = VTOI(vp); - if (ip->i_effnlink == 0) + if (ip->i_effnlink == 0) { + *ap->a_eofflag = 1; return (0); + } if (ap->a_ncookies != NULL) { if (uio->uio_resid < 0) ncookies = 0; From nobody Thu Dec 21 18:42:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SwznJ6wKmz547Nv; Thu, 21 Dec 2023 18:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SwznJ6Tfzz3cM2; Thu, 21 Dec 2023 18:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703184148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRjBitQrZB80/e/+hj/VlcCT9saeFYYo/7wum0pq/GY=; b=IVUOZ5KG0dScH9Y/RuwIamhBuzw/TGtPK8qZr3hE3PSqxETCnpU157to1Az0eMpMPd2jXY 3+GLU0HppOfbbeKPCPgCFmwcJ+E2vwch+Vm1nzlrtnaLZiQebzfDw4jHKmVYvvqFoGx+j4 w+n/A4CXEhuNrWgf5wPG6vD+6OzPzrXOAt1gPNeTrB4vraOL2zhExSrASefsNex+/uxCWo EoWNd1Z9WacOv59Qr3BYdayMWQk+58i6h+SfBp1XUVRrenrOoyjP3GoOVRbiq02v3Pfiw2 CX0jnfGy2ybSVZcOfzVPHryE8N5WbWeWKIYby044D9tHvkX0psL4arHMYtYRQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703184148; a=rsa-sha256; cv=none; b=DMjQ7XRvrOgmny66NDqprSgJuEHE1paG5EDGeUsJPRpokmhtkxdjkOqZRWHJI5j054UGHz +pij1NQkC/o71Lq6dDwSqpl02t+8a715hxOsIugnqxLKWxSvb9HpBXnBGL/rKMC4DDJFlV Zih6pOrQ626HCtUYi/7Yx3CFOW/K4LhqAVdMmgnEgA61X50rjsm83MoLjpLDxqCwTq75KK +67EP+vh1aJ6zM/wdPpjFOOvGcMrNS0FfodDWyr1GAQENNCI56wUM/WvwtWLxAPg1AJWmr HkK3oivn46ZsSfU7fkdN08Av3lzVT50c9Cd2BdYny1wJ/BG3SihhTAWeigEqiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703184148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lRjBitQrZB80/e/+hj/VlcCT9saeFYYo/7wum0pq/GY=; b=tWypdW2/EuEEELjOSjwIFebnT9dDWAW0S+vO0OhikgFvK2uRUdvIGb496FOokOZpvduY85 caN7HIUWI4+QEO6s+ZmBtt6bnf0a5fQx9frj6xeaipF0mAVMKF06eDR9VkzVDZjCQmS0zP jqMX6qJCYO2v7SmoZJI/fF//2Q/IOGaljG4z8DdBPB6QEH0wr2vlwnvsFEqL+LT/9LtC2S 0xL5OOnAAgOu13tJ6Sf7MEKzMlqg99+lqtgf5iIq09HIJgaH1kMZl8zVs16Irv/9mB5/Ns 0E5ozIkQjuuf6qs82VbEO/H8sGOWqS8F/LFpdLxt/Y24a6Vz3wxBySoNIJs5zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SwznJ5Wptzkcy; Thu, 21 Dec 2023 18:42:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLIgS6U083711; Thu, 21 Dec 2023 18:42:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIgSiF083708; Thu, 21 Dec 2023 18:42:28 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:42:28 GMT Message-Id: <202312211842.3BLIgSiF083708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 0084d0235649 - stable/13 - vtnet: don't leak pfil(9) data on detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0084d02356494eb7a1b276ded9d37f3164a7248e Auto-Submitted: auto-generated The branch stable/13 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0084d02356494eb7a1b276ded9d37f3164a7248e commit 0084d02356494eb7a1b276ded9d37f3164a7248e Author: Gleb Smirnoff AuthorDate: 2022-01-05 02:41:05 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-21 18:41:48 +0000 vtnet: don't leak pfil(9) data on detach PR: 260667 Submitted by: (cherry picked from commit 3f6ab5493f4b89e7625dd31f807065cfae6c503d) --- sys/dev/virtio/network/if_vtnet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index fc7634e9a821..9737e964a591 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -515,6 +515,11 @@ vtnet_detach(device_t dev) netmap_detach(ifp); #endif + if (sc->vtnet_pfil != NULL) { + pfil_head_unregister(sc->vtnet_pfil); + sc->vtnet_pfil = NULL; + } + vtnet_free_taskqueues(sc); if (sc->vtnet_vlan_attach != NULL) { From nobody Thu Dec 21 18:55:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx04p2H9Wz547b0; Thu, 21 Dec 2023 18: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx04p1k0Dz3fC9; Thu, 21 Dec 2023 18: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=1703184954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rb4MfkJ62YmiIpEisVX3FiogFfKMurBMJbi8Q1fzqYI=; b=mrZ6er+g+/LFpWHkYIVLwX35O59HaMTGgQ7WmQxlqkH4rP4OC9EwHy6gmV+K0MCCcbEO4W m9PFRxsA8GJyL4rDYQGRLjCh9sZ+IcLtqeKYllj0lNfld6fDimqfzqAK1gvAzFJCR9+Rlj fw5t8N9fuW85S6jkCNgnAoQe9umJpgUixFYs43usexNGUsQEVEFaxK27nNCtc2Q064cMun X46ghn1/XQCE/9KF6qROe0pmh/BFGcrl/2SL5tiN0/RLZnCu0Y5PX7gFIsIbVcixR9ZHpF d96ANcGbT1i2qzZrLohn79ZQOGOK3+bNjoXtlRqktBj234CrjwFhZFGPHdNgPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703184954; a=rsa-sha256; cv=none; b=sV+nBnV8cv6EX7NKPRwnILqjV/uBAbHUr+q5o4v7SjoIZTJHl1Uz3ZA50hNwL+a/CLQZDv 8Tkg9wVdW0qzIYNP047KJZjnNNMNklp/n/Ron+lrKreNUY/EXwtcfYb1dH/eXB54ySwtlF LpaIw1QwglEy6egQc8VIabA6gRXjLMOCuLbFz/HuF0Xc5UrDLqJOKxzOTFnG8ldrwasROu mMbKhw1OzmmwcC/CZkDx3K5OAZ6kqoWEWeYrdq+U2lR0GzA+Ha1Bbrwv7S781yZ3TPoSFG 9yjcTH4YYNdN1e9x4lnGHSsYvgX4WzzphHUt2mv0D0iewLcdrbQpJ0NzXHfSAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703184954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rb4MfkJ62YmiIpEisVX3FiogFfKMurBMJbi8Q1fzqYI=; b=xMARfSBCOK/TWfTBcZyyecg2SWO6CKZwQQoQf64d5z0Lca3JsBS1TKp6h1hjRRAQROeJlM weX29dty5+9S55LPRNT1vDy196dNP915wDxL+z727E1CFJLh784fLO2iWZwZ4dqjRYmvv6 TfWLktvmlXeMA0QAAZno7ihi/2DXgPJioVRB61XmmbP9379qXKzjxnXt73gShKfBKFdVzS pSl2pk/78YUKjUhTQ5bOZe7xEXDt1rHbS3Kmxdfwv4XN1t8H/cNGmHpYnlmqnA4W+caVOe Id96M7+pX5CLPallngBvcWS3Dvu78FkaQBdXSW2/u4I02gEzWOnhWuBzUWSyvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx04p0mmYzkkx; Thu, 21 Dec 2023 18:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLItsLs000479; Thu, 21 Dec 2023 18:55:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLIts7m000476; Thu, 21 Dec 2023 18:55:54 GMT (envelope-from git) Date: Thu, 21 Dec 2023 18:55:54 GMT Message-Id: <202312211855.3BLIts7m000476@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: c1c55da49fd5 - main - pfil: don't leak pfil_head_t on interface detach List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c1c55da49fd55c01771f8cf1f7255a37b79735d7 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c1c55da49fd55c01771f8cf1f7255a37b79735d7 commit c1c55da49fd55c01771f8cf1f7255a37b79735d7 Author: Gleb Smirnoff AuthorDate: 2023-12-21 18:53:49 +0000 Commit: Gleb Smirnoff CommitDate: 2023-12-21 18:53:49 +0000 pfil: don't leak pfil_head_t on interface detach PR: 256714 Submitted by: jcaplan@blackberry.com --- sys/net/pfil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/pfil.c b/sys/net/pfil.c index 4b4eeca362c1..3ceffcefb758 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -295,6 +295,7 @@ pfil_head_unregister(pfil_head_t ph) free(link, M_PFIL); } PFIL_UNLOCK(); + free(ph, M_PFIL); } pfil_hook_t From nobody Thu Dec 21 21:29:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx3V50c4wz54Hxx for ; Thu, 21 Dec 2023 21:29:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx3V34MG6z4Nvt for ; Thu, 21 Dec 2023 21:29:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=E+sS6nbh; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::62c) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a236456fee1so152369666b.1 for ; Thu, 21 Dec 2023 13:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1703194169; x=1703798969; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vJGKCQI4UF9KYkd83N0y+PpcXDNzo9kxgcF6D+lzVbs=; b=E+sS6nbhvDwCAzl0g0lq56qmpFJJbPT5H2rP3JvTs7mFb58j2+Z8I1LDWSNIWsOqie isqnRko/VtklApUB1vJ5H0j8EKn022kOLFiU2PhAt7XUjzC0WWx8fyyp+WDRYBxk9UaQ E6MmCQjbIxAHr8H6lkgWDuQO8oSc/Dc5pQZbyzjlXta0RKgYVywwaF6uo2+MVT9MJ3o5 h7Oxa3xWiIrYfK/mUNrYhT0vyZyAbk8X3L+dfCY1n3s+VSU1XZRAOhQUXaKzKnNXzWwR 12fKz2p9OruxBYuHJSngzwU+Dx1givDZsUIU1bXSN3adeQUCnibveJNNTA3dzUE/OY/y yajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703194169; x=1703798969; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vJGKCQI4UF9KYkd83N0y+PpcXDNzo9kxgcF6D+lzVbs=; b=duqG8hhdn63+ItR+sx5TzVLzNFVhT81Vrri2PNcK5k8zvYTgp7grOHBtiY5SkSHggo qQfd5cu2SBW6MOIR2kUCdx1pRKHjMKaubGaO7GUPWSTO7Cn7O4ctvvnHlQD6AooI/DK1 mPYhxpXO3JoR7m3dIBjR6LEa4s1t78PJcSBvhLt2Pg0mq38UyFVqn17DkNikxvFqK9GJ LbQDKNlbGRzePGKvhEiTVnYU2M5DSUL89RfB6EFttrgeDSXvxuD2nKpaAGHzABH5YmOO ZaDG+o33D5mL/Q28raW6gIHK+dMUYoNuK0ToMNECCRKzvDcj269G+pKqBVQaOVvOfxQC zuaA== X-Gm-Message-State: AOJu0YymKwWs2h1ZIUUw+oUHcbH3RFTrL0DIJgsHTxt9b18h9pcSrfru o51TENfnhh/WKhjdgfM9R3PPtcDSKfGPBUqoZ1ueMjvIUa/b0A== X-Google-Smtp-Source: AGHT+IHH9J4Mhc+irflo1f4GXcM9bfq803ecjsiUpSi68sIb/vGVXOveUy2XqMuVKyr7B2hj9zElzW8bZVyL6n+ZiIY= X-Received: by 2002:a17:907:29d5:b0:a23:59e4:bf16 with SMTP id ev21-20020a17090729d500b00a2359e4bf16mr173744ejc.83.1703194169177; Thu, 21 Dec 2023 13:29:29 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202312210421.3BL4Lb9T036317@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 21 Dec 2023 14:29:17 -0700 Message-ID: Subject: Re: git: 9e6d11ce9a51 - main - vtnet: Adjust rx buffer so IP header 32-bit aligned To: Mark Johnston Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000700aaa060d0bcb6f" X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::62c:from]; R_SPF_NA(0.00)[no SPF record]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_DN_ALL(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-Rspamd-Queue-Id: 4Sx3V34MG6z4Nvt X-Spamd-Bar: -- --000000000000700aaa060d0bcb6f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023 at 9:53=E2=80=AFAM Warner Losh wrote: > > > On Thu, Dec 21, 2023, 8:54=E2=80=AFAM Mark Johnston w= rote: > >> On Thu, Dec 21, 2023 at 08:31:36AM -0700, Warner Losh wrote: >> > On Thu, Dec 21, 2023 at 8:13=E2=80=AFAM Mark Johnston >> wrote: >> > >> > > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote: >> > > > The branch main has been updated by imp: >> > > > >> > > > URL: >> > > >> https://cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4= e9188a2ba4 >> > > > >> > > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 >> > > > Author: Warner Losh >> > > > AuthorDate: 2023-12-20 19:09:09 +0000 >> > > > Commit: Warner Losh >> > > > CommitDate: 2023-12-21 04:16:45 +0000 >> > > > >> > > > vtnet: Adjust rx buffer so IP header 32-bit aligned >> > > > >> > > > Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating >> them. >> > > > This improves performance everywhere, and allows armv7 to work >> at >> > > all. >> > > > >> > > > PR: 271288 (PR had a different fix than I >> wound >> > > up with) >> > > > MFC After: 3 days >> > > > Sponsored by: Netflix >> > > > Differential Revision: https://reviews.freebsd.org/D43136 >> > > > --- >> > > > sys/dev/virtio/network/if_vtnet.c | 2 +- >> > > > 1 file changed, 1 insertion(+), 1 deletion(-) >> > > > >> > > > diff --git a/sys/dev/virtio/network/if_vtnet.c >> > > b/sys/dev/virtio/network/if_vtnet.c >> > > > index 287af7751066..360176e4f845 100644 >> > > > --- a/sys/dev/virtio/network/if_vtnet.c >> > > > +++ b/sys/dev/virtio/network/if_vtnet.c >> > > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, i= nt >> > > nbufs, struct mbuf **m_tailp) >> > > > m_freem(m_head); >> > > > return (NULL); >> > > > } >> > > > - >> > > > m->m_len =3D size; >> > > > + m_adj(m, ETHER_ALIGN); >> > > >> > > The driver is expecting to get a cluster of size >> sc->vtnet_rx_clustersz, >> > > but now it's getting one of size sc->vtnet_rx_clustersz - 2. I don'= t >> > > see how this change can be sufficient on its own: what prevents virt= io >> > > from writing sc->vtnet_rx_clustersz bytes and thereby overwriting th= e >> > > two bytes following the cluster? >> > > >> > >> > The only trouble that I saw was here: >> > >> > /* >> > * Every mbuf should have the expected cluster size >> since >> > that >> > * is also used to allocate the replacements. >> > */ >> > KASSERT(m->m_len =3D=3D clustersz, >> > ("%s: mbuf size %d not expected cluster size %d", >> > __func__, >> > m->m_len, clustersz)); >> > >> > and even that's fine: We can adjust that assert. The next lines I thin= k >> > make it fine: >> > m->m_len =3D MIN(m->m_len, len); >> > >> > so we only use what we say is there to land bytes into the mbuf. I'm >> now >> > not sure though what to do about a few lines later: >> > >> > m_new =3D vtnet_rx_alloc_buf(sc, nreplace, &m_tail); >> > if (m_new =3D=3D NULL) { >> > m_prev->m_len =3D clustersz; >> > return (ENOBUFS); >> > } >> > >> > which likely needs to be adjusted (or the old saved size). >> >> I'm not certain about what it should be doing instead, but yes this code >> looks wrong now. >> > > Yea. We need to do this at time of use not time of alloc. > > > I likely didn't see asserts in my testing because I didn't have LRO slo= w >> > path packets. >> > >> > Do you see other places that would need adjusting? >> >> Presumably vtnet_rx_cluster_size() needs to be adjusted too? >> >> I also don't understand why we do this adjustment unconditionally >> instead of only when __NO_STRICT_ALIGNMENT is not defined, as almost all >> other NIC drivers do. >> > > None of the ones I looked at had this... maybe I got unlucky. I'd think > we'd have better performance if things are aligned all the way... is ther= e > a reason not to? > Yea, I see a lot of other drivers now... I'll follow the trend. I think it gives the ability to receive a full jumbo frame if I don't adjust. https://reviews.freebsd.org/D43161 has the updated patches, including backing out this change and moving it from alloc time to use time which seems better since we're chaining and should work for all the cases we're talking about here. Warner > Warner > >> >> > All the other places >> > seem to use m_len correctly on the rx path, but I'm not a nic driver >> guy, >> > and I might be missing something. >> > --000000000000700aaa060d0bcb6f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Dec 21, 2023 at 9:53=E2=80=AF= AM Warner Losh <imp@bsdimp.com>= wrote:


On Thu, Dec 21, 2023, 8:54=E2=80=AFAM Mark Johnston <markj@freebsd.org> = wrote:
On Thu, D= ec 21, 2023 at 08:31:36AM -0700, Warner Losh wrote:
> On Thu, Dec 21, 2023 at 8:13=E2=80=AFAM Mark Johnston <markj@freebsd= .org> wrote:
>
> > On Thu, Dec 21, 2023 at 04:21:37AM +0000, Warner Losh wrote:
> > > The branch main has been updated by imp:
> > >
> > > URL:
> > https://cgit.FreeBSD.org/src/commit/?id=3D9e6d11ce9a51d75ed6a94e180f2fb4= e9188a2ba4
> > >
> > > commit 9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4
> > > Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > AuthorDate: 2023-12-20 19:09:09 +0000
> > > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org&g= t;
> > > CommitDate: 2023-12-21 04:16:45 +0000
> > >
> > >=C2=A0 =C2=A0 =C2=A0vtnet: Adjust rx buffer so IP header 32-b= it aligned
> > >
> > >=C2=A0 =C2=A0 =C2=A0Call madj(m, ETHER_ALIGN) to offset rx bu= ffers when allocating them.
> > >=C2=A0 =C2=A0 =C2=A0This improves performance everywhere, and= allows armv7 to work at
> > all.
> > >
> > >=C2=A0 =C2=A0 =C2=A0PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0271288 (PR had a different fix than I= wound
> > up with)
> > >=C2=A0 =C2=A0 =C2=A0MFC After:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 3 days
> > >=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0Netflix
> > >=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 https://reviews.freebsd.org/D43136
> > > ---
> > >=C2=A0 sys/dev/virtio/network/if_vtnet.c | 2 +-
> > >=C2=A0 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/sys/dev/virtio/network/if_vtnet.c
> > b/sys/dev/virtio/network/if_vtnet.c
> > > index 287af7751066..360176e4f845 100644
> > > --- a/sys/dev/virtio/network/if_vtnet.c
> > > +++ b/sys/dev/virtio/network/if_vtnet.c
> > > @@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc = *sc, int
> > nbufs, struct mbuf **m_tailp)
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0m_freem(m_head);
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0return (NULL);
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
> > > -
> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m->= m_len =3D size;
> > > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m_adj(m, ET= HER_ALIGN);
> >
> > The driver is expecting to get a cluster of size sc->vtnet_rx_= clustersz,
> > but now it's getting one of size sc->vtnet_rx_clustersz - = 2.=C2=A0 I don't
> > see how this change can be sufficient on its own: what prevents v= irtio
> > from writing sc->vtnet_rx_clustersz bytes and thereby overwrit= ing the
> > two bytes following the cluster?
> >
>
> The only trouble that I saw was here:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * Every = mbuf should have the expected cluster size since
> that
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * is als= o used to allocate the replacements.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KASSERT(m= ->m_len =3D=3D clustersz,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0("%s: mbuf size %d not expected cluster size %d",
> __func__,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0m->m_len, clustersz));
>
> and even that's fine: We can adjust that assert. The next lines I = think
> make it fine:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m->m_l= en =3D MIN(m->m_len, len);
>
> so we only use what we say is there to land bytes into the mbuf.=C2=A0= I'm now
> not sure though what to do about a few lines later:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 m_new =3D vtnet_rx_alloc_buf(sc, nreplace, = &m_tail);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (m_new =3D=3D NULL) {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0m_prev-&g= t;m_len =3D clustersz;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (E= NOBUFS);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>
> which likely needs to be adjusted (or the old saved size).

I'm not certain about what it should be doing instead, but yes this cod= e
looks wrong now.

Yea. We need to do this at time of use not time of alloc.

> I likely didn't see asserts in my testing because I didn't hav= e LRO slow
> path packets.
>
> Do you see other places that would need adjusting?

Presumably vtnet_rx_cluster_size() needs to be adjusted too?

I also don't understand why we do this adjustment unconditionally
instead of only when __NO_STRICT_ALIGNMENT is not defined, as almost all other NIC drivers do.

None of the ones I looked at had this... maybe I got u= nlucky. I'd think we'd have better performance if things are aligne= d all the way... is there a reason not to?
Yea, I see a lot of other drivers now...=C2=A0 I'll follow = the trend. I think it gives the ability to receive a full jumbo frame if I = don't adjust.


has the updated patches, including backing out this change and movi= ng it from alloc time to use time which seems better since we're chaini= ng and should work for all the cases we're talking about here.

Warner
=C2=A0
Warner

> All the other places
> seem to use m_len correctly on the rx path, but I'm not a nic driv= er guy,
> and I might be missing something.
--000000000000700aaa060d0bcb6f-- From nobody Thu Dec 21 21:37:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx3gR75Kpz54JKv; Thu, 21 Dec 2023 21:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx3gR6ZG1z4Pkc; Thu, 21 Dec 2023 21:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703194659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T/0H456BQz2vpLJL47nD2JGSoFBOoF/qKfF5QzQl/OM=; b=eWW2DQzaABAdx+PoQPaxOKVP4bJEInIEs9ZzNzCXGckQ9sYNdr4RykDlcloE+Mp+vk6OOT XPvC4KBwFBBMk6B9z5abb36HHpRwHgUbcCVcH1kIsJ8tbb7fpD3gc2DDJ/MYy5/1AQ5Mfb Y8NqlrifyVF/JsyxvAYGJgjj2wBhwnfTSlZxrB3VNEGHLFJfOIoviPGL7Yu1/+peldS7Hl QSckVB2SgHOHycmRyL0BQrT7OObRv/vWPNjjK+ZLSNmthF2IG+37JreBp68BaWA+AVv8Hy DtUW3BlCAvgFrjz1ea7IbZDSBafUjKHeVIrjMEhJENARIBY1Gtsxox3FKtdCVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703194659; a=rsa-sha256; cv=none; b=u63As03L0jkk6HZ2NVyrCMBx5sm+HMr+RTVSdN4j3bkSeF3vxZDUOENzlX01h5p+uzsvsQ W9qBctSSjh28OWli46Xvm+biaOywbdt2Bfu/vmxLByRvIKg+1+pkXVXW7sPLp8DoRxbQSF ZW8qixyamzFQ3058oJv6CoHtgErtvde4MC0MJuielaZzxHYxs87HbXVyOuh0jUm+24XAZE s43I7/uNgyzm9Bn2NpO1462KGP03VIcP1J/qo46eB+htWHTZCL2qoQy1XsW99Wedh+tqP8 A+HkBMt/3YSF0Da2VP2Vof6I1OAZOb6wldkIhEERNbmh8ernj7nPXjuSoA4itA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703194659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T/0H456BQz2vpLJL47nD2JGSoFBOoF/qKfF5QzQl/OM=; b=r4sunh5CevNOjIq/PIYhgG2cJl+Bm9T5wtadpI5yOZciMXz+PSLgJ12QXkiE1rdJfrObqW vBmNBVPRU8Er8AfZCt0mHi8nKVCCH8u+s6eiPO1lCJpTjE84rE4fJjBRuXXv2hY6yO+vlq PW6XmUzHJggnk2e1GUBYiiEE5yX/zpOa93YmZqpJJNBptRLm2GAbg8gORb9nWX6sMQU/+2 NFwOmmKsMcKPz74qG/659FbEG+b/05Zsgkj9MbDYR6VR2EqDgZ0jFHn0mqPGHJL/k3XqlU HgtD7ZJH64G87kA/E1gsR+/dycyrxxEf1BlNeLPiR+tbGAmxR567KO6tMsaLcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx3gR5cv5zppk; Thu, 21 Dec 2023 21:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLLbdrk068360; Thu, 21 Dec 2023 21:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLLbdbR068357; Thu, 21 Dec 2023 21:37:39 GMT (envelope-from git) Date: Thu, 21 Dec 2023 21:37:39 GMT Message-Id: <202312212137.3BLLbdbR068357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 5d21ac643bb2 - main - Revert "power*/SYS.h: implement _SYSCALL_BODY() 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d21ac643bb2a8d265470bf69043e50f060169d9 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5d21ac643bb2a8d265470bf69043e50f060169d9 commit 5d21ac643bb2a8d265470bf69043e50f060169d9 Author: Brooks Davis AuthorDate: 2023-12-21 21:36:12 +0000 Commit: Brooks Davis CommitDate: 2023-12-21 21:37:09 +0000 Revert "power*/SYS.h: implement _SYSCALL_BODY() macro" bapt reports build errors on powerpc/powerpc so this is the most likely culprit. This reverts commit e88e1272792e41cbf0a5af1f5f0a858afece0475. --- lib/libc/powerpc/SYS.h | 13 ++++++------- lib/libc/powerpc64/SYS.h | 28 ++++++++++++++++++---------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/lib/libc/powerpc/SYS.h b/lib/libc/powerpc/SYS.h index 24315f369531..8c47a65735f5 100644 --- a/lib/libc/powerpc/SYS.h +++ b/lib/libc/powerpc/SYS.h @@ -40,17 +40,14 @@ li 0,(SYS_##name); \ sc -#define _SYSCALL_BODY(name) \ - _SYSCALL(name) \ - bnslr; \ - b CNAME(HIDENAME(cerror)) - #define PSEUDO(name) \ .text; \ .align 2; \ ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL_BODY(name); \ + _SYSCALL(name); \ + bnslr; \ + b CNAME(HIDENAME(cerror)); \ END(__sys_##name) #define RSYSCALL(name) \ @@ -59,5 +56,7 @@ END(__sys_##name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL_BODY(name); \ + _SYSCALL(name); \ + bnslr; \ + b CNAME(HIDENAME(cerror)); \ END(__sys_##name) diff --git a/lib/libc/powerpc64/SYS.h b/lib/libc/powerpc64/SYS.h index bf8bc6cc0e27..dccd08b63541 100644 --- a/lib/libc/powerpc64/SYS.h +++ b/lib/libc/powerpc64/SYS.h @@ -40,7 +40,11 @@ li 0,(SYS_##name); \ sc -#define _SYSCALL_BODY(name) \ +#define PSEUDO(name) \ + .text; \ + .align 2; \ +ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ _SYSCALL(name); \ bnslr; \ mflr %r0; \ @@ -51,14 +55,7 @@ addi %r1,%r1,48; \ ld %r0,16(%r1); \ mtlr %r0; \ - blr - -#define PSEUDO(name) \ - .text; \ - .align 2; \ -ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL_BODY(name); \ + blr; \ END(__sys_##name) #define RSYSCALL(name) \ @@ -67,5 +64,16 @@ END(__sys_##name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - _SYSCALL_BODY(name); \ + _SYSCALL(name); \ + bnslr; \ + \ + mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl CNAME(HIDENAME(cerror)); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ + blr; \ END(__sys_##name) From nobody Thu Dec 21 22:46:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx5BP5PHHz54N6b; Thu, 21 Dec 2023 22:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx5BP4rhLz4VgL; Thu, 21 Dec 2023 22:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qe85FFLrVCHnCF5YaJHCFooZsFodbCtroXLJvhBeaao=; b=bdHc/YNqm2q2qmZwwjUXDRYbWtaVH8ahACi92eff56pELeneWvWJW/Ems6zMJlnZPrX0KX XgGvr6eZJHM/0OIq9S9AMax0gNCwSEL5OV5z+M/guSqF0YrWXkvQw5baKS2tC/+zblSjz+ GDbD3ZB2bUhxTKl0OSlOXvnejT4KJQC9LwViufF41scBAeyId2Vnkl/gUnLms/ACdJtobR tdV51w5RmuApYpVbzcqmvpMa/FH76PEp2XMyL5tZyYl1LFQBYUD5+jvjZZbnn+tBHV92h4 +VQBlazA2PDcXEpGUL1+KdWJmw5m6O2taZvYfiiwNX3Lyd6mg3JPh8BAS3EIug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703198765; a=rsa-sha256; cv=none; b=H/yUV9ktTJzGuM341EHMcxccDflqjhx3nAKVKfQMpCBfhU4Pstx4fFk51/vErQWvVqL14Z GKF0h1R0JDUvYezf4TiaH2/HDRxEzuyIlCO7OJg6f3//VlwB7xo2p+71qhhWLeQHBvWUxO o60Uf914BXpfH1Im0+SVcX0hC58HNuJ4jAXhlSclEAaXPv6D2Q9LHdFw4Y4jkJ4qKVuovo 2DKgxk9/ML69MYlVvRSwzhZbLd1YmCQf9WBJ/3H+QlglVPyHgCFHMozrUcMYWn91uVziPE gvIdFESlQnmq9wguFSYU66ncy3tyzVHIboMUoEJoRID495H3T3enb80MBdz78g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qe85FFLrVCHnCF5YaJHCFooZsFodbCtroXLJvhBeaao=; b=DsyJhYrwXVshlyBLt6UH+EwQiS11g9sCmTWDCN2GuCzJ8qwiTvqLMzVjVNRfoyaVa4nteL eTGgKLbEictR5a8eKLvOQlL7TXiYoDEjC29Nq7kCqJ16cdNLoM0GF+3I5JnFgizi+Qu7c/ GXEMI83NB6JiySBpTqth2ifNCZ0toxDWcTWN6wBN95GrvK7u+ZtJTVbfRVHuBNfUDiMx+0 YNn6CkUb5nO2csZDYXhmNIFQVKTXSfJQLeGU95RsCbZ/e71u5TulJ+TVkLWvfP4WkqeoK/ Rvw8DWKFxHbs7LrczWNAIApwmfKaR6uRnwa8kIxrVhLJwYge4bvMZi/PTqQc/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx5BP3p3Wzrm3; Thu, 21 Dec 2023 22:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLMk5xe086004; Thu, 21 Dec 2023 22:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLMk5Oi086001; Thu, 21 Dec 2023 22:46:05 GMT (envelope-from git) Date: Thu, 21 Dec 2023 22:46:05 GMT Message-Id: <202312212246.3BLMk5Oi086001@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: c794d188222a - main - Fix snprintf truncation in telnet List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c794d188222a4d3414233ff9630d47eedc090fbe Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c794d188222a4d3414233ff9630d47eedc090fbe commit c794d188222a4d3414233ff9630d47eedc090fbe Author: Dimitry Andric AuthorDate: 2023-12-21 22:35:17 +0000 Commit: Dimitry Andric CommitDate: 2023-12-21 22:45:52 +0000 Fix snprintf truncation in telnet Building telnet with clang 18 results in the following warning: contrib/telnet/telnet/telnet.c:231:5: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 11 [-Werror,-Wformat-truncation] 231 | snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, | ^ The temp2 buffer is 10 chars, while the format string also consists of 10 chars. Therefore, snprintf(3) will truncate the last character, 'SE' (end sub negotation) in this case. Bump the buffer to 11 chars to avoid truncation. MFC after: 3 days --- contrib/telnet/telnet/telnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/telnet/telnet/telnet.c b/contrib/telnet/telnet/telnet.c index a35ea40c4cd8..c936a85c9a23 100644 --- a/contrib/telnet/telnet/telnet.c +++ b/contrib/telnet/telnet/telnet.c @@ -206,7 +206,7 @@ unsigned char ComPortBaudRate[256]; void DoBaudRate(char *arg) { - char *temp, temp2[10]; + char *temp, temp2[11]; int i; uint32_t baudrate; From nobody Thu Dec 21 22:46:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx5BQ6Nb6z54N23; Thu, 21 Dec 2023 22:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx5BQ5VMkz4Vhc; Thu, 21 Dec 2023 22:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ihifob0VRReKnimZts7zUG361dWzL1KLb1yksQA1kV0=; b=pSyD/rkYl1n8icv6Kh2uDRmmGzjZejelmF0w7JTwze3rQ7MrbGtMsomJDd61FEJMqpfHx/ v2afIZatquLzsdLbXH1xfr+R0BVri/6ohy/qmPt+MppLOq9J/BRTbC8CEQG3f1Fc0RVUxd EGR1JUap5JSJnB6JgBPCwX9EXmNPywYtXuvg4/1fn3pJGwpd3jP2LVvY92ACLFML1+3oeH x/frUm5hl+9SxbNGNw5KGBYWDnnC4KmF7nKZudP1huRbDQKaUqHqwSZME5Fo8P5k83AnJm cRSg70/QvYi2OePgdseY8QtI085jyD2jsQdIs5dQunsSDzpjf8U/voeP/M1YAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703198766; a=rsa-sha256; cv=none; b=UcZ2wQ81Q6chGDzl5Z1did+R+IcY/EgMICXDoabN9eyXlImyY221j2WK++h4uwCyc/kG1s 9hmn9nlUdPTzmda8UO5sTc7glnHkcUoOwH/U2Vr60wkL6r9+pVKWuHqnRzhOf2tk2A4LN+ 6PDoVLgIG52W62ggAnsKmlXNbmI6mJjcrEj7H6dZaIWAtOjphj8EEb3HltqApUL18T7lmM YRx9x6uXNVGoTwo06/olIMj+DexVwuBOJyJBHKMD+fsQoIfSpsmuwFAuPm2o3qNvTAV9kc 2Fqj/7qZ/K7kfQcuQqwxbwOX6WtMXY4KTU4qmsvXgh/6//cyn0kuE8FAs2+qwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ihifob0VRReKnimZts7zUG361dWzL1KLb1yksQA1kV0=; b=aC6IHVGkEl4kExR3Uvi2++qqzxnGxa3xB69Y2HMOskJ2QiAVzHNESScKLxQVwqieeBqPHV gYvq7UyW5STgqVHoMvuWesIlOl+6ga3wIt0m430BW/OACuYyCbbS0eQknEQMtTMoekorrR 4P8tigN+4o0V6MINbO9vU0Q4/lqwYkvQcqgx5D05tdIE3Tvk91/bacBGymzCdO12sl+kxS aa0Sv5Qs9HEQ1+4/oyeWNJOIfbc9kZRsbA7PvWg5evNasQXRnSih7Iy5p+Y4zJ6it/uUfI XbHljz2/sS3Xvl/wFCCyDoLfE/qR8lNQ2wktJ6mtVYdfambMY0DhYVZcU8kQnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx5BQ4ZnDzrm4; Thu, 21 Dec 2023 22:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLMk6iA086052; Thu, 21 Dec 2023 22:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLMk61v086049; Thu, 21 Dec 2023 22:46:06 GMT (envelope-from git) Date: Thu, 21 Dec 2023 22:46:06 GMT Message-Id: <202312212246.3BLMk61v086049@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: 69c8025a4984 - main - Silence snprintf truncation warnings in printf_test examples List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b commit 69c8025a498450b6bc4cc9e97ba779ed1c2e7f4b Author: Dimitry Andric AuthorDate: 2023-12-21 22:39:15 +0000 Commit: Dimitry Andric CommitDate: 2023-12-21 22:45:52 +0000 Silence snprintf truncation warnings in printf_test examples Building share/examples/tests with clang 18 results in a few warnings like: share/examples/tests/tests/plain/printf_test.c:67:6: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 17 [-Werror,-Wformat-truncation] 67 | if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16) | ^ Since these tests are meant as an example of testing snprintf overflow, suppress the warnings. MFC after: 3 days --- share/examples/tests/tests/atf/Makefile | 4 ++++ share/examples/tests/tests/plain/Makefile | 4 ++++ share/examples/tests/tests/tap/Makefile | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/share/examples/tests/tests/atf/Makefile b/share/examples/tests/tests/atf/Makefile index 305d66c51f38..7614767b6e0a 100644 --- a/share/examples/tests/tests/atf/Makefile +++ b/share/examples/tests/tests/atf/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif diff --git a/share/examples/tests/tests/plain/Makefile b/share/examples/tests/tests/plain/Makefile index 2594968a6f44..462324309f6a 100644 --- a/share/examples/tests/tests/plain/Makefile +++ b/share/examples/tests/tests/plain/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif diff --git a/share/examples/tests/tests/tap/Makefile b/share/examples/tests/tests/tap/Makefile index 5b829afd5838..86d3f6805045 100644 --- a/share/examples/tests/tests/tap/Makefile +++ b/share/examples/tests/tests/tap/Makefile @@ -46,3 +46,7 @@ file1: @echo "File 1" > ${.TARGET} .include + +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +CWARNFLAGS.printf_test.c+= -Wno-format-truncation +.endif From nobody Thu Dec 21 22:46:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx5BS1mJmz54N4P; Thu, 21 Dec 2023 22:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx5BR6FfBz4VSs; Thu, 21 Dec 2023 22:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4D9ecGid8mNrF7tMSQjibfW6OjeeYEDQQ+JSlT1p4iE=; b=rRIfCjO6hZownflmclOy+CvcW1/3KdCeYSQ99B4BF6yJ/4ekwcOcnlH6SxZ3wuxRESbk6R 5maVC33c5wr2bg6fFXfWDmwSPVtRW5u2opIr5tlaNwdwTUfA8EXbFPLeAbVh7zqg4ERAeU KjGEZFt0DPydW1r+rT62cLnl8fPJDdwBmhzTi0+pqRawSO8jQY7ZkaK2G5DL7qVJVBMfvx 6vCo33DUolaQ95NAyzMJRrimePOTvRcppuMKrhn3i+G8GL0hrZJL5u0BAX8iFCHRpng2HW LVFj6zbDAOkgnG8C0JkAxgvbPsfnwOVie11t2AQ1j05TDAvncuPRF06SYtT3Zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703198767; a=rsa-sha256; cv=none; b=wt3aVcU24/xv5TV9892clBBomULH+d2vcmVaKXzDBBwxofGjth/XVB1vHI20NMXQNTsvgR K/4u1V4tKGFRbjqIMPV6nA7yN625JArGAY3NUxkX9540Wu7q8IeFjq3EktmSf7W6i/fGiS qT/ryMfYnBr4Im/TnkvCAPci/JXRby4I+kcld8skSHLo6BKWjPTJDlMiVfCKb3bRYPRyD1 VRoQNG0hLLhWdQzyfo1gUoV6KuE4h9udWVug2OhoNhJ/TPXdC5Pd/pqvPzM5NO8S/mRfNJ Q7N6lAfFn8AxDR4XBMvhyC/ygYhK4BX+m/lukGk8dHm8xsOLOb42AppxMkTmAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703198767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4D9ecGid8mNrF7tMSQjibfW6OjeeYEDQQ+JSlT1p4iE=; b=DCnlAnSKOs5a20aRsKpkXeAUKi2ZWBBzyrUTOWBx1bXnoRAKFmx4TLCKIhNaMSdPBlAj/B H5a7QF0kBCLcRKFEWnIvdeCAVCxj+suXFsPrD7Wx8tCTfMsMdQJfMgu0y4LrBLOsxg7/5Z pEJ3yVIAdxt/08OEWo9AybAvjFe3GmIPZV9rqQsBgARp5UiN0mVnlCP5b0ijPL/bFNFK+0 96RE5h810uBkTEGlgD0DhGSGlhvh5gF0gC4XpTrUz09a8ltjP4+VVI9F7sMOhD5w53RP3U +c6TMwQ/8m4xaH0aRuMShFyoI/b93YUIUQb7PZHWPCC73RV64BthRfEB03fRWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx5BR5LWyzrm5; Thu, 21 Dec 2023 22:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLMk79Y086100; Thu, 21 Dec 2023 22:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLMk7dI086097; Thu, 21 Dec 2023 22:46:07 GMT (envelope-from git) Date: Thu, 21 Dec 2023 22:46:07 GMT Message-Id: <202312212246.3BLMk7dI086097@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: dc0b4094abf6 - main - Silence VLA extension warnings in fusefs 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: dc0b4094abf6784bf1a9492c2fea3fb91116b014 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=dc0b4094abf6784bf1a9492c2fea3fb91116b014 commit dc0b4094abf6784bf1a9492c2fea3fb91116b014 Author: Dimitry Andric AuthorDate: 2023-12-21 22:41:57 +0000 Commit: Dimitry Andric CommitDate: 2023-12-21 22:45:52 +0000 Silence VLA extension warnings in fusefs tests Building tests/sys/fs/fusefs with clang 18 results the following warning: tests/sys/fs/fusefs/cache.cc:145:14: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 145 | uint8_t buf[bufsize]; | ^~~~~~~ Because we do not particularly care that this is a clang extension, suppress the warning. MFC after: 3 days --- tests/sys/fs/fusefs/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index 6b0a6ef366b0..f45f2f93e1c0 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -83,6 +83,10 @@ CXXWARNFLAGS+= -Wno-class-memaccess CXXWARNFLAGS.gcc+= -Wno-unused-but-set-variable # Suppress warnings about deprecated implicit copy constructors in gtest. CXXWARNFLAGS+= -Wno-deprecated-copy +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000 +# clang 18.0.0 introduces a new warning about variable length arrays in C++. +CXXWARNFLAGS+= -Wno-vla-cxx-extension +.endif CXXFLAGS+= -I${SRCTOP}/tests CXXFLAGS+= -I${FUSEFS} CXXFLAGS+= -I${MOUNT} From nobody Thu Dec 21 23:42:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx6Qy1X5pz54QkK; Thu, 21 Dec 2023 23:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx6Qy0glrz4c7t; Thu, 21 Dec 2023 23:42:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703202122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KoQY8myvm3TfJmGzGdhslq1+CMKx5wOSgE7EoqyHxS4=; b=OUZa/Fa5yj56fslM2x/MvewhjACFrguoQMGyyC7UP3pksauUhUw1DCjUXkcIr4SUTX04Hd Mo93oVxXq+gxH8PQvhuMfKYwXO38lChTaOgrQKz3Ov98k5aTyR+L07DHbBpDL7WKeZx7nu TS2uFWMtgjzt+D+KO2pZ3rMlOUY3Qgey69D45TBp+FLWmrg14SDtkXYa6pvD7Wxo51gTHb 6FeQyNfUv4OjGlA5dgoKe0FLyKfkooD+HBwnSYW/SfM0cIrc1TkVeXt64HjrYMgQ5nQqZK pfdC5VQIzn97O/DHKE6cbKHa5GofLZpmJwiEz+0NCcvRnNeXIbYPbhIrZSRigQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703202122; a=rsa-sha256; cv=none; b=VQSUSmwTb7oeFdRWiJwnVKiUoz4fDjLCELcgs/oOOBtGjQrZKTfhQr3jXbFel+TMKjvzDS qJ1H9kxQFJ8nSZQN8e4opFpzKeA0XejUjnJHM9h/IVMBBkrMSVOpN+VrqIi8ZhqdiNHyQq 9UDTDLM/3/qzyM4VeODaH9dqcJ8IDbEtTCpmyd6w0Ihspj2FzK9FeQp2Ziz93SFk0dBr+h 6dFAKLp5e1P7FNht7MuLG2+kfR16FCC+lzmgQ3RXdpY2gOXzlnh3widJPz1IuwAHUObMcL LT5SirJcaiG3h8FbSfX9Lphrf5/NFD+7QVyCRF/PjATJEh3eRgto7COo3kx0Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703202122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KoQY8myvm3TfJmGzGdhslq1+CMKx5wOSgE7EoqyHxS4=; b=R1NNX+rv8TPK1v15xb/wivFLMS6tBDcwFSLl3sySjzdCEbEhY4pnR5ReGfkWRNtY49ZcJ5 tUwW5egJV4y/kS5kI4R25ImI9Adwh4XUSVQNs9d2BFImxX577jQiJ6SokVEYHgJPsgJmFR lF3xVp6xpstOsqaYM8R8rEJsqYUVvh3pYbEahyWPhVXmndhIE/Y1uEynHaYo8cuT1ZwDfm uyEWHyHVwJGqyaG4yGjgBae61aK3Hq77Zq6OKyl5v3VGwTtOixPO8XGous0dUMg1/6aL1J EZls8l67YRgIptIQ7dabkWsN8VKq9+Nw9HI4W+UKtJNVvrpXQd0HhZqUmGRwhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx6Qx6gymztJD; Thu, 21 Dec 2023 23:42:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BLNg1OW085572; Thu, 21 Dec 2023 23:42:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BLNg1vg085569; Thu, 21 Dec 2023 23:42:01 GMT (envelope-from git) Date: Thu, 21 Dec 2023 23:42:01 GMT Message-Id: <202312212342.3BLNg1vg085569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 45438f9c8b5b - main - find: Add a warning about -delete. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45438f9c8b5b91ebf5606b4a98e891559913d25b Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=45438f9c8b5b91ebf5606b4a98e891559913d25b commit 45438f9c8b5b91ebf5606b4a98e891559913d25b Author: Dag-Erling Smørgrav AuthorDate: 2023-12-21 23:41:05 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-21 23:41:16 +0000 find: Add a warning about -delete. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D43162 --- usr.bin/find/find.1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 80cb175c550d..de16b012ce4d 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 23, 2023 +.Dd December 22, 2023 .Dt FIND 1 .Os .Sh NAME @@ -347,6 +347,22 @@ The .Ic -delete primary will fail to delete a directory if it is not empty. Following symlinks is incompatible with this option. +.Pp +.Em WARNING : +The +.Ic -delete +primary will immediately attempt to delete the current path when +evaluated. +Be mindful of its place in the expression; as a general rule, it +should almost always come last. +If in doubt, try running with +.Ic -print +in place of +.Ic -delete +first. +See +.Sx OPERATORS +below for additional information on the order of evaluation. .It Ic -depth Always true; same as the non-portable From nobody Fri Dec 22 00:19:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx7GX1t0bz54SnP; Fri, 22 Dec 2023 00:19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx7GX182pz4fdy; Fri, 22 Dec 2023 00:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yv2YBaPWqKKmd1LvLRZcUjVuxH9AUbFKoExf2sGLzPg=; b=bckLcQN1ypv6XVPZWBFcNKhQZlLDfmTezIG3ffc3K1B463gMQ+RFFArvG0bkundEm/cMPq WaLqzUGrN2BxaAKdTQLkFL7AXuybqeTJL4BAtmd6xTR5tiutujoBjPzh/hOsdwhlzuCEt4 AeboAqmdvjuyIF4l7LtKpXxuMvJuqWQKs+kPQyb70mrusyXCiPQbdIhYBK9HgepIjxsskP OJ644ByAOVHFDC0y2rhmPMjFLpXC190I+5CIXvZNmqTZkv53EqUS65OO0xfvy6v7pGW8/x J3W8Jxsdus8my5wT0G52ZT6p88PWEQURHJqk+sw4sM2fbED28H8UFzusLWbsvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703204388; a=rsa-sha256; cv=none; b=Fd8Xhf+UlrBzcAxbLTQ8nRkHaF4KIyKxLKxV7wTHRxXlo6TEHaKsAx6gkyoeqOIUGtl2kb vacARMb3qBb/AGptP4Kj9Di/joFLo41FDkhAh9QPYtBykpg0JJw91zT1d1cSN/KV1uowcw cbmcgNUO53czhBeduq42RHIo3+0+tYhRXTaiuOaVMi7/CyW7LUR2XSQVPrmrQWebYsEVsO 9jPbfV5lJ/f/Zm4hVGPYlNK1l3KN2Ts6YPfBwzyo6raG0Rd/a80xQGnwAFgQvLQEogiYdz KawMwY0MbbLD7XyPkmnm7rOVY38Izx09O5ThGRe9+0N4qyF7hz9gRbSGl/wTAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yv2YBaPWqKKmd1LvLRZcUjVuxH9AUbFKoExf2sGLzPg=; b=wtBMycsuuUvIWXy4T5JKPP1S1PVWbd71IQDndJfO0veUsj6m+zdYBrIpcd01RAzvfpQY0P pQ9RsVRVQC1w+iYUgPB078jFJfUd0ubDWr2Z3/Qou9XCXZe/deGUbtykCXDj2R8JbWTH/a 6omFcfvJa9ILbImvcfEKynYhax1S8kpzYpySJpQkJcjfJMG2nobR1gnYcLQMOFyqj83W8C CyP9EGWA6HY0LNgCUHXCX8ALzuIsFNDHU7x4APjbqZHG/t4biCESbgaXt0Ie/ZMLuaeki3 JVu6GznPdjsNT3I/fF5DGDEL2Kg1WfmQXQisZ0v4FMf7Av6bREJr8fKKcSx4FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx7GX0BnkzttZ; Fri, 22 Dec 2023 00:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BM0Jlkf037169; Fri, 22 Dec 2023 00:19:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BM0JlIB037166; Fri, 22 Dec 2023 00:19:47 GMT (envelope-from git) Date: Fri, 22 Dec 2023 00:19:47 GMT Message-Id: <202312220019.3BM0JlIB037166@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: 72bb33a36b62 - main - net80211: improve logging about state transitions lost List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 72bb33a36b62fa30f69f01d3f6ae372be2c95b59 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=72bb33a36b62fa30f69f01d3f6ae372be2c95b59 commit 72bb33a36b62fa30f69f01d3f6ae372be2c95b59 Author: Bjoern A. Zeeb AuthorDate: 2023-11-12 23:51:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-12-22 00:19:05 +0000 net80211: improve logging about state transitions lost It is possible that we call ieee80211_new_state_locked() again before a previous task finished to completion (not run yet or unlocked in between) since 5efea30f039c4 (and follow-up). In either case we would overwrite the new state and argument in the vap. While most drivers somehow deal with that (or not), LinuxKPI 802.11 compat code has KASSERTs to keep net80211, LinuxKPI and driver/firmware state in sync and they may trigger due to a missing transition or more likely a changed ni/lsta. Enhance the wlandebug +state logging for these cases so they are easier to debug. While here remove the unconditional logging to the message buffer; it has been here for a good decade but not helped to actually identify and sort the problem. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42560 --- sys/net80211/ieee80211_proto.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index cf170463372b..a3a2e6a5d027 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2506,6 +2506,13 @@ ieee80211_newstate_cb(void *xvap, int npending) nstate = vap->iv_nstate; arg = vap->iv_nstate_arg; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: running state update %s -> %s (%d)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + npending); + if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { /* * We have been requested to drop back to the INIT before @@ -2673,29 +2680,30 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, * until this is completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s (%s) transition discarded\n", - __func__, + "%s:%d: %s -> %s (%s) transition discarded\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; } else if (vap->iv_state != vap->iv_nstate) { -#if 0 /* Warn if the previous state hasn't completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: pending %s -> %s transition lost\n", __func__, + "%s:%d: pending %s -> %s (now to %s) transition lost\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#else - /* XXX temporarily enable to identify issues */ - if_printf(vap->iv_ifp, - "%s: pending %s -> %s transition lost\n", - __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#endif + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); } } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: starting state update %s -> %s (%s)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); + nrunning = nscanning = 0; /* XXX can track this state instead of calculating */ TAILQ_FOREACH(vp, &ic->ic_vaps, iv_next) { From nobody Fri Dec 22 00:21:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx7JY5MjPz54SNc; Fri, 22 Dec 2023 00:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx7JY4wTbz3C9c; Fri, 22 Dec 2023 00:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QFyveAP4P8La/HwORG6pKv4J1aSHXyai+JSntdt1oQE=; b=CDUPkW3I5HtfE9VFgW9Eq50ChR80dW5Kt31eNb43on98K0N0IhQdXVTHJ7vAx359CyF3fx OrnE8B7AsoGT1rux1Ek7kPlD75rdbzTMJBKZIWGWeOuksZMlJtLlcmwixxSXWNavVasGMX SSeDK1OrVtN/W2qdWafbeSN9AfTiWCRnUWzX8Y43O5uqAgnSppLcHlROFn9qY+EfY8AjtR n9DepEl/3oHAbW8SL3NGbtG956z55Y8w/ILl9DrAOYRXYLHPExEqyYF4/AOwtK0XIk4UVf m2jnRny1h3xL3SxKFV/crfgpVgaFSozxyfDoAoWnPJgWdnHf7yNp1DRUUoSthw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703204493; a=rsa-sha256; cv=none; b=Q9bOFMxhwe8yifxPFY0+xqh45tw7Isc/UWu1TJgNFyTmHubjBz5VY1azSFV0VYGJu/bVuF hfVYzNK9YQcQjwczUPKF99yfneVen+vuysHusv9BHDyn3rvy0XuDWbdzbTw43PHGWvDAeD R4UiYNXB6vJyi/mDw7WsRgSambCWaF/rcFW2V70xWcF/8ziDgZnRTWUBevpa3dw5Lyvnji /zq30ED1+Nq1LWudyt0KcW/UQO4M1eujW2AJS2nZuYkkFkFnPCdiuPYXl7O1W2/8quaNc0 PbSIOIBS86LMtoQ33GgOroXncfDzFodmcUbusWwH8LqEdV402mHvuPNfBhBIjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QFyveAP4P8La/HwORG6pKv4J1aSHXyai+JSntdt1oQE=; b=lGt1L+HJB2Td9rU8vhM3UBYlxyndONHqdPfHDnJ0JOb1Ec5ktLbtj+dB2LBMNhlTilZeNj y7zDBRSOUZMHoqcNqmQIjszfNOZaRDOm8eFljSUhfIDaHQN+/xdWKVPRSNi0sHVirPRt9P dXG00f7uHeUxfDt2xgoPQlqDbbLLysB+5+M9WptTYenk+xaSG3Wi3tNwy+647qjpVQ1EXf 22zv7GAlcuI2fr2UKBM7zuyzN+aOnFaTaUOAMeFIvm4OUawjQm+fdT1jJ6zuKfExLbkuyn DCOwcEYOZZm4F//GB/VOunFIZptLQMFIcEqHasFa7RTyLH2THa273x6H9KxAqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx7JY3zXQztrr; Fri, 22 Dec 2023 00:21:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BM0LXZK050293; Fri, 22 Dec 2023 00:21:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BM0LXCG050290; Fri, 22 Dec 2023 00:21:33 GMT (envelope-from git) Date: Fri, 22 Dec 2023 00:21:33 GMT Message-Id: <202312220021.3BM0LXCG050290@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: e85eb4c8d7bd - main - net80211: adjust more VHT structures/fields List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e85eb4c8d7bd8051c351a6fc6982a8b3bcfdbb2d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e85eb4c8d7bd8051c351a6fc6982a8b3bcfdbb2d commit e85eb4c8d7bd8051c351a6fc6982a8b3bcfdbb2d Author: Bjoern A. Zeeb AuthorDate: 2023-12-02 20:40:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-12-22 00:20:19 +0000 net80211: adjust more VHT structures/fields Replace ieee80211_ie_vhtcap with ieee80211_vht_cap and ieee80211_ie_vht_operation with ieee80211_vht_operation. The "ie" version has the two bytes type/length at the beginning which we did not actually use as such (the one place doing did just as unused extra work). Using the non-"ie" versions allows us to re-use them on shared code. Using an enum helps us to not accidentally get unsuppored or unhandled values tough we cannot use it in the struct as we need to ensure the field width. ieee80211_vht_operation is guarded by _KERNEL/WANT_NET80211. While the header is supposed to be exported to user land historically, software such as wpa bring their own structure definitions. For in-tree usage it is only ifconfig which really cares (at least for now). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian (earlier), cc Differential Revision: https://reviews.freebsd.org/D42901 --- sbin/ifconfig/ifieee80211.c | 32 ++++++++++++++++++++++++-------- sys/net80211/ieee80211.h | 38 +++++++++++++++++--------------------- sys/net80211/ieee80211_hostap.c | 4 ++-- sys/net80211/ieee80211_input.c | 4 ++-- sys/net80211/ieee80211_output.c | 16 ++++++++-------- sys/net80211/ieee80211_vht.c | 23 ++++++----------------- sys/net80211/ieee80211_vht.h | 4 ++-- 7 files changed, 61 insertions(+), 60 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 42ef6d731662..bde079deb4c6 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -70,6 +70,7 @@ #include #include +#define WANT_NET80211 1 #include #include #include @@ -2780,10 +2781,18 @@ printvhtcap(if_ctx *ctx, const char *tag, const u_int8_t *ie) { printf("%s", tag); if (ctx->args->verbose) { - const struct ieee80211_ie_vhtcap *vhtcap = - (const struct ieee80211_ie_vhtcap *) ie; - uint32_t vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info); + const struct ieee80211_vht_cap *vhtcap; + uint32_t vhtcap_info; + /* Check that the the right size. */ + if (ie[1] != sizeof(*vhtcap)) { + printf(""); + return; + } + /* Skip Element ID and Length. */ + vhtcap = (const struct ieee80211_vht_cap *)(ie + 2); + + vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info); printf("supp_mcs.rx_mcs_map)); @@ -2803,13 +2812,20 @@ printvhtinfo(if_ctx *ctx, const char *tag, const u_int8_t *ie) { printf("%s", tag); if (ctx->args->verbose) { - const struct ieee80211_ie_vht_operation *vhtinfo = - (const struct ieee80211_ie_vht_operation *) ie; + const struct ieee80211_vht_operation *vhtinfo; + + /* Check that the the right size. */ + if (ie[1] != sizeof(*vhtinfo)) { + printf(""); + return; + } + /* Skip Element ID and Length. */ + vhtinfo = (const struct ieee80211_vht_operation *)(ie + 2); - printf("", + printf("", vhtinfo->chan_width, - vhtinfo->center_freq_seg1_idx, - vhtinfo->center_freq_seg2_idx, + vhtinfo->center_freq_seq0_idx, + vhtinfo->center_freq_seq1_idx, LE_READ_2(&vhtinfo->basic_mcs_set)); } } diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index b3fbd0a27b51..47e496bf42a1 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -869,29 +869,25 @@ struct ieee80211_vht_cap { struct ieee80211_vht_mcs_info supp_mcs; } __packed; -/* VHT capabilities element: 802.11ac-2013 8.4.2.160 */ -struct ieee80211_ie_vhtcap { - uint8_t ie; - uint8_t len; - uint32_t vht_cap_info; - struct ieee80211_vht_mcs_info supp_mcs; -} __packed; - -/* VHT operation mode subfields - 802.11ac-2013 Table 8.183x */ -#define IEEE80211_VHT_CHANWIDTH_USE_HT 0 /* Use HT IE for chw */ -#define IEEE80211_VHT_CHANWIDTH_80MHZ 1 /* 80MHz */ -#define IEEE80211_VHT_CHANWIDTH_160MHZ 2 /* 160MHz */ -#define IEEE80211_VHT_CHANWIDTH_80P80MHZ 3 /* 80+80MHz */ +/* 802.11ac-2013, Table 8-183x-VHT Operation Information subfields */ +enum ieee80211_vht_chanwidth { + IEEE80211_VHT_CHANWIDTH_USE_HT = 0, /* 20 MHz or 40 MHz */ + IEEE80211_VHT_CHANWIDTH_80MHZ = 1, /* 80MHz */ + IEEE80211_VHT_CHANWIDTH_160MHZ = 2, /* 160MHz */ + IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3, /* 80+80MHz */ + /* 4..255 reserved. */ +}; -/* VHT operation IE - 802.11ac-2013 8.4.2.161 */ -struct ieee80211_ie_vht_operation { - uint8_t ie; - uint8_t len; - uint8_t chan_width; - uint8_t center_freq_seg1_idx; - uint8_t center_freq_seg2_idx; - uint16_t basic_mcs_set; +/* The name conflicts with the same structure in wpa. Only ifconfig needs this. */ +#if defined(_KERNEL) || defined(WANT_NET80211) +/* 802.11ac-2013 8.4.2.161 VHT Operation element */ +struct ieee80211_vht_operation { + uint8_t chan_width; /* enum ieee80211_vht_chanwidth */ + uint8_t center_freq_seq0_idx; /* 20/40/80/160 - VHT chan1 */ + uint8_t center_freq_seq1_idx; /* 80+80 - VHT chan2 */ + uint16_t basic_mcs_set; /* Basic VHT-MCS and NSS Set */ } __packed; +#endif /* 802.11ac VHT Capabilities */ #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 0x00000000 diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index c1196961ad54..67c45bd38935 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -2125,12 +2125,12 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, /* Validate VHT IEs */ if (vhtcap != NULL) { IEEE80211_VERIFY_LENGTH(vhtcap[1], - sizeof(struct ieee80211_ie_vhtcap) - 2, + sizeof(struct ieee80211_vht_cap), return); } if (vhtinfo != NULL) { IEEE80211_VERIFY_LENGTH(vhtinfo[1], - sizeof(struct ieee80211_ie_vht_operation) - 2, + sizeof(struct ieee80211_vht_operation), return); } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index a4bfe49bd8c4..925918c872dc 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -773,12 +773,12 @@ ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m, /* Process VHT IEs */ if (scan->vhtcap != NULL) { IEEE80211_VERIFY_LENGTH(scan->vhtcap[1], - sizeof(struct ieee80211_ie_vhtcap) - 2, + sizeof(struct ieee80211_vht_cap), scan->vhtcap = NULL); } if (scan->vhtopmode != NULL) { IEEE80211_VERIFY_LENGTH(scan->vhtopmode[1], - sizeof(struct ieee80211_ie_vht_operation) - 2, + sizeof(struct ieee80211_vht_operation), scan->vhtopmode = NULL); } diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index a5fad2462598..22bbfe98f4b5 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -2456,7 +2456,7 @@ ieee80211_probereq_ie_len(struct ieee80211vap *vap, struct ieee80211com *ic) sizeof(struct ieee80211_ie_htcap) : 0) #ifdef notyet + sizeof(struct ieee80211_ie_htinfo) /* XXX not needed? */ - + sizeof(struct ieee80211_ie_vhtcap) + + 2 + sizeof(struct ieee80211_vht_cap) #endif + ((vap->iv_flags & IEEE80211_F_WPA1 && vap->iv_wpa_ie != NULL) ? vap->iv_wpa_ie[1] : 0) @@ -2821,7 +2821,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) + 2 + 26 + sizeof(struct ieee80211_wme_info) + sizeof(struct ieee80211_ie_htcap) - + sizeof(struct ieee80211_ie_vhtcap) + + 2 + sizeof(struct ieee80211_vht_cap) + 4 + sizeof(struct ieee80211_ie_htcap) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) @@ -2954,8 +2954,8 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + sizeof(struct ieee80211_ie_htcap) + 4 + sizeof(struct ieee80211_ie_htinfo) + 4 - + sizeof(struct ieee80211_ie_vhtcap) - + sizeof(struct ieee80211_ie_vht_operation) + + 2 + sizeof(struct ieee80211_vht_cap) + + 2 + sizeof(struct ieee80211_vht_operation) + sizeof(struct ieee80211_wme_param) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) @@ -3113,8 +3113,8 @@ ieee80211_alloc_proberesp(struct ieee80211_node *bss, int legacy) + sizeof(struct ieee80211_wme_param) + 4 + sizeof(struct ieee80211_ie_htcap) + 4 + sizeof(struct ieee80211_ie_htinfo) - + sizeof(struct ieee80211_ie_vhtcap) - + sizeof(struct ieee80211_ie_vht_operation) + + 2 + sizeof(struct ieee80211_vht_cap) + + 2 + sizeof(struct ieee80211_vht_operation) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) #endif @@ -3728,8 +3728,8 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni) /* XXX conditional? */ + 4+2*sizeof(struct ieee80211_ie_htcap)/* HT caps */ + 4+2*sizeof(struct ieee80211_ie_htinfo)/* HT info */ - + sizeof(struct ieee80211_ie_vhtcap)/* VHT caps */ - + sizeof(struct ieee80211_ie_vht_operation)/* VHT info */ + + 2 + sizeof(struct ieee80211_vht_cap)/* VHT caps */ + + 2 + sizeof(struct ieee80211_vht_operation)/* VHT info */ + (vap->iv_caps & IEEE80211_C_WME ? /* WME */ sizeof(struct ieee80211_wme_param) : 0) #ifdef IEEE80211_SUPPORT_SUPERG diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index 4b5a53d583ce..0839f426e09c 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -338,7 +338,7 @@ ieee80211_vht_node_leave(struct ieee80211_node *ni) */ void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vhtcap *vhtcap, int opmode) + struct ieee80211_vht_cap *vhtcap, int opmode) { struct ieee80211vap *vap = ni->ni_vap; // struct ieee80211com *ic = vap->iv_ic; @@ -346,9 +346,6 @@ ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, uint32_t new_vhtcap; int i; - vhtcap->ie = IEEE80211_ELEMID_VHT_CAP; - vhtcap->len = sizeof(struct ieee80211_ie_vhtcap) - 2; - /* * Capabilities - it depends on whether we are a station * or not. @@ -676,19 +673,12 @@ ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, uint8_t * ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni) { - struct ieee80211_ie_vhtcap vhtcap; - int opmode; - - opmode = 0; - if (ni->ni_vap->iv_opmode == IEEE80211_M_STA) - opmode = 1; - - ieee80211_vht_get_vhtcap_ie(ni, &vhtcap, opmode); + struct ieee80211_vht_cap vhtcap; - memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap)); + ieee80211_vht_get_vhtcap_ie(ni, &vhtcap, 1); frm[0] = IEEE80211_ELEMID_VHT_CAP; - frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2; + frm[1] = sizeof(vhtcap); frm += 2; /* 32-bit VHT capability */ @@ -771,10 +761,9 @@ ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c) uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) { - memset(frm, '\0', sizeof(struct ieee80211_ie_vht_operation)); frm[0] = IEEE80211_ELEMID_VHT_OPMODE; - frm[1] = sizeof(struct ieee80211_ie_vht_operation) - 2; + frm[1] = sizeof(struct ieee80211_vht_operation); frm += 2; /* 8-bit chanwidth */ @@ -882,7 +871,7 @@ ieee80211_vht_adjust_channel(struct ieee80211com *ic, */ void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vht_operation *vhtop, int opmode) + struct ieee80211_vht_operation *vhtop, int opmode) { printf("%s: called; TODO!\n", __func__); } diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index 756c2e367485..f2d1706ea0f2 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -61,8 +61,8 @@ struct ieee80211_channel * struct ieee80211_channel *, int); void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vhtcap *, int); + struct ieee80211_vht_cap *, int); void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vht_operation *, int); + struct ieee80211_vht_operation *, int); #endif /* _NET80211_IEEE80211_VHT_H_ */ From nobody Fri Dec 22 00:23:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sx7LQ2KrPz54Svr; Fri, 22 Dec 2023 00:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sx7LQ1fp7z3CQp; Fri, 22 Dec 2023 00:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TQ8dDjCYust2gnhLZz+eAaXrei3pyWvXfAPfwsuidZk=; b=NL9pEe9MOn4lJv1Fh6j9ojwZKpL6HITOwS80E4XJkc7nrbRKAoxZAGl+MRcq9dw3imAjaS vHgU0YtnRGocJaj9LAwat39cScMmP3IJkPb5GQDcRH2zt+u6VccVnN1FmM+9wwd/Xh/xD9 MYD9urg8+Nk5FvmYRieo3qJxnu3bkDsc454L2ayHsirGZvxMAqykLWRS+gRYrXRwTC9nII WDJuNauVGVLHHu45fbI2X2z5cODZxwkqX2f26qOMtF4ioGZVxdDm1bwKEiUd76m9PoQ6xn F5N4fC+tk5YJBaCL5kr+rL8JzQXa/qIPvpzo56I8eOax4DEuQaTxG71QpKanGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703204590; a=rsa-sha256; cv=none; b=eAnSXPVuGKYc99XRi/3Ar0tjfD5Q02Q/wNUiZMXAeEGLOFAlJMpc64UbJisvoL6gZe5uC3 ++X/02FeKQicVAiLBp3ueWd5xXRUAHYz6199lapTceaJSol1unbZDgMkKmZyb8Ow9/RzT3 ia2nD8v7QJLvsLrPmS0y9ofcFX61TqROFxDmHBupovq9nsHPg0MfpiuV6+TkQTgbwtmRlc a7UXT5yDQClEJNQuVJ4w37enzCbGPicACDfeDygqPcHiqERJ0baTTS07JaVwPIICdSXXVQ tpZRsOrm8RZcGrnCOaCzZyQf8FrCbEVezdf6ci++qtAPGtkcOz0BAiU+XFKBFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703204590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TQ8dDjCYust2gnhLZz+eAaXrei3pyWvXfAPfwsuidZk=; b=GUaGf0D8rlM2uILvG52lhMyw+ehekVnOYe+Kouovf1wKBchhq28DE/NbnUaNJS3bi+Wuza kmmeABWoYoqeRmbNb6Si+oosJdTWpYCNk7ZYvwVsCnLw7t/fpUIee35TvFXW/HAACTnqga +oV2FOJ1OtQHDs57Fr6ijQtlDF4nP6SO73ErGX8s3now46px3+mbIFp3et3F6OlGO6cpU8 MVxFqgrbB9gLqH3eFVZ0KVsjY3ekOmVFdkp/vU5W7GGw6QJ0vV30qCjJtCylY92DZNHHtN AUoSbqE1ma4MZ+L2z3ZY7/kWUsHzH9ft89AoBg8zBRNzU4QQYSSTR0O/MgwWIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sx7LQ0j6bzvKZ; Fri, 22 Dec 2023 00:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BM0NAom052789; Fri, 22 Dec 2023 00:23:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BM0NAKs052786; Fri, 22 Dec 2023 00:23:10 GMT (envelope-from git) Date: Fri, 22 Dec 2023 00:23:10 GMT Message-Id: <202312220023.3BM0NAKs052786@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: 488e8a7faca5 - main - LinuxKPI: reduce impact of large MAXCPU List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 488e8a7faca51a71987fbf00cd36cfcd19269db7 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=488e8a7faca51a71987fbf00cd36cfcd19269db7 commit 488e8a7faca51a71987fbf00cd36cfcd19269db7 Author: Bjoern A. Zeeb AuthorDate: 2023-10-23 23:14:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-12-22 00:22:04 +0000 LinuxKPI: reduce impact of large MAXCPU Start scaling arrays dynamically instead of using MAXCPU, resulting in extra allocations on startup but reducing the overall memory footprint. For the static single CPU mask we provide two versions to further save memory depending on a low or high CPU count system. The threshold to switch is currently at 128 CPUs on 64bit platforms. More detailed comments on the implementations can be found in the code. If I am not wrong on a MAXCPU=65536 system the memory footprint should roughly go down from 512M to 1.5M for the static single CPU mask. Submitted by: olce (most of this final version) Sponsored by: The FreeBSD Foundation PR: 274316 Differential Revision: https://reviews.freebsd.org/D42345 --- sys/compat/linuxkpi/common/include/asm/processor.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 106 +++++++++++++++++++-- 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/processor.h b/sys/compat/linuxkpi/common/include/asm/processor.h index 9e784396c63a..c55238d33505 100644 --- a/sys/compat/linuxkpi/common/include/asm/processor.h +++ b/sys/compat/linuxkpi/common/include/asm/processor.h @@ -41,7 +41,7 @@ struct cpuinfo_x86 { }; extern struct cpuinfo_x86 boot_cpu_data; -extern struct cpuinfo_x86 __cpu_data[]; +extern struct cpuinfo_x86 *__cpu_data; #define cpu_data(cpu) __cpu_data[cpu] #endif diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index a493dc2538ec..36eac309094f 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -131,7 +131,8 @@ static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); cpumask_t cpu_online_mask; -static cpumask_t static_single_cpu_mask[MAXCPU]; +static cpumask_t **static_single_cpu_mask; +static cpumask_t *static_single_cpu_mask_lcs; struct kobject linux_class_root; struct device linux_root_device; struct class linux_class_misc; @@ -2569,17 +2570,19 @@ io_mapping_create_wc(resource_size_t base, unsigned long size) #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; struct cpuinfo_x86 boot_cpu_data; -struct cpuinfo_x86 __cpu_data[MAXCPU]; +struct cpuinfo_x86 *__cpu_data; #endif cpumask_t * lkpi_get_static_single_cpu_mask(int cpuid) { - KASSERT((cpuid >= 0 && cpuid < MAXCPU), ("%s: invalid cpuid %d\n", + KASSERT((cpuid >= 0 && cpuid <= mp_maxid), ("%s: invalid cpuid %d\n", + __func__, cpuid)); + KASSERT(!CPU_ABSENT(cpuid), ("%s: cpu with cpuid %d is absent\n", __func__, cpuid)); - return (&static_single_cpu_mask[cpuid]); + return (static_single_cpu_mask[cpuid]); } static void @@ -2595,7 +2598,9 @@ linux_compat_init(void *arg) boot_cpu_data.x86 = CPUID_TO_FAMILY(cpu_id); boot_cpu_data.x86_model = CPUID_TO_MODEL(cpu_id); - for (i = 0; i < MAXCPU; i++) { + __cpu_data = mallocarray(mp_maxid + 1, + sizeof(*__cpu_data), M_KMALLOC, M_WAITOK | M_ZERO); + CPU_FOREACH(i) { __cpu_data[i].x86_clflush_size = cpu_clflush_line_size; __cpu_data[i].x86_max_cores = mp_ncpus; __cpu_data[i].x86 = CPUID_TO_FAMILY(cpu_id); @@ -2630,13 +2635,92 @@ linux_compat_init(void *arg) CPU_COPY(&all_cpus, &cpu_online_mask); /* * Generate a single-CPU cpumask_t for each CPU (possibly) in the system. - * CPUs are indexed from 0..(MAXCPU-1). The entry for cpuid 0 will only + * CPUs are indexed from 0..(mp_maxid). The entry for cpuid 0 will only * have itself in the cpumask, cupid 1 only itself on entry 1, and so on. * This is used by cpumask_of() (and possibly others in the future) for, * e.g., drivers to pass hints to irq_set_affinity_hint(). */ - for (i = 0; i < MAXCPU; i++) - CPU_SET(i, &static_single_cpu_mask[i]); + static_single_cpu_mask = mallocarray(mp_maxid + 1, + sizeof(static_single_cpu_mask), M_KMALLOC, M_WAITOK | M_ZERO); + + /* + * When the number of CPUs reach a threshold, we start to save memory + * given the sets are static by overlapping those having their single + * bit set at same position in a bitset word. Asymptotically, this + * regular scheme is in O(n²) whereas the overlapping one is in O(n) + * only with n being the maximum number of CPUs, so the gain will become + * huge quite quickly. The threshold for 64-bit architectures is 128 + * CPUs. + */ + if (mp_ncpus < (2 * _BITSET_BITS)) { + cpumask_t *sscm_ptr; + + /* + * This represents 'mp_ncpus * __bitset_words(CPU_SETSIZE) * + * (_BITSET_BITS / 8)' bytes (for comparison with the + * overlapping scheme). + */ + static_single_cpu_mask_lcs = mallocarray(mp_ncpus, + sizeof(*static_single_cpu_mask_lcs), + M_KMALLOC, M_WAITOK | M_ZERO); + + sscm_ptr = static_single_cpu_mask_lcs; + CPU_FOREACH(i) { + static_single_cpu_mask[i] = sscm_ptr++; + CPU_SET(i, static_single_cpu_mask[i]); + } + } else { + /* Pointer to a bitset word. */ + __typeof(((cpuset_t *)NULL)->__bits[0]) *bwp; + + /* + * Allocate memory for (static) spans of 'cpumask_t' ('cpuset_t' + * really) with a single bit set that can be reused for all + * single CPU masks by making them start at different offsets. + * We need '__bitset_words(CPU_SETSIZE) - 1' bitset words before + * the word having its single bit set, and the same amount + * after. + */ + static_single_cpu_mask_lcs = mallocarray(_BITSET_BITS, + (2 * __bitset_words(CPU_SETSIZE) - 1) * (_BITSET_BITS / 8), + M_KMALLOC, M_WAITOK | M_ZERO); + + /* + * We rely below on cpuset_t and the bitset generic + * implementation assigning words in the '__bits' array in the + * same order of bits (i.e., little-endian ordering, not to be + * confused with machine endianness, which concerns bits in + * words and other integers). This is an imperfect test, but it + * will detect a change to big-endian ordering. + */ + _Static_assert( + __bitset_word(_BITSET_BITS + 1, _BITSET_BITS) == 1, + "Assumes a bitset implementation that is little-endian " + "on its words"); + + /* Initialize the single bit of each static span. */ + bwp = (__typeof(bwp))static_single_cpu_mask_lcs + + (__bitset_words(CPU_SETSIZE) - 1); + for (i = 0; i < _BITSET_BITS; i++) { + CPU_SET(i, (cpuset_t *)bwp); + bwp += (2 * __bitset_words(CPU_SETSIZE) - 1); + } + + /* + * Finally set all CPU masks to the proper word in their + * relevant span. + */ + CPU_FOREACH(i) { + bwp = (__typeof(bwp))static_single_cpu_mask_lcs; + /* Find the non-zero word of the relevant span. */ + bwp += (2 * __bitset_words(CPU_SETSIZE) - 1) * + (i % _BITSET_BITS) + + __bitset_words(CPU_SETSIZE) - 1; + /* Shift to find the CPU mask start. */ + bwp -= (i / _BITSET_BITS); + static_single_cpu_mask[i] = (cpuset_t *)bwp; + } + } strlcpy(init_uts_ns.name.release, osrelease, sizeof(init_uts_ns.name.release)); } @@ -2649,6 +2733,12 @@ linux_compat_uninit(void *arg) linux_kobject_kfree_name(&linux_root_device.kobj); linux_kobject_kfree_name(&linux_class_misc.kobj); + free(static_single_cpu_mask_lcs, M_KMALLOC); + free(static_single_cpu_mask, M_KMALLOC); +#if defined(__i386__) || defined(__amd64__) + free(__cpu_data, M_KMALLOC); +#endif + mtx_destroy(&vmmaplock); spin_lock_destroy(&pci_lock); rw_destroy(&linux_vma_lock); From nobody Fri Dec 22 05:21:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxFyh2NTWz54m5J; Fri, 22 Dec 2023 05:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxFyh1qxmz3YL9; Fri, 22 Dec 2023 05:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703222492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+gIYUXtjqCMjfm3rEkUro7jWVoRVcfXeHiRnh+4d08=; b=YuAIh94cDN5+3GsIoL5VHYAFMBe1Y/SKBzou/UZ/eCHuMeDljT/YfuR0PaS9LrJ+EuLvL/ Q7VyM/VkPPHMNJxf+XwXJzdQooIQ7klo2oVykvAnDyHOr6IHytvv5KeU6WaEYuOtz+tLMw 5nNz+OmAHNli59dQj/2sM9pIf8kuxMvK/HFXAaIiJZBeN+AoGemWGF3wCLxC97gGpTydwR 5lN8j8pcysfI7sDStpTDTfTjhn2dYEVm6djBYESGEipzgyiaqEGYGORglBw04uqVykc7hL WcscAefDjPD60C0paAmazO/27xfSd0OCVSt/aDlO0J2D5C8X+E59BYfHu2za9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703222492; a=rsa-sha256; cv=none; b=uEvfvaWNJMfyPX3/zBQg0Xp2Zdg+RqiN9L46I78McQN+PWqWoXw31Gt0U7kgabV8otZ74k fKRKO0SHEd6npLukypReFIylh6uRRfO01Hqia/bNfdBk8ko7hyuoDiWZgy326+48tN+ght MtsIaZ8j5iDg3V3UFFBTJNj1E9zBXM8zCfqgApRqXzJO6W1W4yotyxQIXo7c2mOF0GX+9B oAiL5+zkS0hy/sM8GdAr7befg9ZRUWIHjPtcA35q60/ZbREY5mMiBF5WUEwkARTc1OvWgR EWZCLxKRNgblW7w4h/GngqUZ+dbx5IhY3UubYobTLI4limLyiDYxCBkuV9SN2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703222492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+gIYUXtjqCMjfm3rEkUro7jWVoRVcfXeHiRnh+4d08=; b=wQMe2+mpXDwWjqI5KyXVfG/gQ3UX2tXXqlQ6AZPfpRPjQ3oEQhAH6GHCSeLVoYWHDgUzrN 5A6Uu3VKiU1EEZpLimBQSkLXkS6r5XimyoNc/ZvMXOmRqpxnQN/zcNDZlFQdTM5DfvjDwF C1/0v7LT71U7pNtpNUomnumitv71tGFDak/QE3MuuxHCz4DwnEidt8sS7tgFNfCBdr/VJT M8lw+fCNauUretE8c52Dsw9+gYtRZKOMuFtrThG0WX0mrI6jZRAnps0IaW98H1AnLXZIBp W5hPlxP86y5Za0QyZdsOJNshL3vbNikE1/p0rmIADte8E4T8r9EgqRKD9ShmMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxFyh0tRkz13j1; Fri, 22 Dec 2023 05:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BM5LWT0054582; Fri, 22 Dec 2023 05:21:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BM5LWlF054579; Fri, 22 Dec 2023 05:21:32 GMT (envelope-from git) Date: Fri, 22 Dec 2023 05:21:32 GMT Message-Id: <202312220521.3BM5LWlF054579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: 8f7ed58a1555 - main - regex: mixed sets are misidentified as singletons List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f7ed58a15556bf567ff876e1999e4fe4d684e1d Auto-Submitted: auto-generated The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=8f7ed58a15556bf567ff876e1999e4fe4d684e1d commit 8f7ed58a15556bf567ff876e1999e4fe4d684e1d Author: Bill Sommerfeld AuthorDate: 2023-12-21 03:46:14 +0000 Commit: Yuri Pankov CommitDate: 2023-12-22 05:19:59 +0000 regex: mixed sets are misidentified as singletons Fix "singleton" function used by regcomp() to turn character set matches into exact character matches if a character set has exactly one element. The underlying cset representation is complex; most critically it records"small" characters (codepoint less than either 128 or 256 depending on locale) in a bit vector, and "wide" characters in a secondary array. Unfortunately the "singleton" function uses to identify singleton sets treated a cset as a singleton if either the "small" or the "wide" sets had exactly one element (it would then ignore the other set). The easiest way to demonstrate this bug: $ export LANG=C.UTF-8 $ echo 'a' | grep '[abà]' It should match (and print "a") but instead it doesn't match because the single accented character in the set is misinterpreted as a singleton. Reviewed by: kevans, yuripv Obtained from: illumos Differential Revision: https://reviews.freebsd.org/D43149 --- lib/libc/regex/regcomp.c | 25 ++++++++++++++++++----- lib/libc/tests/regex/multibyte.sh | 43 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index ba803130a050..89b96b00fefb 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1586,17 +1586,32 @@ singleton(cset *cs) { wint_t i, s, n; + /* Exclude the complicated cases we don't want to deal with */ + if (cs->nranges != 0 || cs->ntypes != 0 || cs->icase != 0) + return (OUT); + + if (cs->nwides > 1) + return (OUT); + + /* Count the number of characters present in the bitmap */ for (i = n = 0; i < NC; i++) if (CHIN(cs, i)) { n++; s = i; } - if (n == 1) - return (s); - if (cs->nwides == 1 && cs->nranges == 0 && cs->ntypes == 0 && - cs->icase == 0) + + if (n > 1) + return (OUT); + + if (n == 1) { + if (cs->nwides == 0) + return (s); + else + return (OUT); + } + if (cs->nwides == 1) return (cs->wides[0]); - /* Don't bother handling the other cases. */ + return (OUT); } diff --git a/lib/libc/tests/regex/multibyte.sh b/lib/libc/tests/regex/multibyte.sh index a736352bf0a2..18323f500a2b 100755 --- a/lib/libc/tests/regex/multibyte.sh +++ b/lib/libc/tests/regex/multibyte.sh @@ -1,4 +1,3 @@ - atf_test_case bmpat bmpat_head() { @@ -45,8 +44,50 @@ icase_body() echo $c | atf_check -o "inline:$c\n" sed -ne "/$a/Ip" } +atf_test_case mbset cleanup +mbset_head() +{ + atf_set "descr" "Check multibyte sets matching" +} +mbset_body() +{ + export LC_CTYPE="C.UTF-8" + + # This involved an erroneously implemented optimization which reduces + # single-element sets to an exact match with a single codepoint. + # Match sets record small-codepoint characters in a bitmap and + # large-codepoint characters in an array; the optimization would falsely + # trigger if either the bitmap or the array was a singleton, ignoring + # the members of the other side of the set. + # + # To exercise this, we construct sets which have one member of one side + # and one or more of the other, and verify that all members can be + # found. + printf "a" > mbset; atf_check -o not-empty sed -ne '/[aà]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -ne '/[aà]/p' mbset + printf "a" > mbset; atf_check -o not-empty sed -ne '/[aàá]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -ne '/[aàá]/p' mbset + printf "á" > mbset; atf_check -o not-empty sed -ne '/[aàá]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -ne '/[abà]/p' mbset + printf "a" > mbset; atf_check -o not-empty sed -ne '/[abà]/p' mbset + printf "b" > mbset; atf_check -o not-empty sed -ne '/[abà]/p' mbset + printf "a" > mbset; atf_check -o not-empty sed -Ene '/[aà]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -Ene '/[aà]/p' mbset + printf "a" > mbset; atf_check -o not-empty sed -Ene '/[aàá]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -Ene '/[aàá]/p' mbset + printf "á" > mbset; atf_check -o not-empty sed -Ene '/[aàá]/p' mbset + printf "à" > mbset; atf_check -o not-empty sed -Ene '/[abà]/p' mbset + printf "a" > mbset; atf_check -o not-empty sed -Ene '/[abà]/p' mbset + printf "b" > mbset; atf_check -o not-empty sed -Ene '/[abà]/p' mbset +} +mbset_cleanup() +{ + rm -f mbset +} + atf_init_test_cases() { atf_add_test_case bmpat atf_add_test_case icase + atf_add_test_case mbset } From nobody Fri Dec 22 05:55:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxGkH0z4Nz54nm3; Fri, 22 Dec 2023 05:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxGkH0Ld5z3bLl; Fri, 22 Dec 2023 05:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703224551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqCAQsuMfJOijBH/RZQFaSjPIYGltQ4f/DiZqQXuzv0=; b=CSn+iM4qQks239sgT6T7c0zmGZ9xfndoQLIU/VvYfXOlxTNHo6m/8l+zVEZFX4yJrK/pgi /qYfpVsLbjJwFSsEWh2zik/8mno5ugv0NjlPMHUuj1wsSAvoEkkBEBs4SchS9YTll3kshj 5jxEuzjsHkmre75BGQBZYlx7xTeC0J3oiD4MFWc9YgUVz+u9s5tABRFYtQOheG0naWCERX I2NFOnJ5h4e/ZWMn1XzoX2zf/GJulIEipKOvRyRRZDA5MI/DdeOQcj/omcSj6a3GHB8JGs +9dmL3SeH6MDiYvsBd79JgSwx99w/9eMbHM6Ag+C+GovvIGtDpAjymVSl7MfkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703224551; a=rsa-sha256; cv=none; b=r7R0DgGgEEIf6iF0qmAIUxgqRfA8F1Yl6pq02R0GkcKVVTavlVcijn59mjJ1A2KClTYOQp kUzh+YtmQyd5UgUY6SVJFGRiEFYMWT64AYZYoAHQORv5sptibSoCJA9tM8hyUruVH1HidF MnET3G3R0aL2UNKsOIvl/NteLYHgwmi7XV0NXbtQZimWGsBj6n4o0rAkRJkXrRTTky603/ piL/qP9wS168VxMzHDhqL0P0xGlQhTH6KLO8JcjgwgSCSr0UMzH4fStaolPfxo0DuFm6t6 EVDcAA5HTTFn+R+/CaqUwIdmpk86BtyWcH6nqWmz81+heXmkxsOe4qz5xaUS2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703224551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqCAQsuMfJOijBH/RZQFaSjPIYGltQ4f/DiZqQXuzv0=; b=KzKjgqK45nj9PSqkQkVf2l/vq2iKsTJbvkmJoY0LE0fy1RvsM0IH09QRZippsMFh1YtHyy vfwUG44rSfuKEUA2omZ17VHteRLgbw6n8fNcHk4zjEr5QVERL0QaFmaCLcBTY5yrTqjme6 fdqpo0fGGHR+ER1X/Ia1+IcqyjXLGKVezHDAo94hNsdJJBlzBLQ09df0hruadjlBkxKQmp vX+NsbPqwEwdfsZtxHoqCITARsOXuwQHXNxUD1WA6iisuFhiS6W+DJW7KOInc74lIqyF/S CrVfGd8EuBfDJfbe/RRA7bQhHq/NDT9d8/AwT35zjvhx7aPOy1oZ5V5Jxgf01A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxGkG6Wr9z13Vp; Fri, 22 Dec 2023 05:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BM5toaX007017; Fri, 22 Dec 2023 05:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BM5to39007014; Fri, 22 Dec 2023 05:55:50 GMT (envelope-from git) Date: Fri, 22 Dec 2023 05:55:50 GMT Message-Id: <202312220555.3BM5to39007014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pawel Jakub Dawidek Subject: git: eb4d13126d85 - main - seq(1): Put separator only between the elements. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pjd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb4d13126d85665197ed7efc17c1ab442daa70ea Auto-Submitted: auto-generated The branch main has been updated by pjd: URL: https://cgit.FreeBSD.org/src/commit/?id=eb4d13126d85665197ed7efc17c1ab442daa70ea commit eb4d13126d85665197ed7efc17c1ab442daa70ea Author: Pawel Jakub Dawidek AuthorDate: 2023-12-19 02:39:57 +0000 Commit: Pawel Jakub Dawidek CommitDate: 2023-12-22 05:54:05 +0000 seq(1): Put separator only between the elements. - Using non-default ('\n') separator will produce an output with the separator at the end of the output, eg. % echo "[$(seq -s ' ' 0 2)]" [0 1 2 ] - The output should always be followed by a new line character. Currently: % seq -s ' ' 0 2 0 1 2 % This change makes seq(1) to behave the same way Linux seq(1): % echo "[$(seq -s ' ' 0 2)]" [0 1 2] % seq -s ' ' 0 2 0 1 2 % Approved by: oshogbo Differential Revision: https://reviews.freebsd.org/D43094 --- usr.bin/seq/seq.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index 2a35ef51690f..771346df1176 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -181,8 +181,9 @@ main(int argc, char *argv[]) for (step = 1, cur = first; incr > 0 ? cur <= last : cur >= last; cur = first + incr * step++) { + if (step > 1) + fputs(sep, stdout); printf(fmt, cur); - fputs(sep, stdout); prev = cur; } @@ -202,15 +203,19 @@ main(int argc, char *argv[]) } if (strcmp(cur_print, last_print) == 0 && strcmp(cur_print, prev_print) != 0) { - fputs(last_print, stdout); fputs(sep, stdout); + fputs(last_print, stdout); } free(cur_print); free(last_print); free(prev_print); - if (term != NULL) + if (term != NULL) { + fputs(sep, stdout); fputs(term, stdout); + } + + fputs("\n", stdout); return (0); } From nobody Fri Dec 22 10:22:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxNfC15SGz553s6; Fri, 22 Dec 2023 10:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxNfC0BqKz4Ss1; Fri, 22 Dec 2023 10:22:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703240563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2SP68Av6jTOd3TTViRnJGouvFwcwpui1axthmHd5g0=; b=IKGcrX+rDCERZ3cAFymiwteInrYTzIf6xxhFCsRr9WFoZdLD01qcCm14vkBG+LS2zgrk+A 0N4dgwN86SZcdDdnqLElI65kZGQ22ldWCsEW2gE8p13AUsBBMVMsT217LWr2lQriJm1GFv /jd4tPEFxz1ZRA1qF6Cd1zTKcH6ecqpS7K0DOsDFFPukC2TTydLSauypHB3lqskLpqmrE9 XoiaBG78nm5ZoFBVA0hn9mmVVeP1iYE38WQj9NsuhIYdQY1zhCfEosxEOklUy3W6YrZ7iS 2mQZmH2YfrPkZPLYqftoTII1mWOwHb05Af0f808Gr82VV2GW2mXjH3fHZlj6Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703240563; a=rsa-sha256; cv=none; b=K3H8+/Q5voruvpJqu6l0EH7hV1hZU+HyGDkxB3XrgTrRrcxCQAPNDM5HVggS4EvaYBm4nA BfqZAI3o+CfDFntsj+v/5ED4uWP5n0Ks0Zz040pMBUKqtCGouyWBGL97c/rFg1I4g4tAz1 Wc3aRzGYyYhU4Na295LA+2b3OtYp0V05GT3ml9GVxlxUicKc0O1HCmlI4B66H5slztIad3 fFZOsKu4dMp17+HpV5zg2GgDKLOyQpzGy9oxKI8qFDWftBUSHdQZy7xsxqT2FCPGAUdBzp xFHiyl1OVBqC2erPSVPh3uAQLOgTNDVRC9TJsz9H6B5kDDf/yg4h0YV53z3hIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703240563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2SP68Av6jTOd3TTViRnJGouvFwcwpui1axthmHd5g0=; b=Yiin5n2g00/VF/OK5Ah7HSbgOK3POkg0uHu4iD1Dp0LOOJsAB7XZlajavI69yN+XbK/Fsw n+vxq7zZ6nHeWMwdfGMqWG4pusiDuBuzgSTaKn2y+u4sdOfDn77EHgwMV5AYY4TrIum91F 95oCNYS0VX4SScnEjqHsJQxlPnL2rqbrR4gqFZ4al/Ejqq8HA4ehZE9e1owEdLEm4coIVd PmZXvuu5dhTX5cFZIbWL/CnCJwkwx3BUCX6gFpoK6u/VR3XMYtlQ0zhPYLI1Zqqns5109B xf44f2vqdKpte8tVmu6nzCrA/NTP7SlW7DQNDtrEUN4iN4faMIjFJUyOn+itrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxNfB6N71z1BLc; Fri, 22 Dec 2023 10:22:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMAMge9058170; Fri, 22 Dec 2023 10:22:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMAMg6h058167; Fri, 22 Dec 2023 10:22:42 GMT (envelope-from git) Date: Fri, 22 Dec 2023 10:22:42 GMT Message-Id: <202312221022.3BMAMg6h058167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 8717c306bd59 - main - tcp: allow userspace use of tcp header flags accessor 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8717c306bd5929b9d3cc9535aa1f9830993033de Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=8717c306bd5929b9d3cc9535aa1f9830993033de commit 8717c306bd5929b9d3cc9535aa1f9830993033de Author: Richard Scheffenegger AuthorDate: 2023-12-21 23:47:36 +0000 Commit: Richard Scheffenegger CommitDate: 2023-12-22 01:20:29 +0000 tcp: allow userspace use of tcp header flags accessor functions Provide accessor functions to all 12 possible TCP header flags for userspace too. Reviewed By: zlei MFC after: 2 weeks Sponsored by: Netapp, Inc. Differential Revision: https://reviews.freebsd.org/D43152 --- sys/netinet/tcp_var.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index f8d5654afa24..af441b4fc7d7 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1576,6 +1576,7 @@ tcp_fields_to_net(struct tcphdr *th) th->th_win = htons(th->th_win); th->th_urp = htons(th->th_urp); } +#endif /* _KERNEL */ static inline uint16_t tcp_get_flags(const struct tcphdr *th) @@ -1589,6 +1590,4 @@ tcp_set_flags(struct tcphdr *th, uint16_t flags) th->th_x2 = (flags >> 8) & 0x0f; th->th_flags = flags & 0xff; } -#endif /* _KERNEL */ - #endif /* _NETINET_TCP_VAR_H_ */ From nobody Fri Dec 22 14:28:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxV633t1wz55HPY; Fri, 22 Dec 2023 14:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxV633Jr1z3HqH; Fri, 22 Dec 2023 14:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703255323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g6YzTpk+lFcEikhO/QwCEQZ6naIIqpAToPqHXKAvNCg=; b=eFoDabXCttmufCXJUmKIvayp42cDGSmYKG6dUhnD7xo27zaU9isSo+Qm7/mJVu7fPTbAyB UnPQLVRZS92uFoK0L5tYBNgJGI5xVMHrgKeRh2YVPEs3fofsRB6ySlw1TeobmmrHwUcP3V KUmFQus4TRdfMokOHfFWZKWpB24U1PeBe2dIe1V1LYjg1zAs7DnGFruSROrg1InYQQGYIF 2JyT/LnwlY2bHNc8p//aw5jYiS+jYNNJ6v6p5qSpGY2gn7eM5JJ6HYWjdIgOlWFi1cBP5A pRi9uSxjfTO0UVSn1o6Oa9aDmkjN3MdzwnkZ92Dqi3SASagnQ/D8g54YD8jDiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703255323; a=rsa-sha256; cv=none; b=txN5Pe8n5xhZoJ5K5jIobQ0t6/rWSoWmBg+cW3sl8Xd/BlblImn2AvvdsUkqyptY9R11xB rZQiWWShVr2OYHVc3BpKtCAfp8wDtpM0LVVBwqawxonQ+qr4QRJADcOaH9D6eoKfsrZ+Ip d/iErXOZFXUO8HgX4Pn6vqSVYQDzPJEaICBgPsR2Bgbm8rCZFGXfg3EZ50DePgfpivcqwS XzLUWt3JpS+5j1pkXAFP2tR36Tu9biqRUf99Zj3gA6b54P+iFPS0hKQ19Qk2tRbur7HPGE IwD14KQV3I86bQdAEA+gcUbOTNXT6Flbo3xcmcUH/VECwFGRGM3Chi9+GIDxdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703255323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g6YzTpk+lFcEikhO/QwCEQZ6naIIqpAToPqHXKAvNCg=; b=g7d4tHk2ZCCh5QI4DunRqpyXKV4ujg/DXLIvhm3dZPT5zffS4h/GEcsRlz2iAnu3YKsOXy dKuIjNczhZOYE6e1xejs87cotZfJt8Z3DqXUo/X8f15/2+G4cKuWo+P1GqnZKo9SXZzVpk 38AosI2CHdHq8AvqZ1WC/DB85B3/7P9lwqSfC3qqvOhzgkWSvjxoEqE8PI9HTZIjWDc5Jy BUJboKBh+u2kpYk+ZuOuIOWORKYRR1cufimV1ji8msfbPMI6qevvukqMw/YfJoz6fgg6Je T9VTi7N0jV1YsrbApT9QPCrjPRww7hEbMq6Ja5BPhhkRyZkGQCON2zxSH8PkfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxV632Lnjz4m1; Fri, 22 Dec 2023 14:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMESh28059925; Fri, 22 Dec 2023 14:28:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMEShO7059922; Fri, 22 Dec 2023 14:28:43 GMT (envelope-from git) Date: Fri, 22 Dec 2023 14:28:43 GMT Message-Id: <202312221428.3BMEShO7059922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tijl Coosemans Subject: git: 272b4b764bdf - main - devd: Don't install autofs.conf with WITHOUT_AUTOFS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 272b4b764bdfb563f655da37ef9ec8c01c77f386 Auto-Submitted: auto-generated The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=272b4b764bdfb563f655da37ef9ec8c01c77f386 commit 272b4b764bdfb563f655da37ef9ec8c01c77f386 Author: Tijl Coosemans AuthorDate: 2023-12-22 14:14:55 +0000 Commit: Tijl Coosemans CommitDate: 2023-12-22 14:27:50 +0000 devd: Don't install autofs.conf with WITHOUT_AUTOFS --- sbin/devd/Makefile | 2 ++ tools/build/mk/OptionalObsoleteFiles.inc | 1 + 2 files changed, 3 insertions(+) diff --git a/sbin/devd/Makefile b/sbin/devd/Makefile index 68ff477f09c9..09a8ed5898e1 100644 --- a/sbin/devd/Makefile +++ b/sbin/devd/Makefile @@ -11,10 +11,12 @@ DEVDDIR= /etc/devd DEVD+= asus.conf .endif +.if ${MK_AUTOFS} != "no" CONFGROUPS+= AUTOFS AUTOFSDIR= ${DEVDDIR} AUTOFS+= autofs.conf AUTOFSPACKAGE= autofs +.endif CONFGROUPS+= DHCLIENT DHCLIENTDIR= ${DEVDDIR} diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index bc244d18ab39..f9850b7b2e22 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -127,6 +127,7 @@ OLD_FILES+=etc/autofs/special_media OLD_FILES+=etc/autofs/special_noauto OLD_FILES+=etc/autofs/special_null OLD_FILES+=etc/auto_master +OLD_FILES+=etc/devd/autofs.conf OLD_FILES+=etc/rc.d/automount OLD_FILES+=etc/rc.d/automountd OLD_FILES+=etc/rc.d/autounmountd From nobody Fri Dec 22 15:30:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWSr3GMbz55L90; Fri, 22 Dec 2023 15:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWSr2hwRz3P33; Fri, 22 Dec 2023 15:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703259004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xS/cDUV0AX+XaE6Cik72hMjUoyj1x3s/NPSLJobZjHU=; b=t9ucOQo9SPsqW5WBaWmUl3KvcaYtaFiRY6VdkF/mP4mpT6OZKsWwQmDecX+aSYYs1TZ5uR wufWrunPrK2Srlt4ysMbptnxfltyFZTQu+Xfc5MLGEsKdCRDfKbNCYoDacsMkfdftvUgQj VMkqu5c6zeLdugtZDyKqU9AxLZGuglSFphAO8DHsKvi+NtNFrd0Hl5nQLWcmeKn/Kjxlzq J8OJH+ciq7jqMZPsYkeYavWqhv3Y+a/bzo/MTFtp7HSKYU3RaCNZhYwlPLSf2Hy18X+3av AW7FnBFShc2HQ0iOSTAFEKUwFZ/F5N+k0b5Us4XPM6+FH3DZ3msO58cVRAneRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703259004; a=rsa-sha256; cv=none; b=ix/iCFwcxzBk6dd41afPuYR8F5JcqusuDgnvnMmEEg7HneqqW724qELn7w8sCZzpS3z+7w V9cpjudCrCjd+g718ymgi07Bc33y120EYxKxUBFqt0zxZnpiPoL1N3nsv8TbU61CMWb+eH IFotGylZy3GejrCEq9vyiIQbBvmBEhXUSN9ciUuy4f6CA+oltBG/oslucS0UyD60/9ONqA Cp55FUMpDZN4wqPSrW+Iw37NkZ1zrAhjtBwfxj21kmy40hi7mKRnO3M12IzsDlr4HhOTkJ fZlW/hQg4k3AFe4LvGXO1c42pq5xcDyKCAkXxDBPfby6k3OBkhGvvRUi/z9dgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703259004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xS/cDUV0AX+XaE6Cik72hMjUoyj1x3s/NPSLJobZjHU=; b=GsuRK0M1M7A/tMMVMddC3rho5gb+qw0afXRIj4EFS0zWCpnL4N/BMNVTPpb4Ur2r8A/DS1 tjXuxgk3Ffuen0vIDvnXJTu2qFpwm9fBAOUs1QgGvgfCoZQs6l2sBgCCnA4r4kFhrtISEO UGamAyBhcfrTuXz4WVsl9aTJfbeqALS/RWjsjC0ua+cpTb4BbnO+/IFsNXImhEND5kLH6t TLdPY4yrBGNV1bz+C5XtFjp43dxUd5/Iny+OoNhh+IW+LV2kCx4hWmGwTmow7rJKFQXtSQ A/AFUY0/Uckcm4aNKV58ZH4DoVTXJEz/1jIbAAI0+W+zowzWxk+n4obpJdUEJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWSr1lmGz6j7; Fri, 22 Dec 2023 15:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFU4WA063206; Fri, 22 Dec 2023 15:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFU4bc063201; Fri, 22 Dec 2023 15:30:04 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:30:04 GMT Message-Id: <202312221530.3BMFU4bc063201@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: 59a35b7c6b1a - main - bhyve.8: add missed dot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 59a35b7c6b1a955920eff8dcade2ceec4d5d5fd6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=59a35b7c6b1a955920eff8dcade2ceec4d5d5fd6 commit 59a35b7c6b1a955920eff8dcade2ceec4d5d5fd6 Author: Konstantin Belousov AuthorDate: 2023-12-21 23:54:39 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-22 15:29:25 +0000 bhyve.8: add missed dot Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D43164 --- usr.sbin/bhyve/bhyve.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index 093938277c02..f5610decc6d2 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -245,7 +245,7 @@ flag description. .Sm on .Oc .Xc -Set the guest physical memory size +Set the guest physical memory size. This must be the same size that was given to .Xr bhyveload 8 . .Pp From nobody Fri Dec 22 15:30:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWSs3xGMz55LNF; Fri, 22 Dec 2023 15:30: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWSs3SNPz3P6X; Fri, 22 Dec 2023 15:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703259005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYjEyN6Mk163MqtjYVUmx7WBB9uGHz3t+MpOELevzs8=; b=vO3Moa1G9LC8K9KIx4f1bVfv9ira/2SP0W90jgrY/3L++hc08a3cPTQUYJCA9uczP1co1r vHNSLEmXw2DcQBGN8N8X03bKlHKWejdkcaN22a8tkYD1EIP8YZw9vkJZUT2kMuZlSx8N5k bHIBvNg20Gpjm2pkB7YPJ/adXZKhLyJ63xUm3p9oprQw3Ixiq1DEUdLLeaR15EMwDt+A5Y Y9PsbbiGy+xYE1HYyVIknkeA0NOcRo1LTYYzxgAiu8e/z1CFUjv5emrjyUwLfccHwLPtd8 T5cIO9LNGO1J2pNRkzlIvp5aCfUugiMM807lx1he0xe0IrCpW7F0ZpzUQp0KsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703259005; a=rsa-sha256; cv=none; b=Hq/zOsEafMeyN890OtdnjAjlciVtR73wquD7Bo9xtPUZA+mDZ8ccDPWjDyRELcPW8Kkvev RbVFXN7wrlaeJzHZwChVMPpG5yXrhrXMpx2iRdYcVxDEzgfwH5ILUrA7DTqL7W80bI5TBb DvcUhogciSZzqZtuJNZu/3EfO2UtNyIiP/rbRacXljqu13CHvrBs+xTa3hfoZx+FoTUmls 6o9IskPehxKOcagagQv2KX6xfONIAPZgADgefWObc9uXOR40Qm3mmQvDpq21jE9fNxKyW7 N5VVc1K5xTs6T/zqqL0JpvlRmkmi3kLgYkL2KbiHdqTbV+n5+vxHxpQBWWcUIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703259005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OYjEyN6Mk163MqtjYVUmx7WBB9uGHz3t+MpOELevzs8=; b=ZVhoH2KGDYNvlGb4jrRpbxsaQO6C69eHWlqeDXwz/ixSn4CjGysf6nJjb2ia/mTeg/UnZQ ESgA3RaiLyz4iugmJv2HqImLULtKb7KeZg8Q49qq59+0qcQx+ysRevNzr3GmpFb43RiE9s abUJ3mSDlPx89Ol4NOwIOKuYBvzb7L1gIS19b8wvfFYUvHut0lt5PPUPHvzYwf83gX5fF8 7xAuxmgWFCnohSouFz93qL075c27nci3mtlAv3AEGzQIGtEBHtHcFQXHVtzn9u4AQ4CQAW I6qo/iDIyFHBZbXNCFXXTd2scZxeWbMbU5djDaiRESLcNuLsG+AxXPBsyZCgMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWSs2Y8fz6XH; Fri, 22 Dec 2023 15:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFU5XI063478; Fri, 22 Dec 2023 15:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFU56M063473; Fri, 22 Dec 2023 15:30:05 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:30:05 GMT Message-Id: <202312221530.3BMFU56M063473@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: 72f1e31f5fa1 - main - bhyve.8: fix -k description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 72f1e31f5fa1ea92f2d00de48c5891128a3fd669 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=72f1e31f5fa1ea92f2d00de48c5891128a3fd669 commit 72f1e31f5fa1ea92f2d00de48c5891128a3fd669 Author: Konstantin Belousov AuthorDate: 2023-12-21 23:58:55 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-22 15:29:33 +0000 bhyve.8: fix -k description Apparently 19eaa01beaba6 inserted -K description in the middle of -k. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D43164 --- usr.sbin/bhyve/bhyve.8 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8 index f5610decc6d2..3612251d7f7b 100644 --- a/usr.sbin/bhyve/bhyve.8 +++ b/usr.sbin/bhyve/bhyve.8 @@ -196,16 +196,6 @@ Print help message and exit. Set configuration variables from a simple, key-value config file. Each line of the config file is expected to consist of a config variable name, an equals sign -.It Fl K Ar layout -Specify the keyboard layout. -The value that can be specified sets the file name in -.Ar /usr/share/bhyve/kbdlayout . -This specification only works when loaded with UEFI mode for VNC. -When using a VNC client that supports QEMU Extended Key Event Message (e.g. -TigerVNC), this option isn't needed. -When using a VNC client that doesn't support QEMU Extended Key Event Message -(e.g. tightVNC), the layout defaults to the US keyboard unless specified -otherwise. .Pq Sq = , and a value. No spaces are permitted between the variable name, equals sign, or @@ -216,6 +206,16 @@ are ignored. See .Xr bhyve_config 5 for more details. +.It Fl K Ar layout +Specify the keyboard layout. +The value that can be specified sets the file name in +.Ar /usr/share/bhyve/kbdlayout . +This specification only works when loaded with UEFI mode for VNC. +When using a VNC client that supports QEMU Extended Key Event Message (e.g. +TigerVNC), this option isn't needed. +When using a VNC client that doesn't support QEMU Extended Key Event Message +(e.g. tightVNC), the layout defaults to the US keyboard unless specified +otherwise. .It Fl l Cm help Print a list of supported LPC devices. .It Fl l Ar lpcdev Ns Op Cm \&, Ns Ar conf From nobody Fri Dec 22 15:50:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWw24zYTz547Wj; Fri, 22 Dec 2023 15:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWw24Q78z3RCg; Fri, 22 Dec 2023 15:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7VQqYLYmqz+gEm2/K/Zjgxg51SYBUBSwWo2x+jHYQto=; b=k8hPEXT6+Xo97vqQhBkKJtUy58dPziStIV8UOVbS721vREP8qqNugf6c5ecMo7rIljuvd7 7XgBSy3+MIc1tx1nRLKqDdq1riKHEY7ctmrW5UxAMoP0DhcPNI46UIp7xU/VbTOsH5QxyN zNfFOInajUvuRUB7etaDy8kL2XFg8ulCJvFbzz9qRJjo3m0gGlcO+ejXs7CuIi8IIr/z4v POGTGvedReJ8bG1kQ/Uy+O6DAh2vZrijQfSOqo1dVfUZNRslxLFzdvvsIvLfMtSo1W7OCQ 0tGkKNVsAKOpc6CYVCzYl9gzMQZMLTDLwvkktNAy8pGbXFDd6QKxQEr9UFewog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703260210; a=rsa-sha256; cv=none; b=tBJEw8+a3n2i5wFA7e/4UVllej2Eq3z7qU24OkV6PqFL/9Lv1qPLd5qjW0AYJsLUe3td1o UiOIlNKUzxAq+vlvfdwTu7cced5GPSuwSV5b6QIeeQGqVc2S7srmJJLTQadlFgj1mhWxW4 J7SdivD4S+GPOwPxv4Kld+9eOCQSK44HwxdVLatwLHHxKk/mmNELoSTOSkTJhGRlt6ozP/ tqcxCSYpkQ3szLCvxEylkqPxxxVFtVvaL1fBONDJxTKZwtPdYYCeTEPvydD0XFZnQp0KSw u18LzNonVgGcuuTkj0z5e6CFpgoKYm7QaaJlmAQKuGTzqwKeAGKKM1yc2Z+LrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7VQqYLYmqz+gEm2/K/Zjgxg51SYBUBSwWo2x+jHYQto=; b=mSmpRvEo9e6dW97KEJu6zJKtiME9lsssRte8yCiSb6yudCc9DpODhpU8I7Y9+EGKZLZZly GcdLWGpao4RCUH3jaDDkWbiIAl3cvfF8dLegL/PwJJ8dcpENsPNzOwRkGEGUWmhhmdhGNr n2g5c8UM/NVfImg5/O+DrWg457/TuD/sQuOHvYLpRmudG4yaDoJuoiPRpg+GFAy68W9Rl+ Jt6fZlwhZILF6StgOaQnL52GnOIvL868eJ6I6LxcRO76d/Pgb/MVla5DMPzOfz8Zyu4wVl FahY6A8SIiJfnI9P5pym5KKHwNbOMjUo2ZH6gSolpVEyAKvg/HbEOZmn2KEhAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWw23Tt9z7BM; Fri, 22 Dec 2023 15:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFoAtF098645; Fri, 22 Dec 2023 15:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFoAxj098639; Fri, 22 Dec 2023 15:50:10 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:50:10 GMT Message-Id: <202312221550.3BMFoAxj098639@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: 6d46e2e0a7f3 - main - kldxref: Tidy error handling for invalid 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6d46e2e0a7f345459fb42e666c7cb2e987c70857 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6d46e2e0a7f345459fb42e666c7cb2e987c70857 commit 6d46e2e0a7f345459fb42e666c7cb2e987c70857 Author: John Baldwin AuthorDate: 2023-12-22 15:48:47 +0000 Commit: John Baldwin CommitDate: 2023-12-22 15:48:47 +0000 kldxref: Tidy error handling for invalid addresses - Don't print an offset value that's always zero. - ef_get_offset can't return -1. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43124 --- usr.sbin/kldxref/ef.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index aa9123d7f540..46d3dc1f4578 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -512,8 +512,8 @@ ef_seg_read_rel(elf_file_t ef, GElf_Addr address, size_t len, void *dest) ofs = ef_get_offset(ef, address); if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read_rel(%s): zero offset (%jx:%ju)", - ef->ef_name, (uintmax_t)address, (uintmax_t)ofs); + warnx("ef_seg_read_rel(%s): bad address (%jx)", + ef->ef_name, (uintmax_t)address); return (EFAULT); } error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); @@ -542,7 +542,7 @@ ef_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) int error; ofs = ef_get_offset(ef, address); - if (ofs == 0 || ofs == (GElf_Off)-1) { + if (ofs == 0) { if (ef->ef_verbose) warnx("ef_seg_read_string(%s): bad offset (%jx:%ju)", ef->ef_name, (uintmax_t)address, (uintmax_t)ofs); From nobody Fri Dec 22 15:50:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWw40BF9z547c4; Fri, 22 Dec 2023 15:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWw36WdVz3R3V; Fri, 22 Dec 2023 15:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VtlDcP/MNuWWb0sfDY0zV3vmljpZuk7wWKL3hmIPEiI=; b=WkRRXQ1+m56gJg8smJLk2jTYpaHMULf9Cuz6tJmKhgKqXu/1DBL/rJ+yBnLy7XvaM47gvS dnsLZ6tUyz+YQqsUAlD7cv/Hzqa/4flUImzFz9phSHbT4auNVA7MAj8wGNkXOWoBRlpG4T p54NSZ67b84rMejO+4NJIb5NRdRQox0L+U1CjeVRz5PHQsE0u57Z0tCq2jIDNaHaF4FFYo wxwH7z8oRJrxqAEjeOF61cSTkB3wC4Xge2+G55shDNwODazZBUFd3bCBL7s48f7lZgRm7N pYsTYhKKe1MwzimoP9upKYv3GHeAjlM3hcKv7axtaGHlndND2izoANyY1L9cRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703260211; a=rsa-sha256; cv=none; b=n+JtKXfRJHR23hmfRFE3LvBSn7OERVKINn49vLSSosP5t2XxwMdkK+ActxLZP065wJDzKb IcYWpSBKiAAomkgaxcyLB0k4YWrWng944LZZHDso65ISCZYheLjh75yUqEV3h6gOx8CAgw cgE8mPnnIiBgcOF1wBIEJ6xGcdbnotAgU6Oqnx7oHrk21uRBYvLZ87mgQ5zGJOsRvIVPZz cWAUT0yRJfdxxt1inYarZ2XGdCSpehRn4gtdta1tkTzCqzQEUnAZunRQIzua4opO3MCzdt LA+ykJCsFmxMd+aQHoExFDNS+2qotV+a/tlqh+N+WpsZlwUZgNJwCRKr5+6Fpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VtlDcP/MNuWWb0sfDY0zV3vmljpZuk7wWKL3hmIPEiI=; b=if/83ubH3xVEB8EVsF+48aeNP9VkPrCOPn1VqtmWr4wHY9En2w2rs1hUgW/wTFqwR/kRQJ SiCUcChnxwv0anwh3Qf9HUyGhALRkX1Lt7nHHLn0EFJUJ76bQsFs+9mByYKjQmYg+o0RwD vRxo1DLszO91ixjTUEzOacdmoLD4hAa6D6PORHF2Hqqp9VTky36E5JPRuh8gOnezbbTaxx Aa9YSpEVJEYPltcNxmtVg7CW3OkcQOznb9U++0K9cF4yIuMQ+eMsRyNdfhYNtZeUktgfdg I5jdSBby0mdlTJ9ZM7Gje/4xyJ5So57jpl5+OeVmtIGdUCPpBCzXM/vHUmzzzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWw34C1Bz70L; Fri, 22 Dec 2023 15:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFoBI2099288; Fri, 22 Dec 2023 15:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFoBKu099281; Fri, 22 Dec 2023 15:50:11 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:50:11 GMT Message-Id: <202312221550.3BMFoBKu099281@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: ed96fd7fc652 - main - kldxref: Simplify elf_read_raw_data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: ed96fd7fc652d77ae5e34727e54610e87854defc Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ed96fd7fc652d77ae5e34727e54610e87854defc commit ed96fd7fc652d77ae5e34727e54610e87854defc Author: John Baldwin AuthorDate: 2023-12-22 15:49:03 +0000 Commit: John Baldwin CommitDate: 2023-12-22 15:49:03 +0000 kldxref: Simplify elf_read_raw_data Use pread as a valid offset is always passed now. Originally the DSO code read the .hash section in two separate requests and relied on the implicit offset for the second read, but now the hash table is fetched in a single call. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43125 --- usr.sbin/kldxref/elf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/usr.sbin/kldxref/elf.c b/usr.sbin/kldxref/elf.c index f8a6510ed352..cc9bf9e6cb38 100644 --- a/usr.sbin/kldxref/elf.c +++ b/usr.sbin/kldxref/elf.c @@ -170,11 +170,7 @@ elf_read_raw_data(struct elf_file *efile, off_t offset, void *dst, size_t len) { ssize_t nread; - if (offset != (off_t)-1) { - if (lseek(efile->ef_fd, offset, SEEK_SET) == -1) - return (EIO); - } - nread = read(efile->ef_fd, dst, len); + nread = pread(efile->ef_fd, dst, len, offset); if (nread == -1) return (errno); if (nread != len) From nobody Fri Dec 22 15:50:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWw514vNz547Pm; Fri, 22 Dec 2023 15:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWw45s2Kz3R50; Fri, 22 Dec 2023 15:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mq2tc9To86IgvOsHsGGIX7+oA/ELiVwjx1KKkcVomkE=; b=RaLdAzqYX6te+/t/OnUlg18Cs6CokVeUsEOGXJeTj6Wz06K9MmwZFnr6VBOPeuzkKZLbbt H4D4FH9nPTewsuQHcYJg5aTOE8nhXQSAnGckEGFtCQ+WgH38B89UM8G7nrMlGnnbylnk4U snYBzhTFARCvUZJkrZ5YUOR2IOKFKuxmPgVqfpDOprna24hOCZHrMcKfplsYAxNbcdByTn oJcWUmtnHtExRVSew8d65hpwSLV/vwbqg0Vom8/FR1qstA/tC5GT0/AUJOTsGkCgTO4Q9/ 1PjL9XK4Sg4LSdLsga8fK2ZqB+RX9LL+voioPU78xqXdR05NmIy1rJBT7HA0Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703260212; a=rsa-sha256; cv=none; b=HRq0JJiA9/sRypLgTvrQSy9Tv0k/YymjXwGJqHUGmGF1YoLo3kHoAipeATkXycskA1Yxxk EBnk5ngxczMlan1qgI7fezvvzerR8OUnA1hP4BH4Wzxe0e0FOAb0XjqgoGmhYQ2AYR23Y1 6P6WTzbE99Tc46Cc45tNCPYjkL67NVe4b2paIDqXsk5I7N4l84nPRK7Ry9gSX7JYBXqBm5 fYtTEWnfgQPXhgNsgqeA8QVi6FydGGOz0HamFMK+VifqNpAE0HgBbjFzsIJQ27HeYtE351 7XMmU35EnFBhcSE/2tyz1ix3unJh3VGaWSgEhtKTJHuw/UoCyp41kSI2YQFCUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mq2tc9To86IgvOsHsGGIX7+oA/ELiVwjx1KKkcVomkE=; b=sKACRwjEYOXHMNKbUzz4X1y/aXhY+CM97WAh2/NQwMJqPJDnagdNqIlLF3Am5SXUqtQb0A pK6GNNCDEaAcVs9FOD3oDVyIlHIK21+VdAK4eXMpvuzH9V/osQTgVtAiqWIZQIXLdRcdCl kSSlFhn2OCNY8f8sXiRlIo0zirKxS6/PdE9hw7VZs9xQ84a/IsXfGuzu5zGJeefJTvZ5kH oB5XvTrKrWpxf+oDmedzOiS8NiUY355cuNJa2jsyDrTeh8++AiHWCEzzMKVfdzlRdi1wyG u/h+eHU9iB5Zd7xx9UCq+YzI0A6vXPGpdJ/wQ+Y0wX/LF/vcenAmRmesiSmuBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWw44mMwz75Q; Fri, 22 Dec 2023 15:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFoC14099940; Fri, 22 Dec 2023 15:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFoC2k099935; Fri, 22 Dec 2023 15:50:12 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:50:12 GMT Message-Id: <202312221550.3BMFoC2k099935@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: 0d557cdf6f0e - main - kldxref: Simplify handling of ELF object 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 0d557cdf6f0e94e909acea065f3de2a28437ae74 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0d557cdf6f0e94e909acea065f3de2a28437ae74 commit 0d557cdf6f0e94e909acea065f3de2a28437ae74 Author: John Baldwin AuthorDate: 2023-12-22 15:49:18 +0000 Commit: John Baldwin CommitDate: 2023-12-22 15:49:18 +0000 kldxref: Simplify handling of ELF object files Unlike the backend for ELF DSOs, the object file backend allocated an aligned chunk of memory and read all of the in-memory sections from the file into this memory even though most of the file contents were never used. Instead, just track a set of virtual addresses (based at 0) that each loaded section would be loaded at and only read the necessary bits from the backing file when needed. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D43126 --- usr.sbin/kldxref/ef_obj.c | 146 +++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 81 deletions(-) diff --git a/usr.sbin/kldxref/ef_obj.c b/usr.sbin/kldxref/ef_obj.c index 36c0dce432b6..1274a14c10af 100644 --- a/usr.sbin/kldxref/ef_obj.c +++ b/usr.sbin/kldxref/ef_obj.c @@ -46,7 +46,8 @@ #include "ef.h" typedef struct { - char *addr; + GElf_Addr addr; + GElf_Off offset; GElf_Off size; int flags; int sec; /* Original section */ @@ -69,9 +70,6 @@ struct ef_file { char *ef_name; struct elf_file *ef_efile; - char *address; - GElf_Off size; - Elf_progent *progtab; int nprogtab; @@ -113,6 +111,22 @@ static struct elf_file_ops ef_obj_file_ops = { .lookup_set = ef_obj_lookup_set, }; +static GElf_Off +ef_obj_get_offset(elf_file_t ef, GElf_Addr addr) +{ + Elf_progent *pt; + int i; + + for (i = 0; i < ef->nprogtab; i++) { + pt = &ef->progtab[i]; + if (pt->offset == (GElf_Off)-1) + continue; + if (addr >= pt->addr && addr < pt->addr + pt->size) + return (pt->offset + (addr - pt->addr)); + } + return (0); +} + static int ef_obj_lookup_symbol(elf_file_t ef, const char *name, GElf_Sym **sym) { @@ -139,9 +153,8 @@ ef_obj_lookup_set(elf_file_t ef, const char *name, GElf_Addr *startp, for (i = 0; i < ef->nprogtab; i++) { if ((strncmp(ef->progtab[i].name, "set_", 4) == 0) && strcmp(ef->progtab[i].name + 4, name) == 0) { - *startp = ef->progtab[i].addr - ef->address; - *stopp = ef->progtab[i].addr + ef->progtab[i].size - - ef->address; + *startp = ef->progtab[i].addr; + *stopp = ef->progtab[i].addr + ef->progtab[i].size; *countp = (*stopp - *startp) / elf_pointer_size(ef->ef_efile); return (0); @@ -160,46 +173,50 @@ ef_obj_symaddr(elf_file_t ef, GElf_Size symidx) sym = ef->ddbsymtab + symidx; if (sym->st_shndx != SHN_UNDEF) - return (sym->st_value - (GElf_Addr)ef->address); + return (sym->st_value); return (0); } static int ef_obj_seg_read_rel(elf_file_t ef, GElf_Addr address, size_t len, void *dest) { - char *memaddr; + GElf_Off secofs; GElf_Rel *r; GElf_Rela *a; GElf_Addr secbase, dataoff; int error, i, sec; - if (address + len > ef->size) { - if (ef->ef_verbose) - warnx("ef_obj_seg_read_rel(%s): bad offset/len (%lx:%ld)", - ef->ef_name, (long)address, (long)len); - return (EFAULT); - } - bcopy(ef->address + address, dest, len); - /* Find out which section contains the data. */ - memaddr = ef->address + address; sec = -1; - secbase = dataoff = 0; for (i = 0; i < ef->nprogtab; i++) { - if (ef->progtab[i].addr == NULL) + if (address < ef->progtab[i].addr) continue; - if (memaddr < (char *)ef->progtab[i].addr || memaddr + len > - (char *)ef->progtab[i].addr + ef->progtab[i].size) + + dataoff = address - ef->progtab[i].addr; + if (dataoff + len > ef->progtab[i].size) continue; + sec = ef->progtab[i].sec; - /* We relocate to address 0. */ - secbase = (char *)ef->progtab[i].addr - ef->address; - dataoff = memaddr - ef->address; + secbase = ef->progtab[i].addr; + secofs = ef->progtab[i].offset; break; } - if (sec == -1) + if (sec == -1) { + if (ef->ef_verbose) + warnx("ef_obj_seg_read_rel(%s): bad address (%jx)", + ef->ef_name, (uintmax_t)address); return (EFAULT); + } + + if (secofs == (GElf_Off)-1) { + memset(dest, 0, len); + } else { + error = elf_read_raw_data(ef->ef_efile, secofs + dataoff, dest, + len); + if (error != 0) + return (error); + } /* Now do the relocations. */ for (i = 0; i < ef->nrel; i++) { @@ -208,7 +225,7 @@ ef_obj_seg_read_rel(elf_file_t ef, GElf_Addr address, size_t len, void *dest) for (r = ef->reltab[i].rel; r < &ef->reltab[i].rel[ef->reltab[i].nrel]; r++) { error = elf_reloc(ef->ef_efile, r, ELF_T_REL, secbase, - dataoff, len, dest); + address, len, dest); if (error != 0) return (error); } @@ -219,7 +236,7 @@ ef_obj_seg_read_rel(elf_file_t ef, GElf_Addr address, size_t len, void *dest) for (a = ef->relatab[i].rela; a < &ef->relatab[i].rela[ef->relatab[i].nrela]; a++) { error = elf_reloc(ef->ef_efile, a, ELF_T_RELA, secbase, - dataoff, len, dest); + address, len, dest); if (error != 0) return (error); } @@ -230,21 +247,23 @@ ef_obj_seg_read_rel(elf_file_t ef, GElf_Addr address, size_t len, void *dest) static int ef_obj_seg_read_string(elf_file_t ef, GElf_Addr address, size_t len, char *dest) { + GElf_Off ofs; + int error; - if (address >= ef->size) { + ofs = ef_obj_get_offset(ef, address); + if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_obj_seg_read_string(%s): bad address (%lx)", - ef->ef_name, (long)address); + warnx("ef_obj_seg_read_string(%s): bad address (%jx)", + ef->ef_name, (uintmax_t)address); return (EFAULT); } - if (ef->size - address < len) - len = ef->size - address; - - if (strnlen(ef->address + address, len) == len) + error = elf_read_raw_data(ef->ef_efile, ofs, dest, len); + if (error != 0) + return (error); + if (strnlen(dest, len) == len) return (EFAULT); - memcpy(dest, ef->address + address, len); return (0); } @@ -255,8 +274,8 @@ ef_obj_open(struct elf_file *efile, int verbose) GElf_Ehdr *hdr; GElf_Shdr *shdr; GElf_Sym *es; - char *mapbase; - size_t i, mapsize, alignmask, max_addralign, nshdr; + GElf_Addr mapbase; + size_t i, nshdr; int error, pb, ra, rl; int j, nsym, symstrindex, symtabindex; @@ -359,59 +378,26 @@ ef_obj_open(struct elf_file *efile, int verbose) } } - /* Size up code/data(progbits) and bss(nobits). */ - alignmask = 0; - max_addralign = 0; - mapsize = 0; - for (i = 0; i < nshdr; i++) { - switch (shdr[i].sh_type) { - case SHT_PROGBITS: - case SHT_NOBITS: - alignmask = shdr[i].sh_addralign - 1; - if (shdr[i].sh_addralign > max_addralign) - max_addralign = shdr[i].sh_addralign; - mapsize += alignmask; - mapsize &= ~alignmask; - mapsize += shdr[i].sh_size; - break; - } - } - - /* We know how much space we need for the text/data/bss/etc. */ - ef->size = mapsize; - if (posix_memalign((void **)&ef->address, max_addralign, mapsize)) { - printf("posix_memalign failed\n"); - goto out; - } - mapbase = ef->address; - /* - * Now load code/data(progbits), zero bss(nobits), allocate - * space for and load relocs + * Now allocate address space for code/data(progbits) and + * bss(nobits) and allocate space for and load relocs. */ pb = 0; rl = 0; ra = 0; - alignmask = 0; + mapbase = 0; for (i = 0; i < nshdr; i++) { switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: - alignmask = shdr[i].sh_addralign - 1; - mapbase += alignmask; - mapbase = (char *)((uintptr_t)mapbase & ~alignmask); - ef->progtab[pb].addr = (void *)(uintptr_t)mapbase; + mapbase = roundup2(mapbase, shdr[i].sh_addralign); + ef->progtab[pb].addr = mapbase; if (shdr[i].sh_type == SHT_PROGBITS) { ef->progtab[pb].name = "<>"; - if (elf_read_raw_data(efile, - shdr[i].sh_offset, ef->progtab[pb].addr, - shdr[i].sh_size) != 0) { - printf("failed to read progbits\n"); - goto out; - } + ef->progtab[pb].offset = shdr[i].sh_offset; } else { ef->progtab[pb].name = "<>"; - bzero(ef->progtab[pb].addr, shdr[i].sh_size); + ef->progtab[pb].offset = (GElf_Off)-1; } ef->progtab[pb].size = shdr[i].sh_size; ef->progtab[pb].sec = i; @@ -424,7 +410,7 @@ ef_obj_open(struct elf_file *efile, int verbose) es = &ef->ddbsymtab[j]; if (es->st_shndx != i) continue; - es->st_value += (GElf_Addr)ef->progtab[pb].addr; + es->st_value += ef->progtab[pb].addr; } mapbase += shdr[i].sh_size; pb++; @@ -464,8 +450,6 @@ ef_obj_close(elf_file_t ef) if (ef->ef_name) free(ef->ef_name); - if (ef->size != 0) - free(ef->address); if (ef->nprogtab != 0) free(ef->progtab); if (ef->nrel != 0) { From nobody Fri Dec 22 15:50:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxWw60VJSz547Lw; Fri, 22 Dec 2023 15:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxWw569x0z3R5H; Fri, 22 Dec 2023 15:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kmu8rcNngpE6TWlA4NDZbkJH8wDjF/sR7WjjEkuX4Qk=; b=j1m1dsjVMypFb5ShlgYkZ9VEcXcwoVKO9RQbekj7odb9Jai6vSltWcaa4M20mXeMAXpl+J rsfi1Y7OQvGAqH1mV1OUZlS2SQ37KSM4QSJy/xoA/re66dFmnrE/m39cEwyQfwFYkIOai4 yP4r3uWfBbE77UrUb8hM9VEIALhokCz1MkscZfcs9c/SWWDN8lpUv4g/+XCG6a9ArcaBtD kSV+a5Pw8TUfwhf7Sc5FEtzof4t2xZnoNA4QF+BOZ9HHchgdMhrYVKeJeQuKlMMukbUv69 jkfdnrRgwrsAEL1xinlhuBfdb0sjhyilFQ7LSoOxdQn1qrAHoVSx+E70WW7dCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703260213; a=rsa-sha256; cv=none; b=cso79Wxx0maENs5XQdgI0cP4keXZ4fe+gjH8ayLDv39djJ3RT0ojnoyB/fNhEWR67Egvww 3eEXGFSJd1M/uXvQ8e4VIy/fdglUQqlJCerlMm8g3rqmPKx0V+BqbIPlMRYfQ0J2aYRDSb O3P8R/jBky2JZ0GZIj4vPRcykvI/kes5ImpvEXA+w5k0Q01p65JOm+f9Lai/F4DA7nvyr+ NnFwoiIFVD2ZtN+zK7ypVLB+9KXRvpaGXn+cZcSCNcdtiPHnnX2Ga8TswSCn4Ou25mIvZe IYH7kmV+1iiIVYpAXg2mgnhZ9L4yEkCuBxHpw8lZfy2KssJ7VoAZa+EtXUPccw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kmu8rcNngpE6TWlA4NDZbkJH8wDjF/sR7WjjEkuX4Qk=; b=daL3lnIZBWxNho9uDfSVCeeKnNnMfKSt9mQzbOuW3ttm610DWtMdXZAmIW6q4eS8LXV9EV 7Ebx9QUQkO1BKMI0+pGvnEC7wjU7dRuCr77yw81vpM8ulRtzDZQpnffyB/OBAtNp0ol4Vs HFZIL2mrqMEfmZpPJhwdeNKibaTr47FBPXmfaKKqClO3fRIn6e0xgFbJTegDhYEyZrCIch lmc8OIKXMnRy98I3ziPYGBl/QJbLmBIIkhU6mpoB+2V8Y5x5I9/fdJ68CWl3f4u+YIwJAl B0GD7Zg0minl02VEzhhgC1aqPOjWUv63snw1OzESKt3zl7TZugSS9Vt1bTobDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxWw55J4xz7LD; Fri, 22 Dec 2023 15:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFoD6m000625; Fri, 22 Dec 2023 15:50:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFoDTe000614; Fri, 22 Dec 2023 15:50:13 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:50:13 GMT Message-Id: <202312221550.3BMFoDTe000614@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: d281fece432f - main - kldxref: Appease a Coverity 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d281fece432f97b4424b852f23dfe1f974b9e30d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d281fece432f97b4424b852f23dfe1f974b9e30d commit d281fece432f97b4424b852f23dfe1f974b9e30d Author: John Baldwin AuthorDate: 2023-12-22 15:49:40 +0000 Commit: John Baldwin CommitDate: 2023-12-22 15:49:40 +0000 kldxref: Appease a Coverity warning While parsing .dynamic, nsym is set when parsing the symbol table from .dynsym. That parsing also sets ef->ef_symtab to a non-NULL value. The value of nsym isn't validated until after a check for ef->ef_symtab being NULL, so nsym always has a valid value when it is read. However, that chain of events is a bit much for static analysis to follow, so initialize nsym to 0 before parsing sections to quiet the warning. Reported by: Coverity Scan CID: 1532339 Sponsored by: DARPA --- usr.sbin/kldxref/ef.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 46d3dc1f4578..fd0782ff1dd0 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -361,6 +361,7 @@ ef_parse_dynamic(elf_file_t ef, const GElf_Phdr *phdyn) goto out; } + nsym = 0; for (i = 0; i < nshdr; i++) { switch (shdr[i].sh_type) { case SHT_HASH: From nobody Fri Dec 22 17:06:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxYbs73Pcz54CsL; Fri, 22 Dec 2023 17: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxYbs6QTyz3XxT; Fri, 22 Dec 2023 17:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703264777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ba4M1R8aYZtGCOcjQ9kDsODKYx3+bElsDkgiAu8mcEs=; b=gJOzjspD+aqwa386MUBV8MpwKKN7IyAwGpVS8jnFKQSN7JP0VPzWopwL+0xRFQLiSGledF cE7vvKS0m1Y4/12kuy4EGrhhkwF5fJokxasD9gSboyogWe2948mN9i5RzYOPX/p5nj131h 4e0+MrIW6eCI4Jyy+PUyppRWECX+H438r1Tzf6C/eqPQuLMIR8wpBl02Y/N2+W2aKQGQNw GWLYsTQMiewAwLqsMnec7denAGyGtE55NDJ+uK0HcN0KegVZbEUeRktX5RdZFRKX/998eU dlxfIQyeT9RVpjx/n7HsZY9kqGcKWLQOluyjSHxCMtjzW9seAIj8ZxLyWwYB+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703264777; a=rsa-sha256; cv=none; b=hm9Jf6Gh2lABIDZifQwaf5UV+T4eKkTqAO8WfLSL3NaUVCI4ipZXDc+IAmuZfrcsEw3kHw lQHGFIzc3lf+gNSY6fDaMn7/oQAdIV7s42qx3SkrYHuse0yA80+QlqJH/c+pCGs4bictoF Uubt5INpQGb0iGVQPuDDvFFZrOXLHdn5SqNk0IWnvbtcWgJMEemjCuIB8YrQSR63iPosre UoMoY4WdrY302UkwZVD1dC4uIThtvTAaQNnv8nyKf0SVvdfAoX4aZW5b5mRT0IpkQolJfV df5cEpWvHKoPkQYq8dcxq/XKALnI9nZP/XdwiywioRkbl2ZgmxLOC+ww2RG53Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703264777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ba4M1R8aYZtGCOcjQ9kDsODKYx3+bElsDkgiAu8mcEs=; b=xPNA2HCe8penJiKmApq6aImBvnGWzm5FOjYxMDcnVlGxQlWxqbN/yH4FKw0oWRHqsdpkIL Q24zaRUYmMuh54ZuQVcxnI4IJPJeBauZixtNZFT2+1WC34lZ7G/ntJSrTnFq6/P56JSseR UYwxvm+XICFZk2143nWt5xBrRtSyMNWiheQ+AKwKrq9gbr9NLZIwxDXZBUyyNhLSqCq2u/ /gs7od6pyDbCqIziu+tYnSzKLAf6BxcDzon5gmPE4eGjRSvLEjwiryLVFlGFcowKdRUvLY z4vhxs/BIRj3NEPiWlEpcBuYlRIVjojxFvHDk6XvlZn1U4ap5WiSeA9HFODvVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxYbs5NXHz9R7; Fri, 22 Dec 2023 17:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMH6Hmm028962; Fri, 22 Dec 2023 17:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMH6HUU028959; Fri, 22 Dec 2023 17:06:17 GMT (envelope-from git) Date: Fri, 22 Dec 2023 17:06:17 GMT Message-Id: <202312221706.3BMH6HUU028959@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: e774c1ef27bc - main - pf: mark netlink commands as requiring NETINET_PF privileges List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e774c1ef27bc2883e05fcd26b5bbf775fdfe3e10 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e774c1ef27bc2883e05fcd26b5bbf775fdfe3e10 commit e774c1ef27bc2883e05fcd26b5bbf775fdfe3e10 Author: Kristof Provost AuthorDate: 2023-12-22 16:40:52 +0000 Commit: Kristof Provost CommitDate: 2023-12-22 16:43:30 +0000 pf: mark netlink commands as requiring NETINET_PF privileges Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_nl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 8fe12f3762b9..4cda42404400 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -712,36 +713,42 @@ static const struct genl_cmd pf_cmds[] = { .cmd_name = "GETSTATES", .cmd_cb = pf_handle_getstates, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, { .cmd_num = PFNL_CMD_GETCREATORS, .cmd_name = "GETCREATORS", .cmd_cb = pf_handle_getcreators, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, { .cmd_num = PFNL_CMD_START, .cmd_name = "START", .cmd_cb = pf_handle_start, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, { .cmd_num = PFNL_CMD_STOP, .cmd_name = "STOP", .cmd_cb = pf_handle_stop, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, { .cmd_num = PFNL_CMD_ADDRULE, .cmd_name = "ADDRULE", .cmd_cb = pf_handle_addrule, .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, { .cmd_num = PFNL_CMD_GETRULES, .cmd_name = "GETRULES", .cmd_cb = pf_handle_getrules, .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, }, }; From nobody Fri Dec 22 17:34:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxZDS5Pq6z54FHp; Fri, 22 Dec 2023 17:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxZDS4dg2z3ZyW; Fri, 22 Dec 2023 17:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703266472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vjQs3tJC8CpYytbiLD/HNZoSKpZEEmcTzQiyJvHvDUY=; b=gXQc/54BgfYB7mr9Ci4tOlgy29C7/50C3iIl6MnJTCyccjCmc5CUeQ4UNnncQ+6wXmxIBu v2DyodPhyCcainj72tXcp87mNO1jK8XWU8u2LucQWdVLV5GCxzZPtSwct7idgr+y88Iaag vkGjBfZ0lTPz6SXvpqifMRzZaFnqZbb+96YV8pC+g2rsbMc3LBXf8nvnVvdQjv8+Vw+RMB Tz6Bt1gGqMFChweoBZD/z+IVbX8NaXeQd9kCDtRfPOLyiZ/R/j1lVkyk4UeTdaPTjHZ/LH tPOPYoDqObXTQ+UxBd3qt0vpFcZ7bqV/qokIaKoSKoP//xjwlg/B6JGdDFipxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703266472; a=rsa-sha256; cv=none; b=E3WrLS0U+F+lExyJdMEq0f7U7qcJXaR44fj7PQlQVJgZiZJyHR0pk9C/YWqIYH0nFe6JdC FOAS0RRhxT9ie4vtinZbEdAJ2bB0vaMaM/hsdJ46S/w8QI7DQaJGljiS0l+PImKz4IqhnK 0HcY6AaP4silxRU+Qf+O9OiZA8GSNTUQY2VZNZrzSu5XfaaZwT+4UGbA+nk+CjZQ9zBsJI y2EbQlFae1vEoJ+zUb3MqMx8s8cWCQc4rTPENaJy14vQKRp1v4x94Os17wcYbaWxV47ji4 YmsbwAAla3Ce+BpG9yPxwwF/K0C9bEjWzVjcj4L3bP+6rjNc/fHz0Gz5atNEyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703266472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vjQs3tJC8CpYytbiLD/HNZoSKpZEEmcTzQiyJvHvDUY=; b=t762PcwsZ9IiVRO+X0oYOCQXRgBpMqin1EhtjwQbJhO3/CV+ywiqweawZ4wSOISO5RGzD9 Zc/5yZ/yrJqlhzYqu4V56fjp3zc1wIulVdq7DYcNSrCE5RitOODSBqwpI5xEJGP7R6ugQu isZu+oiW40eZYW9s0rrpbwBjCAGKTGihEEoQFB8xDBlB88x9bmApzizWzVS/957sbyzR1Z fvMSo2unOIp1Y/aVvjC1Y/saqmPjNqo5dWti1bNejmbjoVmW2ZS3azNCx/FxE3huAq6k3P LJFCS2C7yyAXywaByf7ARkZTwY6u9UDo0tdmQiYUXylwuAAHjNgBFkUzBmtKjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxZDS3Qngz9wl; Fri, 22 Dec 2023 17:34:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMHYWYI078721; Fri, 22 Dec 2023 17:34:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMHYWDS078718; Fri, 22 Dec 2023 17:34:32 GMT (envelope-from git) Date: Fri, 22 Dec 2023 17:34:32 GMT Message-Id: <202312221734.3BMHYWDS078718@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: 3abc72f8716b - main - vmm_iommu_modify(): split vm_iommu_map()/unmap() into separate 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 3abc72f8716b55fc71e9463388f5a74fb6abf5ce Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3abc72f8716b55fc71e9463388f5a74fb6abf5ce commit 3abc72f8716b55fc71e9463388f5a74fb6abf5ce Author: Konstantin Belousov AuthorDate: 2023-12-21 00:00:33 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-22 17:34:27 +0000 vmm_iommu_modify(): split vm_iommu_map()/unmap() into separate functions Reviewed by: alc, jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43140 --- sys/amd64/vmm/vmm.c | 82 +++++++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index ae2ed8e6ea0f..32ae9f9050a7 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1037,54 +1037,68 @@ vmm_sysmem_maxaddr(struct vm *vm) } static void -vm_iommu_modify(struct vm *vm, bool map) +vm_iommu_map(struct vm *vm) { - int i, sz; vm_paddr_t gpa, hpa; struct mem_map *mm; - void *vp, *cookie, *host_domain; - - sz = PAGE_SIZE; - host_domain = iommu_host_domain(); + void *vp, *cookie; + int i; for (i = 0; i < VM_MAX_MEMMAPS; i++) { mm = &vm->mem_maps[i]; if (!sysmem_mapping(vm, mm)) continue; - if (map) { - KASSERT((mm->flags & VM_MEMMAP_F_IOMMU) == 0, - ("iommu map found invalid memmap %#lx/%#lx/%#x", - mm->gpa, mm->len, mm->flags)); - if ((mm->flags & VM_MEMMAP_F_WIRED) == 0) - continue; - mm->flags |= VM_MEMMAP_F_IOMMU; - } else { - if ((mm->flags & VM_MEMMAP_F_IOMMU) == 0) - continue; - mm->flags &= ~VM_MEMMAP_F_IOMMU; - KASSERT((mm->flags & VM_MEMMAP_F_WIRED) != 0, - ("iommu unmap found invalid memmap %#lx/%#lx/%#x", - mm->gpa, mm->len, mm->flags)); - } + KASSERT((mm->flags & VM_MEMMAP_F_IOMMU) == 0, + ("iommu map found invalid memmap %#lx/%#lx/%#x", + mm->gpa, mm->len, mm->flags)); + if ((mm->flags & VM_MEMMAP_F_WIRED) == 0) + continue; + mm->flags |= VM_MEMMAP_F_IOMMU; - gpa = mm->gpa; - while (gpa < mm->gpa + mm->len) { + for (gpa = mm->gpa; gpa < mm->gpa + mm->len; gpa += PAGE_SIZE) { vp = vm_gpa_hold_global(vm, gpa, PAGE_SIZE, VM_PROT_WRITE, &cookie); KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", vm_name(vm), gpa)); - vm_gpa_release(cookie); hpa = DMAP_TO_PHYS((uintptr_t)vp); - if (map) { - iommu_create_mapping(vm->iommu, gpa, hpa, sz); - } else { - iommu_remove_mapping(vm->iommu, gpa, sz); - } + iommu_create_mapping(vm->iommu, gpa, hpa, PAGE_SIZE); + } + } + + iommu_invalidate_tlb(iommu_host_domain()); +} + +static void +vm_iommu_unmap(struct vm *vm) +{ + vm_paddr_t gpa; + struct mem_map *mm; + void *vp, *cookie; + int i; + + for (i = 0; i < VM_MAX_MEMMAPS; i++) { + mm = &vm->mem_maps[i]; + if (!sysmem_mapping(vm, mm)) + continue; + + if ((mm->flags & VM_MEMMAP_F_IOMMU) == 0) + continue; + mm->flags &= ~VM_MEMMAP_F_IOMMU; + KASSERT((mm->flags & VM_MEMMAP_F_WIRED) != 0, + ("iommu unmap found invalid memmap %#lx/%#lx/%#x", + mm->gpa, mm->len, mm->flags)); - gpa += PAGE_SIZE; + for (gpa = mm->gpa; gpa < mm->gpa + mm->len; gpa += PAGE_SIZE) { + vp = vm_gpa_hold_global(vm, gpa, PAGE_SIZE, + VM_PROT_WRITE, &cookie); + KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", + vm_name(vm), gpa)); + vm_gpa_release(cookie); + + iommu_remove_mapping(vm->iommu, gpa, PAGE_SIZE); } } @@ -1092,15 +1106,9 @@ vm_iommu_modify(struct vm *vm, bool map) * Invalidate the cached translations associated with the domain * from which pages were removed. */ - if (map) - iommu_invalidate_tlb(host_domain); - else - iommu_invalidate_tlb(vm->iommu); + iommu_invalidate_tlb(vm->iommu); } -#define vm_iommu_unmap(vm) vm_iommu_modify((vm), false) -#define vm_iommu_map(vm) vm_iommu_modify((vm), true) - int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func) { From nobody Fri Dec 22 17:34:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxZDT60L1z54F9D; Fri, 22 Dec 2023 17:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxZDT5LGyz3Zyn; Fri, 22 Dec 2023 17:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703266473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DjDSGgIzhZgSp3LTrWb4mw6iw/w4hH0rP6tN+Gwziqk=; b=LYwbm2qpdbZQRn5dzMieutkJci4BJRBxcivLbSUORC1/53Er9LsHxp/Nc11yojQcl9hwZk H1l4hITfZW9P0snnrk7OqF+MhTMy6Uy2xiGHzYjGfVlVtWoSMBYyQ9p9erG+N9W1PspJ63 x9Me6S6Mg9Kef1y1EG/4vMwCMBjk+bkLrM/hzwNP4LU+hx2jM17YegBg3xDk1XJYTBFz18 0/Xr7dkEkvcf75Ks8zyWiIrMlvvoALw6TGeou1HycOw0wKM6Mt1MYlTxu/02oIEFxTO/XC 0DErOnvYlL4JkWy1U2YcOZdxpbXFYYe8R/vCV4mSwIOjpO/1LMmEKGClCZ6GCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703266473; a=rsa-sha256; cv=none; b=WSXtb2MnAdQjHh4sVJXUu9p8L7Zb6J9/EU5imT+UNmsDwB+u8KC1FQOG5Vix0tyIIIyxPQ QAXY2a59dMVDM7b/DffmIZvY6Y0ocz6mBQekrS9nvwJw75iseFakzR3bWb+hMUvm8WXV8L MZxX6lK5yzP7FdQv/5sa6DcMmIdqzdL5t7tMRZZn2guJEt372CU7G/sy/I5HmqQUjEGdcY mN1knzIXA2Vfg5uGi/Oqzi8F1fZ6KkNs3RxsJE+pPX8EWMPCY/KGamG1JTABO+B5RPZi2u bDCiu54VZBIqXzDfG9jngrwHHoudVZH/xCxujU+J7nFmZ/sfqBgjbQewIlRckg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703266473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DjDSGgIzhZgSp3LTrWb4mw6iw/w4hH0rP6tN+Gwziqk=; b=qaZ0qQ5CaI/Mcp1VcInhwdZ2i8y+mIb4V20emyo1KLBldxN8WefJ27LEaM3Y6fT1Ejuid6 awzTndNUc4zXLsToa9siPFWxRlPPlEOPGXZHiY5fNz8X9nUlbzQSZ1XGElyac6m0oMBV22 dxPL3PgTakZX4mKnT4FeASPEXonK0RUmnOL+a/kFKCosuowdScCnc1j+9+MlUkaJppfIxL shdKH4jOssPOnG8MxxM4aXu9PHiw98pQhBfqBzbmZBcB3xD0EUbF15OThwH+hbvVsSJ1O9 pguZ3hMeJWa+5mQpOZqiwunQXctzXJTlrvdR++0TSfFjtKGkeqvEFMqZ2QAO/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxZDT3xKkz9tm; Fri, 22 Dec 2023 17:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMHYXN2078769; Fri, 22 Dec 2023 17:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMHYXRA078766; Fri, 22 Dec 2023 17:34:33 GMT (envelope-from git) Date: Fri, 22 Dec 2023 17:34:33 GMT Message-Id: <202312221734.3BMHYXRA078766@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: 671a00491d7a - main - vm_iommu_map()/unmap(): stop transiently wiring already wired pages List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 671a00491d7ac9d6663cdc597ff8c13024eda00d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=671a00491d7ac9d6663cdc597ff8c13024eda00d commit 671a00491d7ac9d6663cdc597ff8c13024eda00d Author: Konstantin Belousov AuthorDate: 2023-12-21 00:12:37 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-22 17:34:27 +0000 vm_iommu_map()/unmap(): stop transiently wiring already wired pages Namely, switch from vm_fault_quick_hold() to pmap_extract() KPI to translate gpa to hpa. Assert that the looked up hpa belongs to the wired page, as it should be for the VM which is configured for pass-throu (this is theoretically a restriction that could be removed on newer DMARs). Noted by: alc Reviewed by: alc, jhb, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43140 --- sys/amd64/vmm/vmm.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 32ae9f9050a7..f399f876717d 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -1041,9 +1041,10 @@ vm_iommu_map(struct vm *vm) { vm_paddr_t gpa, hpa; struct mem_map *mm; - void *vp, *cookie; int i; + sx_assert(&vm->mem_segs_lock, SX_LOCKED); + for (i = 0; i < VM_MAX_MEMMAPS; i++) { mm = &vm->mem_maps[i]; if (!sysmem_mapping(vm, mm)) @@ -1057,13 +1058,24 @@ vm_iommu_map(struct vm *vm) mm->flags |= VM_MEMMAP_F_IOMMU; for (gpa = mm->gpa; gpa < mm->gpa + mm->len; gpa += PAGE_SIZE) { - vp = vm_gpa_hold_global(vm, gpa, PAGE_SIZE, - VM_PROT_WRITE, &cookie); - KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", - vm_name(vm), gpa)); - vm_gpa_release(cookie); + hpa = pmap_extract(vmspace_pmap(vm->vmspace), gpa); + + /* + * All mappings in the vmm vmspace must be + * present since they are managed by vmm in this way. + * Because we are in pass-through mode, the + * mappings must also be wired. This implies + * that all pages must be mapped and wired, + * allowing to use pmap_extract() and avoiding the + * need to use vm_gpa_hold_global(). + * + * This could change if/when we start + * supporting page faults on IOMMU maps. + */ + KASSERT(vm_page_wired(PHYS_TO_VM_PAGE(hpa)), + ("vm_iommu_map: vm %p gpa %jx hpa %jx not wired", + vm, (uintmax_t)gpa, (uintmax_t)hpa)); - hpa = DMAP_TO_PHYS((uintptr_t)vp); iommu_create_mapping(vm->iommu, gpa, hpa, PAGE_SIZE); } } @@ -1076,9 +1088,10 @@ vm_iommu_unmap(struct vm *vm) { vm_paddr_t gpa; struct mem_map *mm; - void *vp, *cookie; int i; + sx_assert(&vm->mem_segs_lock, SX_LOCKED); + for (i = 0; i < VM_MAX_MEMMAPS; i++) { mm = &vm->mem_maps[i]; if (!sysmem_mapping(vm, mm)) @@ -1092,12 +1105,10 @@ vm_iommu_unmap(struct vm *vm) mm->gpa, mm->len, mm->flags)); for (gpa = mm->gpa; gpa < mm->gpa + mm->len; gpa += PAGE_SIZE) { - vp = vm_gpa_hold_global(vm, gpa, PAGE_SIZE, - VM_PROT_WRITE, &cookie); - KASSERT(vp != NULL, ("vm(%s) could not map gpa %#lx", - vm_name(vm), gpa)); - vm_gpa_release(cookie); - + KASSERT(vm_page_wired(PHYS_TO_VM_PAGE(pmap_extract( + vmspace_pmap(vm->vmspace), gpa))), + ("vm_iommu_unmap: vm %p gpa %jx not wired", + vm, (uintmax_t)gpa)); iommu_remove_mapping(vm->iommu, gpa, PAGE_SIZE); } } From nobody Fri Dec 22 20:12:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxdky2z41z54PlG; Fri, 22 Dec 2023 20:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxdky0h6Yz4LpG; Fri, 22 Dec 2023 20:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703275962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aXCkrP9IaSWCFfqZuoAQ/ll8ASplm/F9PEWDusrzvs=; b=W0L9JoXOElZrhxxrltD1UDVd3TxroKSxtHWp8yVQfj2xcJBu23tnI2B0bdvO27pHRs+k5Q lETjJ7RcU0VZTWCWre/47KiyGjSC2Fw11W/GSHX7hGnl3dHaqeWGb7Hu+0fo9kQRe/l4pP BgXmLidnlFl9oYamwAk3RmvYjD6KZSK+INqkdAZHuPUKw7FjMVrJCKJhtoL3tlsVEo6FNw Hkb7hdcnnQgXC2CItQk3nrEjVMazqDskhPHNjmJsmSR/BbTq2VUsJ07gZGGOOFLZ03taY7 4ve1/VxCgJfp6KaCFQbRuz/FowljB9t6UAHS5oea4Gv5WmlwYgZtXvQYhiOBZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703275962; a=rsa-sha256; cv=none; b=spdCOTuPsp3vzUfkr+J2jmef02I6NBE/tsljkpPDWlCtMpxVDO4r8CsfBh2FMmt7PGaqhD HdtlD60+NC9d4YRSNbEuErTH7UX8Z0jzwOZH6ZTvVykPzRarOItEVsEfi0N1KRUfJORM5P EZsPLf/2SQkUm6TsHU722/hfEK2zPfrL5tsVtIKmz5qsCnosyp4jy2ywiYNZkUZHXj7qtY sd5xlRqJoduONxEiHIbjBu1e0ekEbbyk8AHIDMLQ4Za1v6EurI90w4P+BE5QL3TK+PSDb5 gFbx9sj2w/kIkMCCIePKaoGoTRSjFIPUKhr8EUb+My6+cG6jAkGsBinQ3WHX9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703275962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7aXCkrP9IaSWCFfqZuoAQ/ll8ASplm/F9PEWDusrzvs=; b=kaD8H9+52mI1dmGnR2ERSRSY52qvYk3Ylj7dn6rgRX4NrH18AFofFl8+iCcBEHHxcgQ4Q+ TRJdkCFED5Tvs0iuh6ep61uOcDI1TEVPsaPVMlb1tIpmUKTv48vNc0oeqcejBW1nk9oiIU zR//5KMd3SLrxaFm4XQx/TqQ8EEMIbIVyVHyyu0X+gJwqcVcL2I6PAARER6+MPjSyGA4vs 6+E+z6qFtgJLM55fbcrewjo8hFDQqgvSlet1gMMq+2Axgyzy6LgVTUJVx9WoYRUcivZr44 Lu8Q9QYOlTCRWRxKtvn1oxgZ2axBmJZKWS/ZBty6EsxZ7uYOdHSmh3x+FCPRLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxdkx6tHnzWGD; Fri, 22 Dec 2023 20:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMKCfmX047361; Fri, 22 Dec 2023 20:12:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMKCfT2047358; Fri, 22 Dec 2023 20:12:41 GMT (envelope-from git) Date: Fri, 22 Dec 2023 20:12:41 GMT Message-Id: <202312222012.3BMKCfT2047358@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: b484bcd504a2 - main - nfscl: Fix handling of a copyout() error reply List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b484bcd504a29037752d5214a418412724761d88 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b484bcd504a29037752d5214a418412724761d88 commit b484bcd504a29037752d5214a418412724761d88 Author: Rick Macklem AuthorDate: 2023-12-22 20:11:22 +0000 Commit: Rick Macklem CommitDate: 2023-12-22 20:11:22 +0000 nfscl: Fix handling of a copyout() error reply If vfs.nfs.nfs_directio_enable is set non-zero (the default is zero) and a file on an NFS mount is read after being opened with O_DIRECT | O_ RDONLY, a call to nfsm_mbufuio() calls copyout() without checking for an error return. If copyout() returns EFAULT, this would not work correctly. Only the call path VOP_READ()->ncl_readrpc()->nfsrpc_read()->nfsrpc_readrpc() will do this and the error return for EFAULT will be returned back to VOP_READ(). This patch adds the error check to nfsm_mbufuio(). Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43160 --- sys/fs/nfs/nfs_commonsubs.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 832713e6c1de..e79f73739487 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -679,17 +679,13 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz) ("len %d, corrupted mbuf?", len)); } xfer = (left > len) ? len : left; -#ifdef notdef - /* Not Yet.. */ - if (uiop->uio_iov->iov_op != NULL) - (*(uiop->uio_iov->iov_op)) - (mbufcp, uiocp, xfer); - else -#endif if (uiop->uio_segflg == UIO_SYSSPACE) NFSBCOPY(mbufcp, uiocp, xfer); - else - copyout(mbufcp, uiocp, xfer); + else { + error = copyout(mbufcp, uiocp, xfer); + if (error != 0) + goto out; + } left -= xfer; len -= xfer; mbufcp += xfer; From nobody Fri Dec 22 20:19:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxdtH5FRTz54QG7; Fri, 22 Dec 2023 20:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxdtH4JyKz4Mkp; Fri, 22 Dec 2023 20:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703276343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fky3GwpXyDmmZYM4iOuF5lK1xlunziPiZ91puP1jGsM=; b=aKPbQSaYlIifqBt100pbWGX2oHwaPkoEdXdlk89ixUHakWZMn70sdbId7kB6AHh08bHY6S Vmi7oNhPTe5DosfuetjZnFkhA4e0lytRVyYjpkZW+rEhVWL/pqg04q6rdgRmcPGgfNIR0u KrMk5/rRTxjJKU1yRihc9IdsL92VKABj4F74coBZpAab0lzFQXR8Bws6WA9V1GoL9jBjh3 8zRPws0Wd7I8dEyC1LVnybQ9VFqmdoEeTgIpNAaQBC/kNghI9T+J6VxDcZVZIsg5sQUhUk kRc8xMlX0XzGLzMmQU8JyT6WibG6jU8IyBNS51WWDUefWhrqEVsuBZnx3YLIsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703276343; a=rsa-sha256; cv=none; b=PCXo6ww+oNJuaG91nk1QpBFAtWBGaOSEliZnmXsDX7BVnjQ9ayPD0jXHnUAsPldruVuEhi 8fuI8498GlWiEWhpGUV6PurHgQaIsjjZIEtENqXcM4AMtvmwugZDOq+kwpRe0UIpAMOT7W ECU8D0L/+5FtzJQngk0NGZv/uWep/wo6iwmB9VsUMtS/QOiikKhISbX5BjpX+jYdiJlfyp ycYDzFNdfZmZPRl91cnCzr2JWvjABW3GECHyiYWv3GMl4hHC/HcJIVuY98PqBmyh/2TmPa TDlWw5/fned1uy9o2lUSAwLqR2/cmHsbxFTSEmUpj0a/3o4+mesrsYDXF0Vx7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703276343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fky3GwpXyDmmZYM4iOuF5lK1xlunziPiZ91puP1jGsM=; b=pQXqM9BEZ8cEVAbXRWjsmGNTwVGcCVEzZu7Z0sVuWGOlnafdTCIbl4yDghhxLLvcv1Lmh6 aI1IqkwaL8pohXZdyyMnq2fRalEKrm8x1jx/JDKpiKyly4ungtyXst8D3ZszbLGPRbrp0J kmMdhhs1o3VJzEBUrsifHoryYPZC7a1F32mjlOipWFPjLcAcbnTr+GwJjZUZN2Z+n5YzA6 DzFy+yyIre4gneClcd4os0SK0Nd654dqTMFZZaMH5L/1Ig8Pn8WEjHRb1TGq6Nckw9axNc pUX2aguy9PqtKogaLHcZXP+WiasvLguzSuwrfhKs9TZ5w5+I13vDPiPIlWTREQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxdtH3NfGzWQ1; Fri, 22 Dec 2023 20:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMKJ3hb048701; Fri, 22 Dec 2023 20:19:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMKJ3IS048698; Fri, 22 Dec 2023 20:19:03 GMT (envelope-from git) Date: Fri, 22 Dec 2023 20:19:03 GMT Message-Id: <202312222019.3BMKJ3IS048698@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: 922e78f65fd9 - main - mountd: Update exports.5 for commit 7c5146da1286 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 922e78f65fd9a58db9e52d84290ed7c187b09278 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=922e78f65fd9a58db9e52d84290ed7c187b09278 commit 922e78f65fd9a58db9e52d84290ed7c187b09278 Author: Rick Macklem AuthorDate: 2023-12-22 20:17:36 +0000 Commit: Rick Macklem CommitDate: 2023-12-22 20:17:36 +0000 mountd: Update exports.5 for commit 7c5146da1286 Commit 7c5146da1286 modified mountd so that it uses strunvis(3) to decode directory names in exports lines. This allows special characters, such as blanks, to be encoded in the directory names. This patch updates the exports.5 man page for this change. This is a content change. Reviewed by: karels, pauamma_gundo.com (manpages) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42163 --- usr.sbin/mountd/exports.5 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index deae95dd6831..8b55162cdcbb 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 16, 2022 +.Dd December 21, 2023 .Dt EXPORTS 5 .Os .Sh NAME @@ -106,6 +106,17 @@ any or .Dq Pa .. components. +Pathnames are decoded by +.Xr strunvis 3 +allowing special characters to be included in the directory name(s). +In particular, whitespace, such as embedded blanks in directory names +can be handled. +For example, a blank can be encoded as \(rs040. +.Xr vis 1 +with the +.Fl M +option may be used to encode directory name(s) with embedded special +characters. Mount points for a file system may appear on multiple lines each with different sets of hosts and export options. .Pp @@ -582,6 +593,8 @@ NFSv4 mount request for a directory that the client does not have permission for will succeed and read/write access will fail afterwards, whereas NFSv3 rejects the mount request. .Sh SEE ALSO +.Xr vis 1 , +.Xr strunvis 3 , .Xr nfsv4 4 , .Xr netgroup 5 , .Xr mountd 8 , From nobody Fri Dec 22 20:26:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxf3M5L6dz54Qn8; Fri, 22 Dec 2023 20: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxf3M4Th2z4Nkf; Fri, 22 Dec 2023 20: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=1703276815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ciiid0SSWyhb6jdMirqYEdKvYasJL94tXiPkX4YnOSI=; b=LrM7xNNVgu0eaaLneC7EB0olhIX+vZooEDuGZ0OElfKDdmXmBqV1CIOfJ7XmmMe8r6Bsbf QD/yln5t8qVPCufdDRj/slN71hKjbMD7qDc14UIAwfKV+UmAFPOYhqVwZqgxGDxjvWNILR B7ean9s5ETbJVblhLCPuO7BIEYU2rU669X7/xwNLXZFJDYVYw+4qgjJ7sGAtCErrEdmxdD WxNwNi+IiRH8QaSxOwBfu2a8xQmnzAN+fCWF0w33sbtmUpzvzZJjRQnCFZdjvxUV3/gWpY QK7tP0Hbs9KhW2SSLc+neqGBviIGG/azzVf3pg04hfL6UH3Pkk6D86m+7E6NBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703276815; a=rsa-sha256; cv=none; b=EdPlcCIBLKhAVSlXvKVrqyOG1X/iBjK3ARSN7/m2ovQKRoJPzzeeBgXLzevRLU08+SWfBW He6wm5towYNydDcBxq5WPc8HV82rpZbLRfPIt9qG6VoVLdGgv4+/3vucVgJMW+dSDUbl6m dweR15HeKTcO3CoXcs+XT0xTo5UksiyVyZSNsIxBOJwNVfFulcvBcXTKxTKIzkSda0Mbqs sQ9StDPzN2R3JjPtufbJKT4M6VTRgYbJNlC6zBlUyqA6i05+LLDWZuBYARzVsX0fWfBO+h 26DczdMfypTIxT/KKPZFu2PQH5+PlXfAYtskFk7VVNc4ZzC6+I6HPqPyyL0dEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703276815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ciiid0SSWyhb6jdMirqYEdKvYasJL94tXiPkX4YnOSI=; b=HRMgT0x+KrUnXJRpiNKuHTr5gB0/0ntc9x9qdNT1vmGQI/7JJ6mslBYhsWqvf3vARSr6Jb 3cljfP3pTsrlEymRVY81iyS2yUVNoXdtGvH9SDUFgsLdRbKvxV4IYNs59e4rpx2OFfjOnC plc1HF5pHUT1Q4KO8glUau0gaM1S+PiikbGjNcKWoZLooVDodbGX4UNLycgdzBOQr1WwAx v2R6KeIt+AuZHtZNDwkTELl7OC6jmtqnok8CjjN/oI/O/d8FFbga07PYG3TUsiM2PoIWOM zDLt4fmJ2dByKBgaoNwXwxvkeFiG42ceOKCPmCRmq0lAP7Z6bd3seoWEftxdOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxf3M3WRTzWL5; Fri, 22 Dec 2023 20:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMKQt36064952; Fri, 22 Dec 2023 20:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMKQt9D064949; Fri, 22 Dec 2023 20:26:55 GMT (envelope-from git) Date: Fri, 22 Dec 2023 20:26:55 GMT Message-Id: <202312222026.3BMKQt9D064949@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: dac33a65b965 - main - RELNOTES: Add an entry for commit 7c5146da1286 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: dac33a65b9658528251f7f057647ad5a2aff2c4f Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=dac33a65b9658528251f7f057647ad5a2aff2c4f commit dac33a65b9658528251f7f057647ad5a2aff2c4f Author: Rick Macklem AuthorDate: 2023-12-22 20:25:19 +0000 Commit: Rick Macklem CommitDate: 2023-12-22 20:25:19 +0000 RELNOTES: Add an entry for commit 7c5146da1286 --- RELNOTES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELNOTES b/RELNOTES index a1dd1e1130fa..de7359b87185 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +7c5146da1286: + Mountd has been modified to use strunvis(3) to decode directory + names in exports(5) file(s). This allows special characters, + such as blanks, to be embedded in the directory name(s). + "vis -M" may be used to encode such directory name(s). + c5359e2af5ab: bhyve(8) has a new network backend, "slirp", which makes use of the libslirp package to provide a userspace network stack. This backend From nobody Fri Dec 22 20:33:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxfCQ0kDRz54R2k; Fri, 22 Dec 2023 20:33:54 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxfCP62Z4z4PPF; Fri, 22 Dec 2023 20:33:53 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-28b82dc11e6so1373940a91.1; Fri, 22 Dec 2023 12:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703277231; x=1703882031; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UFzqv4YthDtWP5+KEdmyr46GCHSUaglW3osh55hMvnk=; b=eJjS5eMhFrkI41S4koEmff4jscy/ZEyotw1JcrnDjZeBVG/u6B3SKmoTuTT5LQ0/0J 4L63re9YxYWbNoxA0ROs00XlVPXCYJMFDSG70NvLha6gL3yvlwfczd8d4Xy/v6A+Jpid pBtXKgsnPK1C9TOtcec3wxPvEJtyCXRGr8ENmGGgn8c47mWWbxJaDreEYyO5ySsk9ReW AK7VGnsOgSTvNEM4aLEFuI4b7+sWea133UB/iu6FjohkBMzzbV0DTOcnrfXtn0G3sJlq KcpQbiay5tJ+2BldR0NZv0827/CvQpS2Z5+APUu8e7X48RQ96jpxKe6UgAhAdb8bhxD4 b53w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703277231; x=1703882031; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UFzqv4YthDtWP5+KEdmyr46GCHSUaglW3osh55hMvnk=; b=T5fsV2xW4Y4u9dApdMZV8ClN82ZFp/WTjfCrZu2B5Xie4HT0Mh/07eNiBZWLM1SjpU qi27lOcG7yBfaNKOZXA5l7UBJtGVauzP7idrKJ9N9ZAuqJGVyJ1hXqm5NO+Y40kFzHdi eowZs5swGYJ2KgfGR7VD57oVICK4PrdkS9Pepg5tvE2efIDD9FdOy1Oiab1aOPByw/Ax fpNcgHNHsO7wN5k1C38eof/kEwV7DpPRgh1OVpKKA7FbeCNWaiJuEpXrw019oypnXlpN Pp9DxBekMjuHkflOsIEj4KYR50v7AeEbLGzIPWAvn5xiUMguP2x47f/reZNIHV2gZRpk 5KRw== X-Gm-Message-State: AOJu0YwiGoCDW+6cNi25hNJv7yWUXy1JdR1LUrs94EvdidGr570rrE8W H0UvZJIsfOR3GKTLfKduC5uo4COkOaZCSx6AtoYqgwc= X-Google-Smtp-Source: AGHT+IF/V2Gu8DqzbPzL9rM0D4CbocVkFIMii7gtohRfQxkJaD02MV1+NtlzZywVLZN5/grYeu2l5q8bpNbaa0V6bfs= X-Received: by 2002:a17:90a:898b:b0:28b:6d33:a3c6 with SMTP id v11-20020a17090a898b00b0028b6d33a3c6mr1137022pjn.25.1703277231144; Fri, 22 Dec 2023 12:33:51 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202312222012.3BMKCfT2047358@gitrepo.freebsd.org> In-Reply-To: <202312222012.3BMKCfT2047358@gitrepo.freebsd.org> From: Rick Macklem Date: Fri, 22 Dec 2023 12:33:39 -0800 Message-ID: Subject: Re: git: b484bcd504a2 - main - nfscl: Fix handling of a copyout() error reply To: Rick Macklem Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-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]; TAGGED_FROM(0.00)[] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SxfCP62Z4z4PPF Just FYI, I missed the MCF after on this commit. I plan to MFC it in a week. rick On Fri, Dec 22, 2023 at 12:13=E2=80=AFPM Rick Macklem wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > > The branch main has been updated by rmacklem: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db484bcd504a29037752d5214a4= 18412724761d88 > > commit b484bcd504a29037752d5214a418412724761d88 > Author: Rick Macklem > AuthorDate: 2023-12-22 20:11:22 +0000 > Commit: Rick Macklem > CommitDate: 2023-12-22 20:11:22 +0000 > > nfscl: Fix handling of a copyout() error reply > > If vfs.nfs.nfs_directio_enable is set non-zero (the default is > zero) and a file on an NFS mount is read after being opened > with O_DIRECT | O_ RDONLY, a call to nfsm_mbufuio() calls > copyout() without checking for an error return. > If copyout() returns EFAULT, this would not work correctly. > > Only the call path > VOP_READ()->ncl_readrpc()->nfsrpc_read()->nfsrpc_readrpc() > will do this and the error return for EFAULT will > be returned back to VOP_READ(). > > This patch adds the error check to nfsm_mbufuio(). > > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D43160 > --- > sys/fs/nfs/nfs_commonsubs.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c > index 832713e6c1de..e79f73739487 100644 > --- a/sys/fs/nfs/nfs_commonsubs.c > +++ b/sys/fs/nfs/nfs_commonsubs.c > @@ -679,17 +679,13 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio = *uiop, int siz) > ("len %d, corrupted mbuf?", len)); > } > xfer =3D (left > len) ? len : left; > -#ifdef notdef > - /* Not Yet.. */ > - if (uiop->uio_iov->iov_op !=3D NULL) > - (*(uiop->uio_iov->iov_op)) > - (mbufcp, uiocp, xfer); > - else > -#endif > if (uiop->uio_segflg =3D=3D UIO_SYSSPACE) > NFSBCOPY(mbufcp, uiocp, xfer); > - else > - copyout(mbufcp, uiocp, xfer); > + else { > + error =3D copyout(mbufcp, uiocp, xfer); > + if (error !=3D 0) > + goto out; > + } > left -=3D xfer; > len -=3D xfer; > mbufcp +=3D xfer; From nobody Fri Dec 22 20:44:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxfS92Zvnz54Sc2; Fri, 22 Dec 2023 20:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxfS92496z4Pxw; Fri, 22 Dec 2023 20:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703277897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pHba0lHy1AVrpW6Oe4c6nAIvvL1OzOoONubu8ZOG57w=; b=Of+vXXq0RyfplObhMPdwermufpSSam85UT7fa40ZMqhzOSlnpV+ZbB1RZ61CQiL8io3zXV Y/9C/ajCrtuwMRK/b+AvinKD6Q0dJ5nN2NZ7rcxgGvBOFH2m+gXABbETH5XDbOvuYGDbNF Y1GLrysHBE+8+1WVYT4QxVx5fSh2F1Er1pQxhbQoNtg2scjvMqRxk7j59chrOKLE/e3zy3 s9PWIJYNxIYQY8wULpPK6qGlDQ5eASMx4vw7tcZCcpjY2qhEmX2Sp/XAcqsU4+fNdfXYg2 qOTmhkpuJ3SGOJJXk4gU/OyefYmmF1pz+ZYfLLENRithyM3M6BbtAewNeeovjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703277897; a=rsa-sha256; cv=none; b=KWfOEdrb7/p9iLam5bPczNYnPL8Ehjc37CpVJTihateWuEPY4dHd+W70sNC0gYC9gdpLoM KyGLH0QMW2zQQdTOz/MwC2jhlSwf5ybkuEegDCGFw5IamzPGsmbIvpS2nWsytuIBwy4UkP 9KVvH0ODp8rhZpH5I0FE2eobTHs6kODp9sM2yhEXYAHzAGe99AC0pyxcb6jkUr8HhzpsuJ eIK+AYoB1alq2d84IDYiZgPPJ7X6lIofbq1cmSH1cp5+d0f1iwYKCJrwNweSCcJA7pHAby 708mH9bCF+v6/f1UvlrdfS0NaRJF9pxZYYossgohSeQBeC8QwBQnZ+YWWxUg2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703277897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pHba0lHy1AVrpW6Oe4c6nAIvvL1OzOoONubu8ZOG57w=; b=HYV71wpm1hll4K+kcZhz3/FcjbL1dy2GxGucvDU1wCB262SvKSQ1zakjvEmozL5Te7zLRH LJw1VRkLkixe7s3DvY5eGZ3wNTpVXCr+AqZzNB89mx07M9ymqMBuP1d16ZjIpMlg2SjFE5 DtdyeYZufWPczdMoCcDE29+Nz4B8xjas4ksR++EkiFQPXAiXJNJiEwTjZLpJgh/f6o2I2c G344MEgaiKp1+sjBaI4uExLWj4sXRmcrWQG0KIoLGyYCvKJuLKvHC0DMI8ROn4TtWvJNwj 6Cbz4lCmASHivNZ2PNFsL5BsgYK6SpGrGfHEgBrhYNkypgDA3PvlaBFwDJZ7/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxfS9174FzXKp; Fri, 22 Dec 2023 20:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMKivJv098207; Fri, 22 Dec 2023 20:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMKiviA098204; Fri, 22 Dec 2023 20:44:57 GMT (envelope-from git) Date: Fri, 22 Dec 2023 20:44:57 GMT Message-Id: <202312222044.3BMKiviA098204@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: e615bcd32171 - stable/14 - mountd: Add support for spaces in exported directories List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: e615bcd32171378fc4204fea2ea2cf97ec238213 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e615bcd32171378fc4204fea2ea2cf97ec238213 commit e615bcd32171378fc4204fea2ea2cf97ec238213 Author: Dan Mcgregor AuthorDate: 2023-11-04 22:07:56 +0000 Commit: Rick Macklem CommitDate: 2023-12-22 20:42:15 +0000 mountd: Add support for spaces in exported directories The previous code would correctly parse strings including quotation marks (") or backslash (/), but the tests when creating the export includes them in the final string. This prevents exporting paths with embedded spaces, for example "/exports/with space". Trying results in log lines resembling: mountd[1337]: bad exports list line '/exports/with\ space': /exports/with\ space: lstat() failed: No such file or directory. Turns out that when creating its exports list, zfs escapes strings in a format compatible with vis(3). Since I expect that zfs sharenfs is the dominating use case for generating an exports list, use strunvis(3) to parse the export path. The result is lines like the following allowing spaces: /exports/with\040space -network 192.168.0 -mask 255.255.255.0 A man page update will be done as a separate commit. (cherry picked from commit 7c5146da128688ba2bb6bdad5e98716087a47281) --- usr.sbin/mountd/mountd.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 6602dbc09aa0..33c19a81a0cf 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -83,6 +83,7 @@ static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; #include #include #include +#include #include "pathnames.h" #include "mntopts.h" @@ -1561,10 +1562,13 @@ get_exportlist_one(int passno) char *err_msg = NULL; int len, has_host, got_nondir, dirplen, netgrp; uint64_t exflags; + char unvis_dir[PATH_MAX + 1]; + 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); @@ -1631,17 +1635,25 @@ get_exportlist_one(int passno) } else if (*cp == '/') { savedc = *endcp; *endcp = '\0'; + unvis_len = strnunvis(unvis_dir, sizeof(unvis_dir), + cp); + if (unvis_len <= 0) { + getexp_err(ep, tgrp, "Cannot strunvis " + "decode dir"); + goto nextline; + } if (v4root_phase > 1) { if (dirp != NULL) { getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } } - if (check_dirpath(cp, &err_msg) && - check_statfs(cp, &fsb, &err_msg)) { + if (check_dirpath(unvis_dir, &err_msg) && + check_statfs(unvis_dir, &fsb, &err_msg)) { if ((fsb.f_flags & MNT_AUTOMOUNTED) != 0) syslog(LOG_ERR, "Warning: exporting of " - "automounted fs %s not supported", cp); + "automounted fs %s not supported", + unvis_dir); if (got_nondir) { getexp_err(ep, tgrp, "dirs must be first"); goto nextline; @@ -1652,16 +1664,17 @@ get_exportlist_one(int passno) goto nextline; } if (strlen(v4root_dirpath) == 0) { - strlcpy(v4root_dirpath, cp, + strlcpy(v4root_dirpath, unvis_dir, sizeof (v4root_dirpath)); - } else if (strcmp(v4root_dirpath, cp) + } else if (strcmp(v4root_dirpath, unvis_dir) != 0) { syslog(LOG_ERR, - "different V4 dirpath %s", cp); + "different V4 dirpath %s", + unvis_dir); getexp_err(ep, tgrp, NULL); goto nextline; } - dirp = cp; + dirp = unvis_dir; v4root_phase = 2; got_nondir = 1; ep = get_exp(); @@ -1699,8 +1712,9 @@ get_exportlist_one(int passno) /* * Add dirpath to export mount point. */ - dirp = add_expdir(&dirhead, cp, len); - dirplen = len; + dirp = add_expdir(&dirhead, unvis_dir, + unvis_len); + dirplen = unvis_len; } } else { if (err_msg != NULL) { From nobody Sat Dec 23 01:36:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxmwV1XL2z54m34 for ; Sat, 23 Dec 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxmwV0wKPz4v6L; Sat, 23 Dec 2023 01:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703295386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRJfMbxE4DF9O5nVM7F5V8czsWUODiJK3YSY7J7wtdI=; b=qfbaftLvDxvKuowl+5WptpNvTvnUILDjc7eDKGhQW4Gj+pQ0kL1xptqTxLowulKgXnsQgb O8BuJxgsdbS8XtiDc7rvzUBP282En3hJpsiPz0BArPIyD1D9bHqxZH+MX3WZSuTNa8IoxS IEmJvkZMAAuv888lyDiomtRgJiqBBNS+s8dCOYOAai9uIrQBMtim6LW+Jy0RRBYQylekxK rEXHmakhSQQJEezUkAvo3Odmxf9WEQPNeLNzuCD77gaRBmfhsTDYiwKGjH1fw3EfReYQ4G h7B8mD/BFU+kWDWOKOfpSiTJlNpUNE9QvzIbVUev8e19Vuss1+91b+6KLYu0lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703295386; a=rsa-sha256; cv=none; b=yZQjRaPalEMnsHuV2bcEHQw2xMPftOHB6b6fyEpL2hlezwWy8AAxL2NBVw9Ful4nJyMWlq OV9sIaz7D8S5pAPfetVWQV+olFG+fTYnjEt5OOzeHxm4Gut62FzO/oqZOz/ebaNfU+0oc3 /hWZDEEhPptwHYN7dkr/8KT+mkTf1OggTNt2Nc/WnPng8V6D/IA/OguBCo8PAT95W1ID8f SWSo84EmsLLI2APwk0WMMMBBeDqaOXY3aqpzbel4ploOegx65Iqlg7Mh2Vc8ce3P0ATATH NVFoDIOz0Sr2ofQHBovKT8Zbq+izmhQfRu8vgO9azzZDbYdBG/OCWCLCfdiECw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703295386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TRJfMbxE4DF9O5nVM7F5V8czsWUODiJK3YSY7J7wtdI=; b=IQ/COhULSIKYuBpd6CPKZCJ7quSAlOI2K2WZHiYE09UebU6Q8XpqNoiwaK1K2qfQpTW4UQ v3B3P2c+owQ7goj34SRkAvH4lEPR3Vuh8EecndvTitTyRWTcvqErlCZAceZBgahbzefa+l /NZNrxd/FzcrFQyzdJifenVNNtjCGQQSWF2JdC+9OBofisVJc02Co4U0CIw/2yVDH+CwQm 24S3H4SRV8mnulGiy7S/pq2wOmttN6CrV5npY92sF+XaKMH6bnjnVxW3LoIUyL8rKilkyI WGThM7jtq6309KYz2MKRRQzUq78q1/rTbwWx5PGAOCoJMedmZ1+IG0eTqmeGhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxmwT6m9vzgDQ; Sat, 23 Dec 2023 01:36:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN1aPKk083815; Sat, 23 Dec 2023 01:36:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN1aPK7083814; Sat, 23 Dec 2023 01:36:25 GMT (envelope-from git) Date: Sat, 23 Dec 2023 01:36:25 GMT Message-Id: <202312230136.3BN1aPK7083814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: 1bb5a589a9a5..893fe32cd21e - 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 893fe32cd21ed460558d04ec8d860ad7174e42a1 X-Git-Oldrev: 1bb5a589a9a527291b12fcb2ff5e6b6dda73cad1 X-Git-Newrev: 893fe32cd21ed460558d04ec8d860ad7174e42a1 Auto-Submitted: auto-generated The branch vendor/tzdata has been updated by philip: URL: https://cgit.FreeBSD.org/src/log/?id=1bb5a589a9a5..893fe32cd21e 893fe32cd21e Import tzdata 2023d From nobody Sat Dec 23 01:36:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxmwV1kbqz54lZf for ; Sat, 23 Dec 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxmwV1Gl7z4v8F; Sat, 23 Dec 2023 01:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703295386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nn0HyHaQ2iTbvhNWivuzEKHIHqmciUZ0Bu2Kb2IwQck=; b=QOAz1vbnXHv2eUpFDSrmM+De1bs6zOD/LtVg8ykc9MSBZnAFdh33cxmfZhfwUxbmajL7oh iqHUUCUjplBhil7OhfZ4vvyb5Zom/dDIDJBV0jpGp4Kw//6INK+lQe7cMmyTu3us4Monyr Ghj+dMp4VD1YOuSiguRZv5wBT92TZF0ufKYxNQ5YWD0L1csJUOQT6fgeoGZIMgYsdd7lfo hBKHuiDrTitviCRlGT4Zs0NWLafOAQX9xefDzuZ4KBAb2rfo/ypRfORPsrJbbGt947SeP0 pwPgYheZGh2REkJFJIqh+8NtrpCsFu4mbIvu+wrIAxCRRk3Fq7eZwFH67WHstw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703295386; a=rsa-sha256; cv=none; b=a2HsROzwNAFWO0gbmKIL82e+BU6sqNPEWInwZaDifGdei4jbr67OVvqmemTuSlMwyG0S3r A4dm425lCWUnUqmCOUzh0khEx8d1C07hVVKlRM1rJgWw9hmVrPCX92gUgnVdiYeftSs23v Pv5pKUDqxPHpwsCG8TbgXLVoxbij/2V4zmWqOst/LVjAmNADnEtgdRvX6qF/JYLFcVWe2X IcQFop2cBR4ZTkHeI8X7hnGvP7CdFJZ+WXgBHYWD43ahbTouJrjrkjfkV6Hk2gTIPG61yP 6im8eCwylGYvYHOyJOIMTPWQ2IKajQFyPXhrsPftCJJwzHghLkGvjeFOVqhHEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703295386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nn0HyHaQ2iTbvhNWivuzEKHIHqmciUZ0Bu2Kb2IwQck=; b=dVKPkVPQRMJYaJ9pmNRUe7yleOyxFVyyH8p8RHxMpNlg9L3gz4FJTMpXFp4fEfSAxnXp+p lpr2XRIP7a6S/badU3wryOvhWIosL/rLoj+PoArwVsCN7ARlbeTiKnp6DdCkCPJtGW9q8b YBEsigEal07q4wN8SqD7bNaLiqkJ9cY422WyPvdftQKYtDWzpjxFgkdhb+4wr46i776fkU r3nPfN3VVviTOuaM3Mw8L9wvwjou2oLWoLEC9b4Zzay63W9DSY8VWY/JKTDvb+Ir65YnLp +Fd26MvSq5Sfdy3S1RdzkSvnD02P2iYjD55xrtQC2VdD824Tz+2hyn8DUTH1dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxmwV0JyJzfvw; Sat, 23 Dec 2023 01:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN1aPCI083834; Sat, 23 Dec 2023 01:36:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN1aPMY083833; Sat, 23 Dec 2023 01:36:25 GMT (envelope-from git) Date: Sat, 23 Dec 2023 01:36:25 GMT Message-Id: <202312230136.3BN1aPMY083833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Philip Paeps Subject: git: eef46b6ecb39 - Create tag vendor/tzdata/tzdata2023d List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/tags/vendor/tzdata/tzdata2023d X-Git-Reftype: annotated tag X-Git-Commit: eef46b6ecb399d51c0f67dbb632a52a5422e3f6b Auto-Submitted: auto-generated The annotated tag vendor/tzdata/tzdata2023d has been created by philip: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/tzdata/tzdata2023d tag vendor/tzdata/tzdata2023d Tagger: Philip Paeps TaggerDate: 2023-12-23 01:34:59 +0000 Tag import of tzdata 2023d commit 893fe32cd21ed460558d04ec8d860ad7174e42a1 Author: Philip Paeps AuthorDate: 2023-12-23 01:34:58 +0000 Commit: Philip Paeps CommitDate: 2023-12-23 01:34:58 +0000 Import tzdata 2023d From nobody Sat Dec 23 01:52:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxnHB06grz54mfN; Sat, 23 Dec 2023 01:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxnH96bS1z3DLl; Sat, 23 Dec 2023 01:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703296357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MsTI+YjHJyedGKtJ9q0KYuFxW8l5WFGdTtFOwyF6Y8=; b=LDoTsrgbdWNtmt0KNxll2bJteIp51Et3zYLLqQhquoqr9SaGprJ9qNTo+dSJdtIY6ByfbQ 2+vVL8QlxSoaji0Dihn9NW5i8HpDHl4ibModsfvSacacUMTXcfwvYbq++phyHSLiDn7X5n cQ58y5PNYdnidkaiGwj1OILKUMPvHxB57XpuwBcOz8ciBXyx/9ZAo2o3CKREEMLyHMMRMR IJLzJBeE4QHg77LwNcxXMbBKNBD9dFMgCb/2a9Na2IKWThm+JH1J6rRqPDCtcBZvrSAIeY 17QMWnFF15cA4/EfAYQrnZOOjCqh9t3lhhXdIC4A6vz+SyOwT+bABNE3zDPzrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703296357; a=rsa-sha256; cv=none; b=fgbX93S+L/KcG1pIkJQY5OncR2rtge3TSD9c8vXu/BYMuGpxQeUx4jFBqt7pyj07AKB5LO n9vV8JnV5h5E9+pm7RbaGJyZKsirN/lXuYUlwSWIrx1mxuFKlX/41byVXrYbkH2fbXFCfp z33ixi42+O0mmv/6zpKQXXpGmCY530BfJHueAznaxxlSFZack00EQKl0/QQEWKGWNPSAJn xO4h3SJv2O5EJ9iQbvJOV46KEJ2Y/BbqVSkOWtzl1Ygj1+67UYR4UHED+io+sdV2k42f9g Ch2y/5dFzXe69RNqj3PsMJSv/audfIOQvelw9qQ1n01EjZoRdgBd2nEQgdXbgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703296357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MsTI+YjHJyedGKtJ9q0KYuFxW8l5WFGdTtFOwyF6Y8=; b=cweT6NNvoqwCCbbo/49PQiJdXGC6Wdso9GunMtEJpf0vxggzDRNmsJw17Wl3X+yeyc9s9Y s4QD7iDQUREhLriplrGhqF8ri0T/kvYmnB8PHCP76eGjcRGl389peyqYr2N+NtIg56AxlC 5LXQ3jLnH5tsjbJsTs6GvqCKCwJc35api2x5qgNLNIQiO8407UfRLdW3z5s7fUxw90+ZMe fYDGKc8zEwdcyCL38kZFv3NBjS9e8oz/wb0Y0XjjA+icyeOm4LGp1lGUaMV1+5SZKACm1U aMJDOt5q7l7pvBYvCcCXzBiD3Vof8VfqQ4U8pPtPG41O9ifQ2VHqRMWUZY1W1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxnH95K7zzgMG; Sat, 23 Dec 2023 01:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN1qbc6017312; Sat, 23 Dec 2023 01:52:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN1qZtv017300; Sat, 23 Dec 2023 01:52:35 GMT (envelope-from git) Date: Sat, 23 Dec 2023 01:52:35 GMT Message-Id: <202312230152.3BN1qZtv017300@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: eebb9c2caea1 - main - contrib/tzdata: import tzdata 2023d List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: eebb9c2caea1584773ae4cec311cee1eea5b1655 Auto-Submitted: auto-generated The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=eebb9c2caea1584773ae4cec311cee1eea5b1655 commit eebb9c2caea1584773ae4cec311cee1eea5b1655 Merge: dac33a65b965 893fe32cd21e Author: Philip Paeps AuthorDate: 2023-12-23 01:51:01 +0000 Commit: Philip Paeps CommitDate: 2023-12-23 01:51:01 +0000 contrib/tzdata: import tzdata 2023d Changes: https://github.com/eggert/tz/blob/2023d/NEWS MFC after: 1 day contrib/tzdata/Makefile | 209 ++++++++++++++++++--------- contrib/tzdata/NEWS | 125 ++++++++++++++-- contrib/tzdata/README | 19 +-- contrib/tzdata/africa | 7 - contrib/tzdata/antarctica | 57 +++++++- contrib/tzdata/asia | 6 +- contrib/tzdata/australasia | 8 +- contrib/tzdata/backward | 1 - contrib/tzdata/backzone | 29 ---- contrib/tzdata/checknow.awk | 54 +++++++ contrib/tzdata/checktab.awk | 7 +- contrib/tzdata/europe | 29 +++- contrib/tzdata/leap-seconds.list | 8 +- contrib/tzdata/leapseconds | 8 +- contrib/tzdata/northamerica | 2 +- contrib/tzdata/southamerica | 6 + contrib/tzdata/version | 2 +- contrib/tzdata/zone.tab | 24 ++-- contrib/tzdata/zone1970.tab | 29 ++-- contrib/tzdata/zonenow.tab | 301 +++++++++++++++++++++++++++++++++++++++ 20 files changed, 763 insertions(+), 168 deletions(-) diff --cc contrib/tzdata/Makefile index 6edc73cc6ffb,000000000000..4e45f93b915c mode 100644,000000..100644 --- a/contrib/tzdata/Makefile +++ b/contrib/tzdata/Makefile @@@ -1,1249 -1,0 +1,1330 @@@ +# Make and install tzdb code and data. - +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. ++# Request POSIX conformance; this must be the first non-comment line. ++.POSIX: ++# On older platforms you may need to scrounge for a POSIX-conforming 'make'. ++# For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or ++# /usr/xpg4/bin/make, not /usr/ccs/bin/make. ++ ++# To affect how this Makefile works, you can run a shell script like this: ++# ++# #!/bin/sh ++# make CC='gcc -std=gnu11' "$@" ++# ++# This example script is appropriate for a pre-2017 GNU/Linux system ++# where a non-default setting is needed to support this package's use of C99. ++# ++# 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 +TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t + +# What kind of TZif data files to generate. (TZif is the binary time +# zone data format that zic generates; see Internet RFC 8536.) +# If you want only POSIX time, with time values interpreted as +# seconds since the epoch (not counting leap seconds), use +# REDO= posix_only +# below. If you want only "right" time, with values interpreted +# as seconds since the epoch (counting leap seconds), use +# REDO= right_only +# below. If you want both sets of data available, with leap seconds not +# counted normally, use +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# with it, use "posix_only" or "posix_right". Use POSIX time on systems with +# leap smearing; this can work better than unsmeared "right" time with +# applications that are not leap second aware, and is closer to unsmeared +# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). + +REDO= posix_right + +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and was modified in tzdb 2021b to generate version 4 TZif files. +# EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to pre-2020a zic implementations and so that TZif files +# built by newer zic implementations can be read by pre-2021b libraries. +EXPIRES_LINE= 0 + +# To install data in text form that has all the information of the TZif data, +# (optionally incorporating leap second information), use +# TZDATA_TEXT= tzdata.zi leapseconds +# To install text data without leap second information (e.g., because +# REDO='posix_only'), use +# TZDATA_TEXT= tzdata.zi +# To avoid installing text data, use +# TZDATA_TEXT= + +TZDATA_TEXT= leapseconds tzdata.zi + +# For backward-compatibility links for old zone names, use +# BACKWARD= backward +# To omit these links, use +# BACKWARD= + +BACKWARD= backward + +# If you want out-of-scope and often-wrong data from the file 'backzone', +# but only for entries listed in the backward-compatibility file zone.tab, use +# PACKRATDATA= backzone +# PACKRATLIST= zone.tab +# If you want all the 'backzone' data, use +# PACKRATDATA= backzone +# PACKRATLIST= +# To omit this data, use +# PACKRATDATA= +# PACKRATLIST= + +PACKRATDATA= +PACKRATLIST= + +# The name of a locale using the UTF-8 encoding, used during self-tests. +# The tests are skipped if the name does not appear to work on this system. + +UTF8_LOCALE= en_US.utf8 + +# Non-default libraries needed to link. +# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. +LDLIBS= + - # Add the following to the end of the "CFLAGS=" line as needed to override - # defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". ++# 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 +# -DHAVE_DECL_ENVIRON if declares 'environ' +# -DHAVE_DECL_TIMEGM=0 if does not declare timegm +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE__GENERIC=0 if _Generic does not work* +# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), +# -DHAVE_GETRANDOM=0 to avoid using getrandom +# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), +# where LDLIBS also needs to contain -lintl on some hosts; +# -DHAVE_GETTEXT=0 to avoid using gettext +# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H=0 if does not work*+ +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_SETENV=0 if your system lacks the setenv function +# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ +# -DHAVE_STDCKDINT_H=0 if neither nor substitutes like +# __builtin_add_overflow work* +# -DHAVE_STDINT_H=0 if does not work*+ +# -DHAVE_STRFTIME_L if declares locale_t and strftime_l +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if does not work* +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if does not work* +# -DHAVE_UTMPX_H=0 if does not work* +# -Dlocale_t=XXX if your system uses XXX instead of locale_t - # -DPORT_TO_C89 if tzcode should also run on C89 platforms+ ++# -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ ++# Typically it is better to use a later standard. For example, ++# with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. ++# Even with -DPORT_TO_C89, the code needs at least one C99 ++# feature (integers at least 64 bits wide) and maybe more. +# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers +# with external linkage, e.g., applications cannot define 'localtime'. +# -Dssize_t=long on hosts like MS-Windows that lack ssize_t +# -DSUPPORT_C89 if the tzcode library should support C89 callers+ ++# However, this might trigger latent bugs in C99-or-later callers. +# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has +# security implications and is not recommended for general use +# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# This is intended for internal use only; it mangles external names. +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions for POSIX-style TZ strings lacking them, +# in the usual case where POSIXRULES is '-'. If not specified, +# TZDEFRULESTRING defaults to US rules for future DST transitions. +# This mishandles some past timestamps, as US DST rules have changed. +# It also mishandles settings like TZ='EET-2EEST' for eastern Europe, +# as Europe and US DST rules differ. +# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) +# -DUNINIT_TRAP if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably older ones that +# ignore or otherwise mishandle 64-bit data in TZif files; +# however, fat TZif files may trigger bugs in newer TZif readers. +# Slim TZif files are more efficient, and are the default. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) ++# -g to generate symbolic debugging info ++# -Idir to include from directory 'dir' ++# -O0 to disable optimization; other -O options to enable more optimization ++# -Uname to remove any definition of the macro 'name' +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +# +# * Options marked "*" can be omitted if your compiler is C23 compatible. +# * Options marked "+" are obsolescent and are planned to be removed - # once the code assumes C99 or later. ++# once the code assumes C99 or later, say in the year 2029. +# +# Select instrumentation via "make GCC_INSTRUMENT='whatever'". +GCC_INSTRUMENT = \ + -fsanitize=undefined -fsanitize-address-use-after-scope \ + -fsanitize-undefined-trap-on-error -fstack-protector +# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. +GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ + $(GCC_INSTRUMENT) \ + -Wall -Wextra \ + -Walloc-size-larger-than=100000 -Warray-bounds=2 \ + -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ + -Wdeclaration-after-statement -Wdouble-promotion \ + -Wduplicated-branches -Wduplicated-cond \ + -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ + -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ + -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ + -Wnull-dereference \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ + -Wstrict-prototypes -Wstringop-overflow=4 \ + -Wstringop-truncation -Wsuggest-attribute=cold \ + -Wsuggest-attribute=const -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ + -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ + -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ + -Wvariadic-macros -Wvla -Wwrite-strings \ + -Wno-address -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 these two fields +# not required by POSIX, a future version of POSIX is planned to require them +# and they are widely available on GNU/Linux and BSD systems. +# +# The next batch of options control support for external variables +# exported by tzcode. In practice these variables are less useful +# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. +# # +# # To omit or support the external variable "tzname", add one of: +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" +# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # 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 2008 (with XSI) and later. +# # 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. - # "timelocal" is equivalent to "mktime". ++# 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 ++# 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= ++#CFLAGS= -O 1 + - # Linker flags. Default to $(LFLAGS) for backwards compatibility - # to release 2012h and earlier. + - LDFLAGS= $(LFLAGS) ++# 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 202x/D3. ++#AR = ar ++#ARFLAGS = -rv ++#CC = c17 ++#LDFLAGS = ++#MAKE = make + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +# To shrink the size of installed TZif files, +# append "-r @N" to omit data before N-seconds-after-the-Epoch. +# To grow the files and work around bugs in older applications, +# possibly at the expense of introducing bugs in newer ones, +# append "-b fat"; see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. +ZFLAGS= + +# How to use zic to install TZif files. + +ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) + - # The name of a Posix-compliant 'awk' on your system. ++# 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 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 ++# 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. +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 +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. +# This makes it easier to see which Zone has been affected. +DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ + || echo ' -F^TZ=') + - ############################################################################### - - #MAKE= make ++# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. ++RANLIB= : + - cc= cc - CC= $(cc) -DTZDIR='"$(TZDIR)"' ++# 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 + - AR= ar ++# End of macros that one plausibly might want to tailor. ++############################################################################### + - # ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. - RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o strftime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= calendars CONTRIBUTING LICENSE Makefile \ + NEWS README SECURITY theory.html version +WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_theory.html check_tz-art.html \ + check_tz-how-to.html check_tz-link.html +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= zone1970.tab zone.tab ++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 checktab.awk leapseconds.awk \ ++AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ + ziguard.awk zishrink.awk +MISC= $(AWK_SCRIPTS) +TZS_YEAR= 2050 +TZS_CUTOFF_FLAG= -c $(TZS_YEAR) +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +TZDATA_DIST = $(COMMON) $(DATA) $(MISC) +# EIGHT_YARDS is just a yard short of the whole ENCHILADA. +EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi +ENCHILADA = $(EIGHT_YARDS) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ + africa antarctica asctime.c asia australasia \ + backward backzone \ - checklinks.awk checktab.awk \ ++ 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 - - # And for the benefit of csh users on systems that assume the user - # shell should be used to handle commands in Makefiles. . . - - SHELL= /bin/sh ++ zone.tab zone1970.tab zonenow.tab + +all: tzselect zic zdump libtz.a $(TABDATA) \ + vanguard.zi main.zi rearguard.zi + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p '$(DESTDIR)$(BINDIR)' \ + '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ + '$(DESTDIR)$(LIBDIR)' \ + '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ + '$(DESTDIR)$(MANDIR)/man8' + $(ZIC_INSTALL) -l $(LOCALTIME) \ + `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ + ` $(POSIXRULES) \ + -t '$(DESTDIR)$(TZDEFAULT)' + cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' + cp tzselect '$(DESTDIR)$(BINDIR)/.' + cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' + cp zic '$(DESTDIR)$(ZICDIR)/.' + cp libtz.a '$(DESTDIR)$(LIBDIR)/.' + $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' + cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' + cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' + cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' + +INSTALL: ALL install date.1 + mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' + cp date '$(DESTDIR)$(BINDIR)/.' + cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' + +# Calculate version number from git, if available. +# Otherwise, use $(VERSION) unless it is "unknown" and there is already +# a 'version' file, in which case reuse the existing 'version' contents +# and append "-dirty" if the contents do not already end in "-dirty". +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ + if test '$(VERSION)' = unknown && V=`cat $@`; then \ + case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ + else \ + V='$(VERSION)'; \ + fi; } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. +vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) + $(AWK) \ + -v DATAFORM=`expr $@ : '\(.*\).zi'` \ + -v PACKRATDATA='$(PACKRATDATA)' \ + -v PACKRATLIST='$(PACKRATLIST)' \ + -f ziguard.awk \ + $(TDATA) $(PACKRATDATA) >$@.out + mv $@.out $@ +# This file has a version comment that attempts to capture any tailoring +# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. +tzdata.zi: $(DATAFORM).zi version zishrink.awk + version=`sed 1q version` && \ + LC_ALL=C $(AWK) \ + -v dataform='$(DATAFORM)' \ + -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ + -v redo='$(REDO)' \ + -v version="$$version" \ + -f zishrink.awk \ + $(DATAFORM).zi >$@.out + mv $@.out $@ + ++tzdir.h: ++ printf '%s\n' >$@.out \ ++ '#ifndef TZDEFAULT' \ ++ '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ ++ '#endif' \ ++ '#ifndef TZDIR' \ ++ '# define TZDIR "$(TZDIR)" /* TZif directory */' \ ++ '#endif' ++ mv $@.out $@ ++ +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.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 $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + BACKWARD='$(BACKWARD)' \ + DESTDIR='$(DESTDIR)' \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + PACKRATLIST='$(PACKRATLIST)' \ + TZDEFAULT='$(TZDEFAULT)' \ + TZDIR='$(TZDIR)' \ + ZIC='$(ZIC)' + +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi + +# 'make install_data' installs one set of TZif files. +install_data: $(INSTALL_DATA_DEPS) + $(ZIC_INSTALL) tzdata.zi + +posix_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: $(INSTALL_DATA_DEPS) + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr '$(DESTDIR)$(TZDIR)-leaps' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + +posix_right: posix_only + rm -fr '$(DESTDIR)$(TZDIR)-posix' + ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only + $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only + +zones: $(REDO) + +# dummy.zd is not a real file; it is mentioned here only so that the +# top-level 'make' does not have a syntax error. +ZDS = dummy.zd +# Rule used only by submakes invoked by the $(TZS_NEW) rule. +# It is separate so that GNU 'make -j' can run instances in parallel. +$(ZDS): zdump + ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ + >$@ + +TZS_NEW_DEPS = tzdata.zi zdump zic +$(TZS_NEW): $(TZS_NEW_DEPS) + rm -fr tzs$(TZS_YEAR).dir + mkdir tzs$(TZS_YEAR).dir + $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi + $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ + tzdata.zi | LC_ALL=C sort >$@.out + wd=`pwd` && \ + x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ + tzdata.zi \ + | LC_ALL=C sort -t . -k 2,2` && \ + set x $$x && \ + shift && \ + ZDS=$$* && \ + $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ + ZDS="$$ZDS" $$ZDS && \ + sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out + rm -fr tzs$(TZS_YEAR).dir + mv $@.out $@ + +# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the +# 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) -rc $@ $(LIBOBJS) ++ $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ - -e 's|#!/bin/bash|#!$(KSHELL)|g' \ - -e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \ - -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ - -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ - -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ - -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ - <$@.ksh >$@.out ++ -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ ++ -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ ++ -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ ++ -e s\''\(REPORT_BUGS_TO\)=.*'\''\1=\'\''$(BUGEMAIL)\'\'\' \ ++ -e s\''\(TZDIR\)=[^}]*'\''\1=\'\''$(TZDIR)\'\'\' \ ++ -e s\''\(TZVERSION\)=.*'\''\1=\'"'$$VERSION\\''" \ ++ <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_back check_mild +check_mild: check_character_set check_white_space check_links \ - check_name_lengths check_slashed_abbrs check_sorted \ ++ check_name_lengths check_now \ ++ check_slashed_abbrs check_sorted \ + check_tables check_web check_ziguard check_zishrink check_tzs + ++# 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 \ ++ || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } ++ +check_character_set: $(ENCHILADA) - test ! '$(UTF8_LOCALE)' || \ - ! printf 'A\304\200B\n' | \ - LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ - LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ ++ $(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 $@ + +check_white_space: $(ENCHILADA) ++ $(UTF8_LOCALE_MISSING) || { \ + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ - ! grep -En "$$pat" \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - ! grep -n '[$s]$$' \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - touch $@ ++ ! grep -En "$$pat|[$s]\$$" \ ++ $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ ++ } ++ touch $@ + +PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ +FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} + +check_name_lengths: $(TDATA_TO_CHECK) backzone + ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ + $(TDATA_TO_CHECK) backzone + 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]*/ + +check_slashed_abbrs: $(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]; } + +check_sorted: 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 $@ + +check_back: checklinks.awk $(TDATA_TO_CHECK) + $(AWK) \ + -v DATAFORM=$(DATAFORM) \ + -v backcheck=backward \ *** 463 LINES SKIPPED *** From nobody Sat Dec 23 04:11:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxrLx3c0Yz54vtk; Sat, 23 Dec 2023 04:11: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxrLx39Zyz3PJg; Sat, 23 Dec 2023 04:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703304665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=doBCRNMupLDt6KQFYXAWx6ZX7htI79fnEhR6Yz11Zr0=; b=Ul4296tGY0F0z5sRJm9tKyNgbBM98QYsPk/TEgNgc2T/+ljUWEB+QKh1eO5wm518XjMgYr eba7KEwmgLJnpEQ4wXbtPkbjPZPFrPsrdAn7jl4YPpriQMuUtKEM0k8ob0PW1RQo/+h149 OIs+qVL0JsCAs8n0jz3aWYe4onmCJ1MhB5ZcM5R2dlAYV0EHeJdcAR/kPAkdTR6srjOjlF a6O1Z01dGLEfxjevnf6oXD+P8XqPiLcXHVC6l+ztnfW3XcjT7KUgQ/e/+isF9t24BsSQkk NLfNrB5JfB6rUPHHUg6xDqzkvQottffx5380YfbPnQzGAsWDiW/rT8CxZqvRRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703304665; a=rsa-sha256; cv=none; b=gFmE64aL7SJCDmFbhnvJdduGXK9r5ZBwcCrQAp04oew5nfSfAxqKGB9LLcGiNJ6PJ57ouN xFTNQ/l5NyjR5SNDSLSMr3spS2riJ5y3wy+U3GX521kaL9breIutf7jDD8x6Wmb1BcQ6+G YQ4zHr56DZgybFI+lcWVSq/EA5ab9CV6IFzVvy6mPzzl70IhsBubsWqG7KzmwEnovRpBew iG9vC/AyQ7JMTMX080H1WBuI3aqOOGYKVwBREKQ7QHJekUMSNn2hHxpMy8cpUo3gX2ZkwN JJyGFHFLRmu7DVlC3mqiYQh97xdBwU8G+lH+3ODfARuJ5oie4liFfL7/OIU8vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703304665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=doBCRNMupLDt6KQFYXAWx6ZX7htI79fnEhR6Yz11Zr0=; b=VhnZbAiC0NaTwCtqrzQhljNKUYpPWNtFAF7xOSYM8fAJGTOA0MromOFCNYn8qFChOfuq7s yqnEE8RDSQRimiIzskiDzGOasKKmXHgRR1WSBNkwMn7R1HRh1sjQrUp+j4w7iPgqq8ZCRy G1rvQsAKKVOzimKuYFqRwEaJLHOqboHj+mWbvWjfISbgYkWL++JXxSq3SMB8CaZ4QWsuBW 8MlGD/Lye/mQjRidopLHfRk/iAeP7IwJidwSpW2z89c6P1qt83WMwn3djTKZdXTtDH+Swf PTmw1HbCmdCJBiB+sNt+an8MfsthGp9rsERGM7A5hI7ZKLEDkWN0KThupwfkFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxrLx1xQSzlJv; Sat, 23 Dec 2023 04:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4B50u047164; Sat, 23 Dec 2023 04:11:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4B5tH047161; Sat, 23 Dec 2023 04:11:05 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:11:05 GMT Message-Id: <202312230411.3BN4B5tH047161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 8c86b9812403 - main - iichid(4): Improve idle sampling hysteresis List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 8c86b981240324c1daaa387d4d3f8e3e53db3d2e Auto-Submitted: auto-generated The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8c86b981240324c1daaa387d4d3f8e3e53db3d2e commit 8c86b981240324c1daaa387d4d3f8e3e53db3d2e Author: Alexander Motin AuthorDate: 2023-12-23 03:50:52 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 03:50:52 +0000 iichid(4): Improve idle sampling hysteresis In sampling mode some devices return same data indefinitely even if there is nothing to report. Previous idle hysteresis implementation activated only when device returned no data, so some devices ended up polled at fast rate all the time. This new implementation compares each new report with the previous, and, if they are identical, after reaching threshold also drop sampling rate to slow. On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this reduces idle power consumption by ~0.5W by reducing number of context switches in the driver from ~4000 to ~700 per second when not touched. MFC after: 1 month --- sys/dev/iicbus/iichid.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 7ab5b61d9be8..1035088c11b5 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -108,7 +108,7 @@ enum { */ #define IICHID_SAMPLING_RATE_FAST 60 #define IICHID_SAMPLING_RATE_SLOW 10 -#define IICHID_SAMPLING_HYSTERESIS 1 +#define IICHID_SAMPLING_HYSTERESIS 12 /* ~ 2x fast / slow */ /* 5.1.1 - HID Descriptor Format */ struct i2c_hid_desc { @@ -177,9 +177,12 @@ struct iichid_softc { int sampling_rate_fast; int sampling_hysteresis; int missing_samples; /* iicbus lock */ - struct timeout_task periodic_task; /* iicbus lock */ + int dup_samples; /* iicbus lock */ + iichid_size_t dup_size; /* iicbus lock */ bool callout_setup; /* iicbus lock */ + uint8_t *dup_buf; struct taskqueue *taskqueue; + struct timeout_task periodic_task; /* iicbus lock */ struct task event_task; #endif @@ -523,7 +526,7 @@ iichid_event_task(void *context, int pending) device_t parent; iichid_size_t actual; bool bus_requested; - int error; + int error, rate; sc = context; parent = device_get_parent(sc->dev); @@ -541,18 +544,30 @@ iichid_event_task(void *context, int pending) if (actual > 0) { sc->intr_handler(sc->intr_ctx, sc->intr_buf, actual); sc->missing_samples = 0; - } else - ++sc->missing_samples; + if (sc->dup_size != actual || + memcmp(sc->dup_buf, sc->intr_buf, actual) != 0) { + sc->dup_size = actual; + memcpy(sc->dup_buf, sc->intr_buf, actual); + sc->dup_samples = 0; + } else + ++sc->dup_samples; + } else { + if (++sc->missing_samples == 1) + sc->intr_handler(sc->intr_ctx, sc->intr_buf, 0); + sc->dup_samples = 0; + } } else DPRINTF(sc, "read error occurred: %d\n", error); rearm: if (sc->callout_setup && sc->sampling_rate_slow > 0) { - if (sc->missing_samples == sc->sampling_hysteresis) - sc->intr_handler(sc->intr_ctx, sc->intr_buf, 0); - taskqueue_enqueue_timeout(sc->taskqueue, &sc->periodic_task, - hz / MAX(sc->missing_samples >= sc->sampling_hysteresis ? - sc->sampling_rate_slow : sc->sampling_rate_fast, 1)); + if (sc->missing_samples >= sc->sampling_hysteresis || + sc->dup_samples >= sc->sampling_hysteresis) + rate = sc->sampling_rate_slow; + else + rate = sc->sampling_rate_fast; + taskqueue_enqueue_timeout_sbt(sc->taskqueue, &sc->periodic_task, + SBT_1S / MAX(rate, 1), 0, C_PREL(1)); } out: if (bus_requested) @@ -725,6 +740,8 @@ iichid_reset_callout(struct iichid_softc *sc) /* Start with slow sampling. */ sc->missing_samples = sc->sampling_hysteresis; + sc->dup_samples = 0; + sc->dup_size = 0; taskqueue_enqueue(sc->taskqueue, &sc->event_task); return (0); @@ -812,6 +829,7 @@ iichid_intr_setup(device_t dev, device_t child __unused, hid_intr_t intr, sc->intr_buf = malloc(rdesc->rdsize, M_DEVBUF, M_WAITOK | M_ZERO); sc->intr_bufsize = rdesc->rdsize; #ifdef IICHID_SAMPLING + sc->dup_buf = malloc(rdesc->rdsize, M_DEVBUF, M_WAITOK | M_ZERO); taskqueue_start_threads(&sc->taskqueue, 1, PI_TTY, "%s taskq", device_get_nameunit(sc->dev)); #endif @@ -825,6 +843,7 @@ iichid_intr_unsetup(device_t dev, device_t child __unused) sc = device_get_softc(dev); #ifdef IICHID_SAMPLING taskqueue_drain_all(sc->taskqueue); + free(sc->dup_buf, M_DEVBUF); #endif free(sc->intr_buf, M_DEVBUF); } From nobody Sat Dec 23 04:33:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxrsD343Pz54xLy; Sat, 23 Dec 2023 04:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxrsD2Qk7z3Sd6; Sat, 23 Dec 2023 04:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEyOVsCxxNIC37Peb6lRnfAKQcYrRt5G/xm7G/3OSlQ=; b=cJ6p7WAg+c5o70s70U4pxY/IxXZE9S3N5M43DBvCU5aZTtlB+6TkYepyPsVUcEEETrIELe q3p3We0l2xuO3+u/MaJuErnh+9IjCowak8X+zFS4HONbTNMU712sRgrOLcxdYf4LdCPZnt hXaQ5jZxFp+kAhO5m6qo1EyzB3JqKkZgV0rFXwjl87ho9xT7VHnJ7rMYCpOAPaEaFDpZ0M JjOW6F5NATpsUnv3jXQMzaYmqWmtbuMA7Y01OsxLyFCd+ff8DtkNslMk0mHuascEXwcvPZ 2nvfGzB10GvggpWwXKKAZnAL0UWr67ZeA4XL6PNdvSzISeUHth6/kugzzrDRyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703306032; a=rsa-sha256; cv=none; b=CZK58YW0yG5mpeSWwDEm4m8OOhcO5UjU2upvxs5KqV55emgmjoFYkkELFYnJdGJ+Tjm0Et X/Te2NjVQOv7JympSJdBG4+QgcbPDaNHhadFPwNkFRn9mj5czjLlf4ITfIHkKzgX7sOlsG OO3n2BRMRZeFFsmSbtOWSNXvrVwUxm00x+j4oylJRakvlKwW0HHCX8UHZICEbD+59F4Vs4 xMOk2jNycGjHOE3zgJNq+OUldM6ryNrtYBJP0f+d1JTAVC7UBqT86r+1aQIeLH4S9DG0gm DLjndsTX+VrV3IMM2G3NNx3/OWnfQIpKXHeGGA0Rvf1qQK5BAwriSo4n0Q8jtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EEyOVsCxxNIC37Peb6lRnfAKQcYrRt5G/xm7G/3OSlQ=; b=jGhoNVoDpW1Qwmrl1VCGn9hn9XGEhg0C/y+JV+jX1pdIZdznXxAKs7fk/ZbwgLHiUzRpjz 539YjXGa5VOjuF4ciT3NwUhRSbt4ri9J+LicYByuiNSSVVK4mbnO83yHggoFCSz0xjUbDE YJmobtDtN1IT1kaLlLWqiYTXzhkbfAcqsxKx2O22H+9l2PziehJKjlKsmiw6iYqgjEfAse 5tyiNTrL6nskMotMRvbGA3zq1I25bUOYvfgkeugmk8j0CesJX/RRgs/JM/cCLHvuaUggUp HemGZ3Xenkz3HCiTx5xOzFytVj5mcNi474NJVAUgHTQnVYmeT1RpyEOo3ypvcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxrsD1WC2zlrV; Sat, 23 Dec 2023 04:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4XquC087718; Sat, 23 Dec 2023 04:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4Xqcg087715; Sat, 23 Dec 2023 04:33:52 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:33:52 GMT Message-Id: <202312230433.3BN4Xqcg087715@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: b65b88dc3af4 - stable/14 - vmstat: Make disks reporting some more reasonable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b65b88dc3af4282af18f04a8e2106bf98cf4c385 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b65b88dc3af4282af18f04a8e2106bf98cf4c385 commit b65b88dc3af4282af18f04a8e2106bf98cf4c385 Author: Alexander Motin AuthorDate: 2023-11-16 03:56:51 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 04:13:24 +0000 vmstat: Make disks reporting some more reasonable MFC after: 1 month (cherry picked from commit 7b21c447fb7b761f094c3c2ce2e6d6e2c91c285c) --- usr.bin/vmstat/vmstat.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index fd161a3f93ee..c4fb7186363f 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -221,12 +221,13 @@ main(int argc, char *argv[]) memf = nlistf = NULL; interval = reps = todo = 0; maxshowdevs = 2; - hflag = isatty(1); argc = xo_parse_args(argc, argv); if (argc < 0) return (argc); + hflag = (xo_get_style(NULL) == XO_STYLE_TEXT) && isatty(1); + while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:sw:z")) != -1) { switch (c) { case 'a': @@ -818,28 +819,30 @@ dovmstat(unsigned int interval, int reps) rate(sum.v_tfree - osum.v_tfree), 5, 0); prthuman("scanned", rate(sum.v_pdpages - osum.v_pdpages), 5, 0); - xo_emit(" "); } else { xo_emit(" "); xo_emit("{:freed/%5lu} ", rate(sum.v_tfree - osum.v_tfree)); - xo_emit("{:scanned/%4lu} ", + xo_emit("{:scanned/%4lu}", rate(sum.v_pdpages - osum.v_pdpages)); } xo_close_container("paging-rates"); devstats(); xo_open_container("fault-rates"); - xo_emit("{:interrupts/%4lu}", rate(sum.v_intr - osum.v_intr)); if (hflag) { + prthuman("interrupts", + rate(sum.v_intr - osum.v_intr), 5, 0); prthuman("system-calls", rate(sum.v_syscall - osum.v_syscall), 5, 0); prthuman("context-switches", rate(sum.v_swtch - osum.v_swtch), 5, 0); } else { xo_emit(" "); - xo_emit("{:system-calls/%5lu} " + xo_emit("{:interrupts/%4lu} " + "{:system-calls/%5lu} " "{:context-switches/%5lu}", + rate(sum.v_intr - osum.v_intr), rate(sum.v_syscall - osum.v_syscall), rate(sum.v_swtch - osum.v_swtch)); } @@ -878,9 +881,9 @@ printhdr(int maxid, u_long cpumask) else xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); if (num_shown > 1) - xo_emit(" {T:/disks %*s} ", num_shown * 4 - 7, ""); + xo_emit(" {T:/disks %*s} ", num_shown * 5 - 7, ""); else if (num_shown == 1) - xo_emit(" {T:disks}"); + xo_emit(" {T:disks} "); xo_emit(" {T:faults} "); if (Pflag) { for (i = 0; i <= maxid; i++) { @@ -900,8 +903,7 @@ printhdr(int maxid, u_long cpumask) for (i = 0; i < num_devices; i++) if ((dev_select[i].selected) && (dev_select[i].selected <= maxshowdevs)) - xo_emit("{T:/%c%c%d} ", dev_select[i].device_name[0], - dev_select[i].device_name[1], + xo_emit("{T:/%3.3s%d} ", dev_select[i].device_name, dev_select[i].unit_number); xo_emit(" {T:in} {T:sy} {T:cs}"); if (Pflag) { @@ -1154,11 +1156,15 @@ devstats(void) xo_errx(1, "%s", devstat_errbuf); xo_open_instance("device"); - xo_emit("{ekq:name/%c%c%d}{:transfers/%3.0Lf} ", - dev_select[dn].device_name[0], - dev_select[dn].device_name[1], - dev_select[dn].unit_number, - transfers_per_second); + xo_emit("{ekq:name/%s%d}", + dev_select[dn].device_name, + dev_select[dn].unit_number); + if (hflag) { + prthuman("transfers", (uint64_t)transfers_per_second, + 5, HN_DIVISOR_1000); + } else { + xo_emit("{:transfers/%3.0Lf}", transfers_per_second); + } xo_close_instance("device"); } xo_close_list("device"); From nobody Sat Dec 23 04:33:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxrsF4gN9z54x7k; Sat, 23 Dec 2023 04:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxrsF3T4nz3Sg8; Sat, 23 Dec 2023 04:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evxagdjLyfMP0YqLUbYIQ98RzKlEeCnaJSMh+dgbXIY=; b=kyCiqmWC53zPDfrWwE8IRuHiiTOQpZvAy41I8IbZJ/6y8lgY5UOgjZ3Cb+9zxd6hx3RW1D d/3woyE6mqZWqCLqpMDLZqWxrkAuoqHCkdEva+OWd7OWUNjJdjOa65+8f3x80N6WXrAAIF BkOEw85sw7JaeQ31PLbcx5J+yYXBsTPCZFbD6tkU1LJOSWLcVZ44DYVFTFZHbU/4MLtVcA C35msOAW10NO01tss1GU/2V8HnBVe76NjsJ1O8gY8RGSY5CuUEi2UGQTuRWUDWT4WeZ9XE kytC70Y0Z4WSIdf9l6Hufaz5NYZK0b3qFMBMZnXHSoP+tXsYvoCgGMzXqFKQNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703306033; a=rsa-sha256; cv=none; b=vBL4OnGOSbSqbf2FGO9i1f3Pz/PNwmQTM0kwk0HrS7pANTB8v+hgbWaWxdZhegXo7uJD2B sFDjn9cBXI2ktT8BahroyHBnolkTnIcyZsYY47DDOUQZi6u6ZtmfIsl6qmRYltc0TQd0GV L9A9OWsm7QqABsjTK3dlEfd6l9i4GYRbJW0Rk+rvibljMjXXefmBjuEnili1AGZZqXZfge kpeyH7kOcuJuylx5pam8YsYdrbLMB4ZsRdMZBV/ThiaHonK0WxTj9WXiJywEx9QA14hA+G mE/mp7zghhTuPMUR2QxpiiHMtXUjVqAdE27CSxjsp2O6hmf8mbF2ji5CwyWgwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evxagdjLyfMP0YqLUbYIQ98RzKlEeCnaJSMh+dgbXIY=; b=BkJvI2DvJDG/LY+XfZ2c6R3Otq0KwB8EwRHIHrzLwxvNZUebZbAoqm+bEWHok8VocfVvxk oH8n+0UDPsK8rSoyvdzAjQuYBgQ6B4sDjZbwRqBv9Xt9OdABL6edhZ2/n6ZLmh02aBZ/Y6 Li+MpNyf5ok7UstW3HoC7oC1khMShWxGCnu89YkTxfEuGA7w2BaPp4Uccl2dK4JxZFtjfa 9jJS0SdRvCrvMXfvW99+a6K6V7LnISGWmauf1BaTtlfuLDP9zXeibpTIMbBlBOoiWLhWVS 5QwLrjzH4qOaWSX+8n8pFd5rPP+fzXkqdj9hm+LeXuzcg0kcTK1kK1lpWBzeYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxrsF2XK8zm84; Sat, 23 Dec 2023 04:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4XrJn087766; Sat, 23 Dec 2023 04:33:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4XrkI087763; Sat, 23 Dec 2023 04:33:53 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:33:53 GMT Message-Id: <202312230433.3BN4XrkI087763@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: b0b4dedfa163 - stable/14 - vmstat: Improve -z formatting for large names/values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: b0b4dedfa163623e8ab2c3f76480c7041ade2c2e Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b0b4dedfa163623e8ab2c3f76480c7041ade2c2e commit b0b4dedfa163623e8ab2c3f76480c7041ade2c2e Author: Alexander Motin AuthorDate: 2023-12-06 19:55:58 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 04:13:24 +0000 vmstat: Improve -z formatting for large names/values MFC after: 2 weeks (cherry picked from commit 6f048e71304310db80a210d07cb3768de18589c8) --- usr.bin/vmstat/vmstat.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index c4fb7186363f..a72ba127f40c 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1468,8 +1468,7 @@ domemstat_zone(void) { struct memory_type_list *mtlp; struct memory_type *mtp; - int error; - char name[MEMTYPE_MAXNAME + 1]; + int error, len; mtlp = memstat_mtl_alloc(); if (mtlp == NULL) { @@ -1494,20 +1493,20 @@ domemstat_zone(void) } } xo_open_container("memory-zone-statistics"); - xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} {T:/%8s} " - "{T:/%4s} {T:/%4s}\n", "ITEM", "SIZE", - "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP", "XDOMAIN"); + xo_emit("{T:/%-19s} {T:/%7s} {T:/%7s} {T:/%8s} {T:/%8s} {T:/%8s} " + "{T:/%4s} {T:/%4s} {T:/%4s}\n", "ITEM", "SIZE", + "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP", "XDOM"); xo_open_list("zone"); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; mtp = memstat_mtl_next(mtp)) { - strlcpy(name, memstat_get_name(mtp), MEMTYPE_MAXNAME); - strcat(name, ":"); + len = strlen(memstat_get_name(mtp)); xo_open_instance("zone"); - xo_emit("{d:name/%-20s}{ke:name/%s} {:size/%6ju}, " - "{:limit/%6ju},{:used/%8ju}," + xo_emit("{k:name/%s}:{d:size/%*ju}{e:size/%ju}," + "{:limit/%7ju},{:used/%8ju}," "{:free/%8ju},{:requests/%8ju}," - "{:fail/%4ju},{:sleep/%4ju},{:xdomain/%4ju}\n", name, - memstat_get_name(mtp), + "{:fail/%4ju},{:sleep/%4ju},{:xdomain/%4ju}\n", + memstat_get_name(mtp), MAX(1, 26 - len), + (uintmax_t)memstat_get_size(mtp), (uintmax_t)memstat_get_size(mtp), (uintmax_t)memstat_get_countlimit(mtp), (uintmax_t)memstat_get_count(mtp), From nobody Sat Dec 23 04:33:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxrsH16MJz54xGF; Sat, 23 Dec 2023 04:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxrsG4SnJz3Swt; Sat, 23 Dec 2023 04:33:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HmtLWENQP3l2zNkdJhoT9ElXLD4JA2SlqwvcKBogRQg=; b=m4xJwnC8mwZVAEdSfNUT27/DpBjomJ7GAJRcU/4OYbLNEqKSP1HpivXWk4j+0V7oFD9H5Q ECUzZC1eF+cR0F3bjz0EphMRLMqYIgs0tWxB1RSrCSQZjk6jp03KkoqHUl+x8DQGDNsCaT kyo7qYz+jg0zOKIrEml/dxCrkyLey+YRJT4b1TiVm+mgOO2ZfrudjUgaC8ZMzLoamHn4Xv rpp5JLbPIOxXXpJQNejqDuVeA/xeKke1tz43q+ie+It1ucN90QH83/pcYvxKtEwT8/E/2F uHbAJb1iR7zyAqQfBT0JOES0xym4TQThoP1xaByb2smqXg0LqLFlx76nxRl28w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703306034; a=rsa-sha256; cv=none; b=JtrUdbjd3MfkI89AcUHVrRMeuash/2ZgUxpeekxgZ2C1AtcvlNO6fo4D+rnF3hzPYMDTFF Zw+hWqNf4wQGNtK237/Jyp73RJqEczDVRIXLvnGLFjA7Y0/nANmkG44UclcV+F/7vMArQC wcB6re+Ldz9S86lmJl/qa268vCFA0GkdFU5jhDsPTsPd/qJixKdeaSgU3cvkFwHeZR9d7c wLpEzCIOB6vSbS8C4VmL0dUUxb0nX27IdocupqkEcm6fdsABb2TWSJozIK11PCrfRNJalq +Mi6r8qx9+FmfFU/ifNsl4YBt2Fc+puhka03k1QLud37criHwYIsPiHD3LT4gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HmtLWENQP3l2zNkdJhoT9ElXLD4JA2SlqwvcKBogRQg=; b=FdTrFjZ7oLR4C6iY+wkwZ17S0noUN5LMGNv72gKGfSdIaH1jJkFNdQsyZxyRWrbw/BJ2Hz wmzKSDBb3lKWPcIGDFPpDjJ5ZpLtUYFuvztMIGot6KzEtPXPIFJYXCgcejQz9b8XOrgy+z y6jXDoFmK1Mhjz89TE1TQJjYgLVcvSjZVSFHoLIGm+Y7HhSYTzpfxJNl+rI3uiPycVInb0 Wd6DvGvQXqTGaqupQAzPXbdSgcGEaykWeZle+gzySD/Xlc2JOf5BhWB4dEXWI8J6bHIXtY mTFce9EXjgGngVw4q+A59BRpPnO9dOc3ge+GKbKm68NydoIDTqOTMxYD1EIfWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxrsG3Z2fzlpM; Sat, 23 Dec 2023 04:33:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4XsDm087814; Sat, 23 Dec 2023 04:33:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4XsTn087811; Sat, 23 Dec 2023 04:33:54 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:33:54 GMT Message-Id: <202312230433.3BN4XsTn087811@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: bf5635d594cb - stable/14 - vmstat: Let libxo properly humanize -m numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: bf5635d594cb59d4ffe147600cfcc48ffec44916 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=bf5635d594cb59d4ffe147600cfcc48ffec44916 commit bf5635d594cb59d4ffe147600cfcc48ffec44916 Author: Alexander Motin AuthorDate: 2023-12-07 04:08:45 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 04:13:24 +0000 vmstat: Let libxo properly humanize -m numbers Raw numbers can be seen in json/xml or with --libxo=no-humanize. MFC after: 2 weeks (cherry picked from commit 598d1ac85e87d9312b9fd3266908ab6a6768edc6) --- usr.bin/vmstat/vmstat.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index a72ba127f40c..6ef718864886 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1429,8 +1429,8 @@ domemstat_malloc(void) } } xo_open_container("malloc-statistics"); - xo_emit("{T:/%13s} {T:/%5s} {T:/%6s} {T:/%8s} {T:Size(s)}\n", - "Type", "InUse", "MemUse", "Requests"); + xo_emit("{T:/%16s} {T:/%4s} {T:/%5s} {T:/%3s} {T:Size(s)}\n", + "Type", "Use", "Memory", "Req"); xo_open_list("memory"); zones = memstat_malloc_zone_get_count(); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; @@ -1439,10 +1439,12 @@ domemstat_malloc(void) memstat_get_count(mtp) == 0) continue; xo_open_instance("memory"); - xo_emit("{k:type/%13s/%s} {:in-use/%5ju} " - "{:memory-use/%5ju}{U:K} {:requests/%8ju} ", + xo_emit("{k:type/%16s/%s} " + "{[:4}{h,hn-decimal,hn-1000:in-use/%ju}{]:} " + "{[:5}{h,hn-decimal:memory-use/%ju}{]:} " + "{[:4}{h,hn-decimal,hn-1000:requests/%ju}{]:} ", memstat_get_name(mtp), (uintmax_t)memstat_get_count(mtp), - ((uintmax_t)memstat_get_bytes(mtp) + 1023) / 1024, + (uintmax_t)memstat_get_bytes(mtp), (uintmax_t)memstat_get_numallocs(mtp)); first = 1; xo_open_list("size"); @@ -1450,7 +1452,7 @@ domemstat_malloc(void) if (memstat_malloc_zone_used(mtp, i)) { if (!first) xo_emit(","); - xo_emit("{l:size/%d}", memstat_malloc_zone_get_size(i)); + xo_emit("{lh:size/%d}", memstat_malloc_zone_get_size(i)); first = 0; } } From nobody Sat Dec 23 04:33:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SxrsH712Cz54x0D; Sat, 23 Dec 2023 04:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxrsH5d1Rz3Sx7; Sat, 23 Dec 2023 04:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/DK6YAgBEe72QNdUqS1yeAwfJCfC870mMhqGzUt8ik=; b=AsFqBuK4VxVxGKq6+uVOkU2/qeNZeCHO9gvImGhykJs0yycjPQ6WgHmzPNwW4Aqv8/elJl sD0vnmyKNkejKY8thKSwTJv71W8iMzBTSybIvKSFUh4Kxjy+FNFxTApSMPJFyQYeZKFc5n hLpt64KLIzNYokAatRc9iPJOgJ1qkuqbDOl9JWzYjUoy+3+NSPli9klK4aWsfG3ZoDEdcZ OmV3xqqExLf3Gm1A5f0msqtOvt7l8GL2QUjtXM3Jzf9f7uk878QLtS5kKDMhPBYcfORtSp P3EQUGR/TC8kqasX7G1ofy5tinzyJ2Y7VOMq2Cpa56bq/rV1JE/4Wnsd+56iRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703306035; a=rsa-sha256; cv=none; b=FFAaoZfisGSwyLzZJwhdxQ3Y9nCcJk4Vofl682nV/bL4eRgZePLWyKgFuUwyur8mpNrypt M87PkBxVvpZL9niVJ3si9yT9i+qFGAvrjUkSRimfuWRUxCtwfkqIaCcYJzNHIG/QSETh+i GiWu0I/7wbPU3UbuQuxofl54kWAzjEnmNX1Ceau37QZBN4ThQ65ghtn4ScijVg7FEaw2cs 9IIiEX36xLkzzw5sFxdGxIP6mef8uWizLdbevwfHplbbnBTdOpmMLs+/WZB6skvD8rXbPH mZbKeH+B9t5Kr8H7SDUKjnU4He6q0cJPO1k+0yYr/fvCDFvAGgkfmEXqiW42eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/DK6YAgBEe72QNdUqS1yeAwfJCfC870mMhqGzUt8ik=; b=MUzXwiP6VHykPeIMiX1cWZB+79lpwrodU4FWIv8dbfziizzU33o5uRTHUPuv+pbiWVLlZ6 61jhNX12foO33yMJiu31RK7KJi+WuQq7t33dRk4ocuRWGPN5PeULBApVCBPx+83snMKFDj 5DEV29HmEI2HgK537V+XyBd76cEUfw0/EYHU7Xj7ut+iAvJfRfIsIjVvIV6uYqJHJZpUYQ em2ipvIEZfI/VneVW3qRPZNfRBNjU8CBz3GjVnsWbm7KN5hFHbZzUR7FTs4VSK+KOiEMIB KsfMglwTQAUNR8KPRC9kSEJCF6N5nZt9BU+uc+V0AnVPgrXo4fgDrkX2u3zSmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SxrsH4dBHzlpN; Sat, 23 Dec 2023 04:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4Xt8V087862; Sat, 23 Dec 2023 04:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4XtvF087859; Sat, 23 Dec 2023 04:33:55 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:33:55 GMT Message-Id: <202312230433.3BN4XtvF087859@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: 473dc8e1ba2f - stable/14 - vmstat: Rely on libxo for numbers humanization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 473dc8e1ba2fdcb080d1d3fccad72e97957ffc99 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=473dc8e1ba2fdcb080d1d3fccad72e97957ffc99 commit 473dc8e1ba2fdcb080d1d3fccad72e97957ffc99 Author: Alexander Motin AuthorDate: 2023-12-08 02:21:35 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 04:13:24 +0000 vmstat: Rely on libxo for numbers humanization This makes code cleaner, plus fixes such nonsense as humanized JSON and XML, making all numbers raw without quotes, spaces, suffixes, etc. MFC after: 2 weeks (cherry picked from commit 1f36ca5de596f7c2eb446df5b8e06877901d727a) --- usr.bin/vmstat/vmstat.c | 169 +++++++++++++++--------------------------------- 1 file changed, 52 insertions(+), 117 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 6ef718864886..48da1343a71c 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -226,7 +226,7 @@ main(int argc, char *argv[]) if (argc < 0) return (argc); - hflag = (xo_get_style(NULL) == XO_STYLE_TEXT) && isatty(1); + hflag = isatty(1); while ((c = getopt(argc, argv, "ac:fhHiM:mN:n:oPp:sw:z")) != -1) { switch (c) { @@ -295,6 +295,8 @@ main(int argc, char *argv[]) argv += optind; xo_set_version(VMSTAT_XO_VERSION); + if (!hflag) + xo_set_options(NULL, "no-humanize"); if (todo == 0) todo = VMSTAT; @@ -639,23 +641,6 @@ getcpuinfo(u_long *maskp, int *maxidp) *maxidp = maxid; } - -static void -prthuman(const char *name, uint64_t val, int size, int flags) -{ - char buf[10]; - char fmt[128]; - - snprintf(fmt, sizeof(fmt), "{:%s/%%*s}", name); - - if (size < 5 || size > 9) - xo_errx(1, "doofus"); - flags |= HN_NOSPACE | HN_DECIMAL; - humanize_number(buf, size, val, "", HN_AUTOSCALE, flags); - xo_attr("value", "%ju", (uintmax_t) val); - xo_emit(fmt, size, buf); -} - static void dovmstat(unsigned int interval, int reps) { @@ -782,27 +767,13 @@ dovmstat(unsigned int interval, int reps) total.t_pw, total.t_sw); xo_close_container("processes"); xo_open_container("memory"); -#define vmstat_pgtok(a) ((uintmax_t)(a) * (sum.v_page_size >> 10)) #define rate(x) (unsigned long)(((x) * rate_adj + halfuptime) / uptime) - if (hflag) { - prthuman("available-memory", - total.t_avm * (uint64_t)sum.v_page_size, 5, HN_B); - prthuman("free-memory", - total.t_free * (uint64_t)sum.v_page_size, 5, HN_B); - prthuman("total-page-faults", - rate(sum.v_vm_faults - osum.v_vm_faults), 5, 0); - xo_emit(" "); - } else { - xo_emit(" "); - xo_emit("{:available-memory/%7ju}", - vmstat_pgtok(total.t_avm)); - xo_emit(" "); - xo_emit("{:free-memory/%7ju}", - vmstat_pgtok(total.t_free)); - xo_emit(" "); - xo_emit("{:total-page-faults/%5lu} ", - rate(sum.v_vm_faults - osum.v_vm_faults)); - } + xo_emit(" {[:4}{h,hn-decimal:available-memory/%ju}{]:}", + (uintmax_t)total.t_avm * sum.v_page_size); + xo_emit(" {[:4}{h,hn-decimal:free-memory/%ju}{]:}", + (uintmax_t)total.t_free * sum.v_page_size); + xo_emit(" {[:4}{h,hn-decimal,hn-1000:total-page-faults/%lu}{]:} ", + rate(sum.v_vm_faults - osum.v_vm_faults)); xo_close_container("memory"); xo_open_container("paging-rates"); @@ -814,38 +785,20 @@ dovmstat(unsigned int interval, int reps) xo_emit("{:paged-out/%3lu}", rate(sum.v_swapout + sum.v_vnodeout - (osum.v_swapout + osum.v_vnodeout))); - if (hflag) { - prthuman("freed", - rate(sum.v_tfree - osum.v_tfree), 5, 0); - prthuman("scanned", - rate(sum.v_pdpages - osum.v_pdpages), 5, 0); - } else { - xo_emit(" "); - xo_emit("{:freed/%5lu} ", - rate(sum.v_tfree - osum.v_tfree)); - xo_emit("{:scanned/%4lu}", - rate(sum.v_pdpages - osum.v_pdpages)); - } + xo_emit(" {[:4}{h,hn-decimal,hn-1000:freed/%lu}{]:}", + rate(sum.v_tfree - osum.v_tfree)); + xo_emit(" {[:4}{h,hn-decimal,hn-1000:scanned/%lu}{]:}", + rate(sum.v_pdpages - osum.v_pdpages)); xo_close_container("paging-rates"); devstats(); xo_open_container("fault-rates"); - if (hflag) { - prthuman("interrupts", - rate(sum.v_intr - osum.v_intr), 5, 0); - prthuman("system-calls", - rate(sum.v_syscall - osum.v_syscall), 5, 0); - prthuman("context-switches", - rate(sum.v_swtch - osum.v_swtch), 5, 0); - } else { - xo_emit(" "); - xo_emit("{:interrupts/%4lu} " - "{:system-calls/%5lu} " - "{:context-switches/%5lu}", - rate(sum.v_intr - osum.v_intr), - rate(sum.v_syscall - osum.v_syscall), - rate(sum.v_swtch - osum.v_swtch)); - } + xo_emit(" {[:4}{h,hn-decimal,hn-1000:interrupts/%lu}{]:}" + " {[:4}{h,hn-decimal,hn-1000:system-calls/%lu}{]:}" + " {[:4}{h,hn-decimal,hn-1000:context-switches/%lu}{]:}", + rate(sum.v_intr - osum.v_intr), + rate(sum.v_syscall - osum.v_syscall), + rate(sum.v_swtch - osum.v_swtch)); xo_close_container("fault-rates"); if (Pflag) pcpustats(cpumask, maxid); @@ -876,10 +829,7 @@ printhdr(int maxid, u_long cpumask) int i, num_shown; num_shown = MIN(num_selected, maxshowdevs); - if (hflag) - xo_emit(" {T:procs} {T:memory} {T:/page%*s}", 19, ""); - else - xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); + xo_emit(" {T:procs} {T:memory} {T:/page%*s}", 19, ""); if (num_shown > 1) xo_emit(" {T:/disks %*s} ", num_shown * 5 - 7, ""); else if (num_shown == 1) @@ -893,13 +843,8 @@ printhdr(int maxid, u_long cpumask) xo_emit("\n"); } else xo_emit(" {T:cpu}\n"); - if (hflag) { - xo_emit(" {T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} {T:re}" - " {T:pi} {T:po} {T:fr} {T:sr} "); - } else { - xo_emit("{T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} " - "{T:re} {T:pi} {T:po} {T:fr} {T:sr} "); - } + xo_emit(" {T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} {T:re}" + " {T:pi} {T:po} {T:fr} {T:sr} "); for (i = 0; i < num_devices; i++) if ((dev_select[i].selected) && (dev_select[i].selected <= maxshowdevs)) @@ -1159,64 +1104,53 @@ devstats(void) xo_emit("{ekq:name/%s%d}", dev_select[dn].device_name, dev_select[dn].unit_number); - if (hflag) { - prthuman("transfers", (uint64_t)transfers_per_second, - 5, HN_DIVISOR_1000); - } else { - xo_emit("{:transfers/%3.0Lf}", transfers_per_second); - } + xo_emit("{[:5}{h,hn-decimal,hn-1000:transfers/%ju}{]:}", + (uintmax_t)transfers_per_second); xo_close_instance("device"); } xo_close_list("device"); } static void -percent(const char *name, double pctv, int *over) +percent(const char *name, long pctv, int *over) { - int l; - char buf[10]; - char fmt[128]; - - snprintf(fmt, sizeof(fmt), " {:%s/%%*s}", name); - l = snprintf(buf, sizeof(buf), "%.0f", pctv); - if (l == 1 && *over) { - xo_emit(fmt, 1, buf); + char fmt[64]; + + snprintf(fmt, sizeof(fmt), " {:%s/%%%ulld/%%lld}", name, + (*over && pctv <= 9) ? 1 : 2); + xo_emit(fmt, pctv); + if (*over && pctv <= 9) (*over)--; - } else - xo_emit(fmt, 2, buf); - if (l > 2) + else if (pctv >= 100) (*over)++; } static void cpustats(void) { - double lpct, total; + long total; int state, over; total = 0; for (state = 0; state < CPUSTATES; ++state) total += cur.cp_time[state]; - if (total > 0) - lpct = 100.0 / total; - else - lpct = 0.0; + if (total == 0) + total = 1; over = 0; xo_open_container("cpu-statistics"); - percent("user", (cur.cp_time[CP_USER] + cur.cp_time[CP_NICE]) * lpct, - &over); - percent("system", (cur.cp_time[CP_SYS] + cur.cp_time[CP_INTR]) * lpct, - &over); - percent("idle", cur.cp_time[CP_IDLE] * lpct, &over); + percent("user", 100LL * (cur.cp_time[CP_USER] + cur.cp_time[CP_NICE]) / + total, &over); + percent("system", 100LL * (cur.cp_time[CP_SYS] + cur.cp_time[CP_INTR]) / + total, &over); + percent("idle", 100LL * cur.cp_time[CP_IDLE] / total, &over); xo_close_container("cpu-statistics"); } static void pcpustats(u_long cpumask, int maxid) { - double lpct, total; - long tmp; - int i, over, state; + long tmp, total; + int i, state, over; /* devstats does this for cp_time */ for (i = 0; i <= maxid; i++) { @@ -1240,15 +1174,16 @@ pcpustats(u_long cpumask, int maxid) total = 0; for (state = 0; state < CPUSTATES; ++state) total += cur_cp_times[i * CPUSTATES + state]; - if (total) - lpct = 100.0 / total; - else - lpct = 0.0; - percent("user", (cur_cp_times[i * CPUSTATES + CP_USER] + - cur_cp_times[i * CPUSTATES + CP_NICE]) * lpct, &over); - percent("system", (cur_cp_times[i * CPUSTATES + CP_SYS] + - cur_cp_times[i * CPUSTATES + CP_INTR]) * lpct, &over); - percent("idle", cur_cp_times[i * CPUSTATES + CP_IDLE] * lpct, + if (total == 0) + total = 1; + percent("user", + 100LL * (cur_cp_times[i * CPUSTATES + CP_USER] + + cur_cp_times[i * CPUSTATES + CP_NICE]) / total, &over); + percent("system", + 100LL * (cur_cp_times[i * CPUSTATES + CP_SYS] + + cur_cp_times[i * CPUSTATES + CP_INTR]) / total, &over); + percent("idle", + 100LL * cur_cp_times[i * CPUSTATES + CP_IDLE] / total, &over); xo_close_instance("cpu"); } From nobody Sat Dec 23 04:37:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxrxg6LGGz54xKR; Sat, 23 Dec 2023 04:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxrxg4k2mz3Tl8; Sat, 23 Dec 2023 04:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvDsm3yFQNrZGk5ZJMOc/rvxqLsUVqbfMNgsi0IuQ6o=; b=WGfpqD2xswCSRrU0yX3QHOo5p8MDmI502/M1IMw8EzzrOcUZ9M3vDKWIwVH0C/SDcqgm4K oTVGhpsSOiIXUhRJuoaqN+oxwNs/0PogFtwGYzmRDqPEczpojZQeuRmxfMPlMWYmmibwVE 76pAtGif73k/dXAq74a1ThhUjjml9DkFmNQiwOK5ixuYvHAUNFd5kfcvBN8exShS7h76gI 8p94DP8+VmCwScbpFzzRsyznDBI+bzyJsOjN6Tl8jnY2bLQGQ1e+yqia+OgKxwDEUAV0ng 1i23y+fCPvP6kTRmjqun+gzX2ICoZy2zzBJ8hA2ZvKqLVCpChzKrYW0K9RV7AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703306263; a=rsa-sha256; cv=none; b=fysj+Gu5avE2uHeURhzZs46PTLPLQ8wV9TGI+liw2yIXCGjz+ZGJFX07v++mV4/0Q+PokN xJWRHNS+WiK14e4nptRoDMGSlxhC1Q6Sd3Kq2jVMmOSRWZCaypjqwLP/x7NICYmo/NoW2F CSXDs+T3+TqW24hSiRTH+zbFhZ7KbBxc/6fCBlUkJSRDDe5jJRfZJLKGUUws6esRHpXAuq kMzzRIUJ4ucb+ABLzFTgYCxJrKPBogGsRz0hEu56zEaxuJCdNh6r7xrYrx2Mx428ZItion Hzq3jmPegffq9p1/DrCR4wobiBSpllYnScc11dZ8GTA1bh0UKoeN6TlTSdNAYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703306263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jvDsm3yFQNrZGk5ZJMOc/rvxqLsUVqbfMNgsi0IuQ6o=; b=bleNE4Blw4Lcpjc+sAEMxpB6nUE1HpEJlXeL6JWdP6Ym9s1nAgXDk06pNawEI8cdI1uApn aH2bqTN89hs8whXJY7h/d8ypq5HxpnzQozNJAf4/1UY54teBbI7Ps/+l6bGmRuOsvIP1el XtPq6wBERxVrPIxyR6Z/tswwFRIb375pn8MvQWiY+6VabgLRBDWk6Wchr5OYkKvbBxAKcr bnW18tGO0OE3lNy1l9DRyReSfKBXbkV1h5SqNUtZDCIuo5Gw4D4gTJIcJaupPg6DZWjNCr Lk/tL5OnI7VTaXNu7s044dOECocLCwKtwxB/DJKwVB4fNgkixatApGhGe4rppA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxrxg3nSZzm5b; Sat, 23 Dec 2023 04:37:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN4bhsa088496; Sat, 23 Dec 2023 04:37:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN4bhLp088493; Sat, 23 Dec 2023 04:37:43 GMT (envelope-from git) Date: Sat, 23 Dec 2023 04:37:43 GMT Message-Id: <202312230437.3BN4bhLp088493@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: 129c3aa4b231 - stable/14 - Use xpt_path_sbuf() in few drivers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 129c3aa4b2312e3e2d91e5688a4368fc3836db98 Auto-Submitted: auto-generated The branch stable/14 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=129c3aa4b2312e3e2d91e5688a4368fc3836db98 commit 129c3aa4b2312e3e2d91e5688a4368fc3836db98 Author: Alexander Motin AuthorDate: 2023-11-23 16:25:45 +0000 Commit: Alexander Motin CommitDate: 2023-12-23 04:36:56 +0000 Use xpt_path_sbuf() in few drivers xpt_path_string() is now a wrapper around xpt_path_sbuf(). Using it to than concatenate result to another sbuf makes no sense. Just call xpt_path_sbuf() directly. MFC after: 1 month (cherry picked from commit 8c4ee0b22c98fc1e208dd133f617bd329cd10728) --- sys/dev/mpr/mpr_sas.c | 5 +---- sys/dev/mps/mps_sas.c | 5 +---- sys/dev/virtio/scsi/virtio_scsi.c | 4 +--- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index 9d83162723ae..048b3cb7a53d 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -304,7 +304,6 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...) struct sbuf sb; va_list ap; char str[224]; - char path_str[64]; if (cm == NULL) return; @@ -318,9 +317,7 @@ mprsas_log_command(struct mpr_command *cm, u_int level, const char *fmt, ...) va_start(ap, fmt); if (cm->cm_ccb != NULL) { - xpt_path_string(cm->cm_ccb->csio.ccb_h.path, path_str, - sizeof(path_str)); - sbuf_cat(&sb, path_str); + xpt_path_sbuf(cm->cm_ccb->csio.ccb_h.path, &sb); if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) { scsi_command_string(&cm->cm_ccb->csio, &sb); sbuf_printf(&sb, "length %d ", diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index 6a5b2f5d90f3..3cf29aa4e893 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -295,7 +295,6 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...) struct sbuf sb; va_list ap; char str[224]; - char path_str[64]; if (cm == NULL) return; @@ -309,9 +308,7 @@ mpssas_log_command(struct mps_command *cm, u_int level, const char *fmt, ...) va_start(ap, fmt); if (cm->cm_ccb != NULL) { - xpt_path_string(cm->cm_ccb->csio.ccb_h.path, path_str, - sizeof(path_str)); - sbuf_cat(&sb, path_str); + xpt_path_sbuf(cm->cm_ccb->csio.ccb_h.path, &sb); if (cm->cm_ccb->ccb_h.func_code == XPT_SCSI_IO) { scsi_command_string(&cm->cm_ccb->csio, &sb); sbuf_printf(&sb, "length %d ", diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c index 0355962c7af9..163def248065 100644 --- a/sys/dev/virtio/scsi/virtio_scsi.c +++ b/sys/dev/virtio/scsi/virtio_scsi.c @@ -2336,7 +2336,6 @@ vtscsi_printf_req(struct vtscsi_request *req, const char *func, struct sbuf sb; va_list ap; char str[192]; - char path_str[64]; if (req == NULL) return; @@ -2352,8 +2351,7 @@ vtscsi_printf_req(struct vtscsi_request *req, const char *func, cam_sim_name(sc->vtscsi_sim), cam_sim_unit(sc->vtscsi_sim), cam_sim_bus(sc->vtscsi_sim)); } else { - xpt_path_string(ccb->ccb_h.path, path_str, sizeof(path_str)); - sbuf_cat(&sb, path_str); + xpt_path_sbuf(ccb->ccb_h.path, &sb); if (ccb->ccb_h.func_code == XPT_SCSI_IO) { scsi_command_string(&ccb->csio, &sb); sbuf_printf(&sb, "length %d ", ccb->csio.dxfer_len); From nobody Sat Dec 23 06:53:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxvxv0X3vz55545; Sat, 23 Dec 2023 06: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxvxt75ZZz3dJ2; Sat, 23 Dec 2023 06:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703314387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O7cqn389qbApTKBzzn5108fUwBp1+fL8KcwMl7LRSYQ=; b=k+S03sOWim6O4L0nj8v56pNaZNygQBYBNbLfCajajpG8FI8+ZmlertfCYe3uAFkNz0B2iz ydTIXMcTtN1XjWD4RVGWm2IyTbZX719F5y2T9mTO+xb9QyWe5bfT3RJrTQJM+8IPB35lx4 WWtOX2N47r0eCzoUkiVBmpmfdx8F6rKES1St6LQZTNNvoHdVbxvPXavvln3YGu4aSk3lcX QrjPJily1d4rBSxkxpkOTCn4sj6AbwDKYiUssXY6AMAtYE9MKO8OC3w19C6K8IfQd0t4Ts qthNqa/w0nUuqCSTJsgMMH7yb+UV6g5yE7RF3SK8CC3EuE/t9M73atqez4bJOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703314387; a=rsa-sha256; cv=none; b=v4KMs9k5CCutjzcWIz+4Lt66y1htVy918fhjVdexjE6IUDF3WiwVfVixnzhToAf4rGExtM xg8dfefCA1Xecu6iBVmfXoEZZFOJVrpUHZk+1rz28Ma/CfAxpHEZQRE8aADNQdFPFzuJT/ Z0ncNnbjk2V7kY5qf37eKa0fHp4f2hxW7bt3MqSXhAZ+DF2ZiAghz1zC/Xds5w4PB1/Ur4 7F4RcDBEcxrTX/NfSIGrFAIlNuSiTLRx5vaBx7rm5ZP4wyKZVpdHNxBT1eharSvdec4R1E gXqDpfpxLfoHmaKdwxdvNY4IftWlKJHbpBX0u9JO+5j/3Ydm52pDjQAGNAaG+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703314387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O7cqn389qbApTKBzzn5108fUwBp1+fL8KcwMl7LRSYQ=; b=wxqtMb7eJ2WfNs6zew20ES2UC3A5pIfRM5okcgcvJpisAO7cGvgTBzCZh5XKI055ngfyUo FNWlu/jQpXFc8mbswstnCOqZtQdn4NcHp3ykzZLtmsD7chVR3blXrSPLNkL/Wv3jRwT7Oj FvdR1APvtYyY7Kyykv1VSxaliVlHtSh7E4ml0zYvLns/aFDLKtIqYh/9jWM2oGwMtXUDex UM93bZBvzy/vXE9FbUSHjRr/Inkq4VjPAeHTPniTWqjci7QpbF3QDx+gMtg/A2K12f+o3E xVg757F32pr6a7zG/VIpH9LvX4BCavuEZfy4IgCPYkHttY1hk+f1uaYCR4ugZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxvxt68wtzqV2; Sat, 23 Dec 2023 06:53:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN6r6EN021313; Sat, 23 Dec 2023 06:53:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN6r6Fa021310; Sat, 23 Dec 2023 06:53:06 GMT (envelope-from git) Date: Sat, 23 Dec 2023 06:53:06 GMT Message-Id: <202312230653.3BN6r6Fa021310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 906748d208d3 - main - newsyslog(8): Add option to globally override compression 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 906748d208d356a59538dc009a8ad5db040968d9 Auto-Submitted: auto-generated The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=906748d208d356a59538dc009a8ad5db040968d9 commit 906748d208d356a59538dc009a8ad5db040968d9 Author: Xin LI AuthorDate: 2023-12-23 06:46:33 +0000 Commit: Xin LI CommitDate: 2023-12-23 06:46:33 +0000 newsyslog(8): Add option to globally override compression method. Historically, newsyslog compressed rotated log files to save disk space. This was useful in the early days. However, with modern file systems like ZFS offering native compression, and with the availability of larger hard drives, the benefits of additional compression have become less significant. This is particularly true considering the inconvenience of decompressing log files when searching for specific patterns. Additionally, the original implementation of compression methods was not future-proof. As a result, we have redefined the J, X, Y, Z flags to signify "treat the file as compressible" rather than "compress the file with that specific method." A new command-line option, -c, has been introduced to allow overriding these settings in a more future-proof way. The available choices are: * none - do not compress, regardless of flag. * legacy - historical behavior: J=bzip2, X=xz, Y=zstd, Z=gzip. * bzip2, xz, zstd, gzip - apply the specified compression method. Currently, the default is set to 'legacy' to preserve historical behavior. However, our intention is to change this default to 'none' in FreeBSD 15.0. Additionally, this update changes the default settings for zstd to use multithreading and long-range options, better aligning with its intended use. Inspired by D42961 . Reviewed by: debdrup (earlier version, mdoc(7)) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43165 --- usr.sbin/newsyslog/newsyslog.8 | 22 +++++++- usr.sbin/newsyslog/newsyslog.c | 110 ++++++++++++++++++++++++++++-------- usr.sbin/newsyslog/newsyslog.conf.5 | 30 +++++++--- 3 files changed, 129 insertions(+), 33 deletions(-) diff --git a/usr.sbin/newsyslog/newsyslog.8 b/usr.sbin/newsyslog/newsyslog.8 index ed1a917d2ce2..6d4fc378e790 100644 --- a/usr.sbin/newsyslog/newsyslog.8 +++ b/usr.sbin/newsyslog/newsyslog.8 @@ -14,7 +14,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd November 10, 2018 +.Dd December 22, 2023 .Dt NEWSYSLOG 8 .Os .Sh NAME @@ -24,6 +24,7 @@ .Nm .Op Fl CFNPnrsv .Op Fl a Ar directory +.Op Fl c Ar none Ns | Ns Ar legacy Ns | Ns Ar bzip2 Ns | Ns Ar gzip Ns | Ns Ar xz Ns | Ns Ar zstd .Op Fl d Ar directory .Op Fl f Ar config_file .Op Fl S Ar pidfile @@ -78,6 +79,25 @@ and mode three (above) assumes that this is so. The following options can be used with .Nm : .Bl -tag -width indent +.It Fl c Ar none Ns | Ns Ar legacy Ns | Ns Ar bzip2 Ns | Ns Ar gzip Ns | Ns Ar xz Ns | Ns Ar zstd +Instructs +.Nm +to use the specified compression method when a file is flagged for compression. +The default method is +.Dq legacy , +which interprets the +.Sy J, X, Y, Z +flags in the configuration file according to their historical meanings. +This default setting can be overridden by specifying +.Fl c Ar none , +which causes +.Nm +to ignore all compression flags. +Alternatively, specifying one of the compression methods: +.Sy bzip2 , gzip , xz , +or +.Sy zstd , +will apply the chosen method to all files flagged for compression. .It Fl f Ar config_file Instruct .Nm diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index c867237d212c..a08e7b903707 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -88,13 +88,15 @@ /* * Compression types */ -#define COMPRESS_TYPES 5 /* Number of supported compression types */ - -#define COMPRESS_NONE 0 -#define COMPRESS_GZIP 1 -#define COMPRESS_BZIP2 2 -#define COMPRESS_XZ 3 -#define COMPRESS_ZSTD 4 +enum compress_types_enum { + COMPRESS_NONE = 0, + COMPRESS_GZIP = 1, + COMPRESS_BZIP2 = 2, + COMPRESS_XZ = 3, + COMPRESS_ZSTD = 4, + COMPRESS_LEGACY = 5, /* Special: use legacy type */ + COMPRESS_TYPES = COMPRESS_LEGACY /* Number of supported compression types */ +}; /* * Bit-values for the 'flags' parsed from a config-file entry. @@ -127,6 +129,7 @@ #define MAX_OLDLOGS 65536 /* Default maximum number of old logfiles */ struct compress_types { + const char *name; /* Name of compression type */ const char *flag; /* Flag in configuration file */ const char *suffix; /* Compression suffix */ const char *path; /* Path to compression program */ @@ -137,14 +140,29 @@ struct compress_types { static const char *gzip_flags[] = { "-f" }; #define bzip2_flags gzip_flags #define xz_flags gzip_flags -static const char *zstd_flags[] = { "-q", "--rm" }; - -static const struct compress_types compress_type[COMPRESS_TYPES] = { - { "", "", "", NULL, 0 }, - { "Z", ".gz", _PATH_GZIP, gzip_flags, nitems(gzip_flags) }, - { "J", ".bz2", _PATH_BZIP2, bzip2_flags, nitems(bzip2_flags) }, - { "X", ".xz", _PATH_XZ, xz_flags, nitems(xz_flags) }, - { "Y", ".zst", _PATH_ZSTD, zstd_flags, nitems(zstd_flags) } +static const char *zstd_flags[] = { "-q", "-T0", "--adapt", "--long", "--rm" }; + +static struct compress_types compress_type[COMPRESS_TYPES] = { + [COMPRESS_NONE] = { + .name = "none", .flag = "", .suffix = "", + .path = "", .flags = NULL, .nflags = 0 + }, + [COMPRESS_GZIP] = { + .name = "gzip", .flag = "Z", .suffix = ".gz", + .path = _PATH_GZIP, .flags = gzip_flags, .nflags = nitems(gzip_flags) + }, + [COMPRESS_BZIP2] = { + .name = "bzip2", .flag = "J", .suffix = ".bz2", + .path = _PATH_BZIP2, .flags = bzip2_flags, .nflags = nitems(bzip2_flags) + }, + [COMPRESS_XZ] = { + .name = "xz", .flag = "X", .suffix = ".xz", + .path = _PATH_XZ, .flags = xz_flags, .nflags = nitems(xz_flags) + }, + [COMPRESS_ZSTD] = { + .name = "zstd", .flag = "Y", .suffix = ".zst", + .path = _PATH_ZSTD, .flags = zstd_flags, .nflags = nitems(zstd_flags) + }, }; struct conf_entry { @@ -229,6 +247,7 @@ static char *timefnamefmt = NULL;/* Use time based filenames instead of .0 */ static char *archdirname; /* Directory path to old logfiles archive */ static char *destdir = NULL; /* Directory to treat at root for logs */ static const char *conf; /* Configuration file to use */ +static enum compress_types_enum compress_type_override = COMPRESS_LEGACY; /* Compression type */ struct ptime_data *dbg_timenow; /* A "timenow" value set via -D option */ static struct ptime_data *timenow; /* The time to use for checking at-fields */ @@ -628,7 +647,7 @@ do_entry(struct conf_entry * ent) static void parse_args(int argc, char **argv) { - int ch; + int ch, i; char *p; timenow = ptime_init(NULL); @@ -641,12 +660,28 @@ parse_args(int argc, char **argv) hostname_shortlen = strcspn(hostname, "."); /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:S:")) != -1) + while ((ch = getopt(argc, argv, "a:c:d:f:nrst:vCD:FNPR:S:")) != -1) switch (ch) { case 'a': archtodir++; archdirname = optarg; break; + case 'c': + for (i = 0; i < COMPRESS_TYPES; i++) { + if (strcmp(optarg, compress_type[i].name) == 0) { + compress_type_override = i; + break; + } + } + if (i == COMPRESS_TYPES) { + if (strcmp(optarg, "legacy") == 0) + compress_type_override = COMPRESS_LEGACY; + else { + warnx("Unrecognized compression method '%s'.", optarg); + usage(); + } + } + break; case 'd': destdir = optarg; break; @@ -791,10 +826,26 @@ parse_doption(const char *doption) static void usage(void) { + int i; + char *alltypes = NULL, *tmp = NULL; + + for (i = 0; i < COMPRESS_TYPES; i++) { + if (i == COMPRESS_NONE) { + (void)asprintf(&tmp, "%s|legacy", compress_type[i].name); + } else { + (void)asprintf(&tmp, "%s|%s", alltypes, compress_type[i].name); + } + if (alltypes) + free(alltypes); + alltypes = tmp; + tmp = NULL; + } fprintf(stderr, - "usage: newsyslog [-CFNPnrsv] [-a directory] [-d directory] [-f config_file]\n" - " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n"); + "usage: newsyslog [-CFNPnrsv] [-a directory] [-c %s]\n" + " [-d directory] [-f config_file]\n" + " [-S pidfile] [-t timefmt] [[-R tagname] file ...]\n", + alltypes); exit(1); } @@ -1302,7 +1353,10 @@ no_trimat: working->flags |= CE_GLOB; break; case 'j': - working->compress = COMPRESS_BZIP2; + if (compress_type_override == COMPRESS_LEGACY) + working->compress = COMPRESS_BZIP2; + else + working->compress = compress_type_override; break; case 'n': working->flags |= CE_NOSIGNAL; @@ -1323,13 +1377,22 @@ no_trimat: /* Deprecated flag - keep for compatibility purposes */ break; case 'x': - working->compress = COMPRESS_XZ; + if (compress_type_override == COMPRESS_LEGACY) + working->compress = COMPRESS_XZ; + else + working->compress = compress_type_override; break; case 'y': - working->compress = COMPRESS_ZSTD; + if (compress_type_override == COMPRESS_LEGACY) + working->compress = COMPRESS_ZSTD; + else + working->compress = compress_type_override; break; case 'z': - working->compress = COMPRESS_GZIP; + if (compress_type_override == COMPRESS_LEGACY) + working->compress = COMPRESS_GZIP; + else + working->compress = compress_type_override; break; case '-': break; @@ -2035,6 +2098,7 @@ do_zipwork(struct zipwork_entry *zwork) assert(zwork->zw_conf != NULL); assert(zwork->zw_conf->compress > COMPRESS_NONE); assert(zwork->zw_conf->compress < COMPRESS_TYPES); + assert(zwork->zw_conf->compress != COMPRESS_LEGACY); if (zwork->zw_swork != NULL && zwork->zw_swork->sw_runcmd == 0 && zwork->zw_swork->sw_pidok <= 0) { diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5 index 3ca833f90196..a53af5b38319 100644 --- a/usr.sbin/newsyslog/newsyslog.conf.5 +++ b/usr.sbin/newsyslog/newsyslog.conf.5 @@ -18,7 +18,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd February 26, 2021 +.Dd December 22, 2023 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -308,8 +308,11 @@ for details on syntax and matching rules. .It Cm J indicates that .Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using +should consider the rotated log file as compressible. +In legacy mode, +this also tells +.Xr newsyslog 8 +to use .Xr bzip2 1 . .It Cm N indicates that there is no process which needs to be signaled @@ -337,20 +340,29 @@ be a negative value to distinguish it from a process ID. .It Cm X indicates that .Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using +should consider the rotated log file as compressible. +In legacy mode, +this also tells +.Xr newsyslog 8 +to use .Xr xz 1 . .It Cm Y indicates that .Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using +should consider the rotated log file as compressible. +In legacy mode, +this also tells +.Xr newsyslog 8 +to use .Xr zstd 1 . .It Cm Z indicates that .Xr newsyslog 8 -should attempt to save disk space by compressing the rotated -log file using +should consider the rotated log file as compressible. +In legacy mode, +this also tells +.Xr newsyslog 8 +to use .Xr gzip 1 . .It Fl a minus sign will not cause any special processing, but it From nobody Sat Dec 23 09:50:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxztm3drSz54H58; Sat, 23 Dec 2023 09:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxztm22XZz4P54; Sat, 23 Dec 2023 09:50:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703325040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcjMgJBi043Tl/PYzyyKqafUgdnYoKhalNllGna22UM=; b=V/H9vr0agg1moAUUmWJL4J/09a1NGMcmamZeFE3h56tznC1o6EqSIzWAeJjXLbXe6RxTLP nbPtsPuiDleQZvOB4UDB5sM0Vt6y8Ie+PRCLPs1HkDzEeI2LhV+KpodASyppnr2x3IJJ7T XtgQY5JAh5oUMcJuhUWQkoaMzncrqbr5Etn61xMMqUEy3KaSGv0THGs+dbG9cs1FfdudbR BdgyXTJv0UlrVmyRmyC/GXMtcUCrM3vz4Vvqqs8U7OaO+7QddRJsNzFfv0oGrOu7q9iTSq MnPeo083Lay3MwrQ3Evm+YMxAoKzAy6h326tphZ9LvASB46NcUC1uoXJO+T2GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703325040; a=rsa-sha256; cv=none; b=OFEa5cbQ2jBhaMEtPErEicjxYYZq26Od3iQFNKbUi+XyJkwi+pCEzlkEiJGCOt9cIx7dyz E5nVylm8eZbOgpn6KzvsoBzKIFIp1ClRxe0KqDFP6Qh7B4YLHOpwBOT5wFScihQtg7/TXa 0mwUY13lhO2643pZ17EqnKm/3MsgVK4LBYI0BTBNanK+5dLbhsXoeLUyLu9Sm7shk2vgK2 C/7sfN9cQcx6QZgGJs6UxTh0qvrb94wsHkvbO2Zw90Wj4eRsHKZwDfw2ixJeCL/stEguMv DX9mM110swWs9pVe5xPHWxeyQEhHPIm2Y3nGChG+FdaVZO86TUQMb20GH8CSqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703325040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fcjMgJBi043Tl/PYzyyKqafUgdnYoKhalNllGna22UM=; b=XfzgJ9oPvWdzl1joACIDr4bwjgT0nFlrPnKzeM+3XyQKp6hsPqQ7iuE4Ekty2+a/GpkZ8y G7wTmeTr7Ahw04Ze9ArqgKDg1UCcLkvgDGEG9RGi389w1C8zGm6PnNTNcD3vfCEfGMaIcT WLXtGmB6ZOhfH0Ci/xi+tolwTCEmKSqQBGHuNpsrnnpi/gpDGYXUY7xCZXmlIKRUgkGlMQ SlB6au8ytdlMCoDhgl39JbrpH2gCVvL65jt6Lv65As25eiTXgHFc7UVYSzWymdEysyBnN3 2oR9m7Swhvp8Ox/fjCtRNy8D9WC0b5Kqzr2505h5J4AVfKMNgduH2j1BXhHauw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxztl6rG2zvkR; Sat, 23 Dec 2023 09:50:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN9odBJ015271; Sat, 23 Dec 2023 09:50:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN9odKH015268; Sat, 23 Dec 2023 09:50:39 GMT (envelope-from git) Date: Sat, 23 Dec 2023 09:50:39 GMT Message-Id: <202312230950.3BN9odKH015268@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: c9b27b3dc047 - stable/14 - rtnetlink.4: Fix a typo in the manual pag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: c9b27b3dc047f20371e567dfe4354c1531cb7a8c Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=c9b27b3dc047f20371e567dfe4354c1531cb7a8c commit c9b27b3dc047f20371e567dfe4354c1531cb7a8c Author: Gordon Bergling AuthorDate: 2023-12-20 09:06:08 +0000 Commit: Gordon Bergling CommitDate: 2023-12-23 09:50:25 +0000 rtnetlink.4: Fix a typo in the manual pag - s/constists/consists/ (cherry picked from commit fa826f64e1b7167dde2c3cb8cfc4df0d3e503542) --- share/man/man4/rtnetlink.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 95cfeea39f5b..720a9cc75ef2 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -236,7 +236,7 @@ Should be provided by userland at the nexthtop creation time. .It Dv NHA_GROUP This attribute designates the nexthtop group and contains all of its nexthtops and their relative weights. -The attribute constists of a list of +The attribute consists of a list of .Va nexthop_grp structures: .Bd -literal From nobody Sat Dec 23 09:50:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sxzv407vYz54HYY; Sat, 23 Dec 2023 09:50:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sxzv36l5Lz4P74; Sat, 23 Dec 2023 09:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703325055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xh3cFCtzcW40GjfvKhntamyzIqXgELaQyUsxxrGBKI4=; b=QUA+tdtmNnuXPoeyJPEr5mHbGRXjZQtpV5XNZ9KBhLew2AXNmMQ9lEDYBo903MtHB1G66M Fb/StsOKNu6/1fuHF3hzVfboayqaRFEx5BnLVlQcYt/Rc/hGvEj5M3IqHw7L9XsYrVcuzT zheI7Zt5kzBSxmzNnLp9CfUy+Vhn4qeHlXszCHZsz3JwIYlZW8UPyrUJWXrf+2gbu+hTUc IR+AGoYR5xbncbtUu0nDv1avQZ+Vv2ThBNGNEKNdl3KilZA7QzWtTKg+wiLKERszhtptNq r2THyH7duDZS6nzXfKmiwgiyw7qiFGjcvbcDZMs0Z1OxdmlwxM99ZEuQRT10fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703325055; a=rsa-sha256; cv=none; b=MutaDaE5IvpzEeLAqpnG6kZ1gSD+Wn6bK2WuqLgdeB880GcBGQoyIo9RWdKeWMhzsNMwc+ idjojnwLpMqqVZmgfmTqchs1PlAYpekb0j2uDFWZO+R1gyyBxcceY8Hw8CDPnBthV58skI dqAcbK4M0QPw/MtW9PBFXm1IZuTSBnA9IGZwlttUXqwSiCW5aRyPvelTzQyu//5R6AmPhX t/gBgBKRcYEkFbsUltBWeWnCzndF2xukBBSwn1XHx3CCp+epN3u7/OinJ306xaoWIfT9RG 5jhlOiUZItD3NcRzAjDkd3+8xQvVY/XQ7sQeDvi0kDbu868daerWFaZ8OHUKgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703325055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xh3cFCtzcW40GjfvKhntamyzIqXgELaQyUsxxrGBKI4=; b=vM4AQfpMzXASWOn16BofOkiaYjJ5hp9dYQPxfvjErqLeShTWa6MzwSec0d4FsuBJ7XyLM8 9JNW1p8axDSUX2u6RKu74XKW+2mTGE8q673O9XPO0MYR7/Q3wGmEmRKiWgX8XyI5TN+pzm 8wre+eGtH0p/Sq/gI41y+oyk8hfXACD4BaEAWHDO3/nbW54dfwtodMaxRix2RIbVB08Rer kpfXCTxxGbU25Hs8I2Nlh2hvfFZguEy922xzIZglSOCUBXFWlLXSzx2409/AZN2SJbc5tC YUbrKW991FhpTedhVN01Y4/hjaAv42cZXBAJtTMcCaPlSbB5bwlIJbpRgiacYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sxzv35nqxzv6Z; Sat, 23 Dec 2023 09:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BN9ot5r015453; Sat, 23 Dec 2023 09:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BN9ottu015450; Sat, 23 Dec 2023 09:50:55 GMT (envelope-from git) Date: Sat, 23 Dec 2023 09:50:55 GMT Message-Id: <202312230950.3BN9ottu015450@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: 03943195a95f - stable/13 - rtnetlink.4: Fix a typo in the manual pag List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/13 X-Git-Reftype: branch X-Git-Commit: 03943195a95f5252ecef6f38e4608dca8a213c43 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=03943195a95f5252ecef6f38e4608dca8a213c43 commit 03943195a95f5252ecef6f38e4608dca8a213c43 Author: Gordon Bergling AuthorDate: 2023-12-20 09:06:08 +0000 Commit: Gordon Bergling CommitDate: 2023-12-23 09:50:44 +0000 rtnetlink.4: Fix a typo in the manual pag - s/constists/consists/ (cherry picked from commit fa826f64e1b7167dde2c3cb8cfc4df0d3e503542) --- share/man/man4/rtnetlink.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/rtnetlink.4 b/share/man/man4/rtnetlink.4 index 95cfeea39f5b..720a9cc75ef2 100644 --- a/share/man/man4/rtnetlink.4 +++ b/share/man/man4/rtnetlink.4 @@ -236,7 +236,7 @@ Should be provided by userland at the nexthtop creation time. .It Dv NHA_GROUP This attribute designates the nexthtop group and contains all of its nexthtops and their relative weights. -The attribute constists of a list of +The attribute consists of a list of .Va nexthop_grp structures: .Bd -literal From nobody Sat Dec 23 15:14:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sy74g3K45z54d42; Sat, 23 Dec 2023 15:14:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sy74g1drgz3KpM; Sat, 23 Dec 2023 15:14:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6d9a7233133so32529b3a.0; Sat, 23 Dec 2023 07:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703344481; x=1703949281; darn=freebsd.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=7VBSoseGS6ismH0CVvBfMhLEONaVnKF6yT8rlU+fLZU=; b=BnZ+WjEZA8AyW1pEh+R1dFnY8a20/rV4kSAtAvKLmiL2+P5Tbal0vd11E6z5+293ox /i7lWXQ3zg6VM0fEcJcmlPJoklrAAYpMFFkGLAvHjJC5YMjSIWXsYh4eLMoLFAE/H3Y5 8k2e1c33LKWRsmtk3b22UyV7PRZE4M6++2b+Q387S0mhHM/cGoevbti3QxOeg/rc5JmK 57tVWh91fKzKkydZ/GKOhx65yrkbnZOlmIEB8j0oVjhviHuloESZLY7iHiyRPm7PINha 82FmaDsTjb/yB8s4+lTdVa9Rb57CsdfxGBHdV9WQQOuXKpH8PzXLq9aLH/YO1lM8P7K2 OeFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703344481; x=1703949281; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7VBSoseGS6ismH0CVvBfMhLEONaVnKF6yT8rlU+fLZU=; b=IlK+tsSEVqZj4a40meFbwVSoFt2ZfjoI+OwpA2BAShlTYo8WUb4ihAFESOIcJ0hmBx /DGhOFQrawzgbTZwpp4uUGCkzKOQNXGr+UUUyhzNT4PiiIAsjaLHbyF1gN9FExLF8DpL qBUAsMZqZR2m0u3skUNfjgw2R96ewEEQlFQeXm1L5ncL2qW10BTc0W94MjRDIu2O1Md3 vJv0C5RTUOe1CkxNh9aTFZYTllDbnahlgKFzLVc/TAxZbATaX9qC/xQAe9d7T4qViLWM 5MUKJnqSp74oh+WLXGD9nQP3rQ4qbjMOE37QlhXv8Cc0jWDo1vRuG1e0KPnn/nPQc7sf 8NbA== X-Gm-Message-State: AOJu0YzGxzNDs/IPfoB/raRRgHg5kPlodXzbM8bYM8MygIhA6Z/uzmzD 9kSkUnZ9VcNsFuBlBJdtTh9XDeQU7G61mA== X-Google-Smtp-Source: AGHT+IG3etvM8nHGRX9pR0swimd0LITCyy8Q/nNFqQn/cF23XyRvlari7pZ46pvfT7bVTEiFJ1eCmg== X-Received: by 2002:a62:e717:0:b0:6d9:9de5:d121 with SMTP id s23-20020a62e717000000b006d99de5d121mr362502pfh.27.1703344480875; Sat, 23 Dec 2023 07:14:40 -0800 (PST) Received: from smtpclient.apple (c-24-19-32-101.hsd1.wa.comcast.net. [24.19.32.101]) by smtp.gmail.com with ESMTPSA id p2-20020a056a0026c200b006d99170ab87sm2408032pfw.182.2023.12.23.07.14.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Dec 2023 07:14:40 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: git: 906748d208d3 - main - newsyslog(8): Add option to globally override compression method. Date: Sat, 23 Dec 2023 07:14:29 -0800 Message-Id: <010500A1-E327-47D3-BFD1-141D0C828FE3@gmail.com> References: <202312230653.3BN6r6Fa021310@gitrepo.freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: <202312230653.3BN6r6Fa021310@gitrepo.freebsd.org> To: Xin LI X-Mailer: iPhone Mail (21B101) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4Sy74g1drgz3KpM > On Dec 22, 2023, at 22:53, Xin LI wrote: >=20 > =EF=BB=BFThe branch main has been updated by delphij: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D906748d208d356a59538dc009a8= ad5db040968d9 >=20 > commit 906748d208d356a59538dc009a8ad5db040968d9 > Author: Xin LI > AuthorDate: 2023-12-23 06:46:33 +0000 > Commit: Xin LI > CommitDate: 2023-12-23 06:46:33 +0000 >=20 > newsyslog(8): Add option to globally override compression method. >=20 > Historically, newsyslog compressed rotated log files to save disk space= . > This was useful in the early days. However, with modern file systems li= ke > ZFS offering native compression, and with the availability of larger ha= rd > drives, the benefits of additional compression have become less signifi= cant. > This is particularly true considering the inconvenience of decompressin= g > log files when searching for specific patterns. >=20 > Additionally, the original implementation of compression methods was no= t > future-proof. As a result, we have redefined the J, X, Y, Z flags to > signify "treat the file as compressible" rather than "compress the file= > with that specific method." >=20 > A new command-line option, -c, has been introduced to allow overriding > these settings in a more future-proof way. The available choices are: >=20 > * none - do not compress, regardless of flag. > * legacy - historical behavior: J=3Dbzip2, X=3Dxz, Y=3D= zstd, Z=3Dgzip. > * bzip2, xz, zstd, gzip - apply the specified compression method. >=20 > Currently, the default is set to 'legacy' to preserve historical behavi= or. > However, our intention is to change this default to 'none' in FreeBSD 1= 5.0. >=20 > Additionally, this update changes the default settings for zstd to use > multithreading and long-range options, better aligning with its intende= d > use. >=20 > Inspired by D42961 . >=20 > Reviewed by: debdrup (earlier version, mdoc(7)) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D43165 Relnotes: yes ?= From nobody Sat Dec 23 19:30:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyDmM0T51z54vJt; Sat, 23 Dec 2023 19:30:59 +0000 (UTC) (envelope-from kp@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SyDmL71MFz4FKQ; Sat, 23 Dec 2023 19:30:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703359859; 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=J2FA3Nsxi9+TkKoDLBBjbPzTk0FfHOLFXTIwOf7BRbs=; b=JvSfAsE8qi7s8y9OlX+RqJ/At+RmOFE9AV++fg+MPAf7qaVIHgiS+50w7LCrT9DsybUjos mgq4tB21VXQ/9QPw3EB76BggV+WsFoMwESX0gs82K97BOj8hdBVPQncVfHLg9J0fYAujoR oOsx7A8G3FydB8wtZCFo5Mk5vjlZWGZO91Uc/UX3+YvCOKaatoAXMgW0oUvba/ScBH1CVJ R8s4lqpFmFvylfLrwT63vUNvQ/UZry/Bd22JF4fQDCJO8/eAFaK87z92SPK5scdivcBRxJ 5S0ur/s6jeLkBx/trfLZfqVC3PuFsnuEgW5sYJb199ScxTvesicWkRuxmgh54A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703359859; a=rsa-sha256; cv=none; b=cNeMvUjryRWVk6/a30zWlHckWOat6o9IRa3UGdof6Bpk12syB7hYBgFa1k2PO3eJL842sQ SZZzAvTz03Hh6k8AqgWfVLquUlqmHBOLtnQJPW2Azb/JUigpqyGlkW91Fmwxa9lq1CR54r 6D5SxbRmqnAp73KBRT9NKXpT0qFm5L9tP/+rEVvt1y5viS/z2TH8q7Drm4f0xpMAPjTVb7 RG5wsPoU2l05A/YT6hUbQsmRdSbC7uMj3qvNhIhaKi01o5mFevvHUnL2ylxYi/mhrwOeBW jEjg4GWrAfK007/p9aS8TgdL09cOl9+Xg+EAsD7fXwOAABkvIgo9RZJuZPJ2Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703359859; 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=J2FA3Nsxi9+TkKoDLBBjbPzTk0FfHOLFXTIwOf7BRbs=; b=fpqOlOZqiXVq+V5OBBMNs9g966RTqRjnBz/hxgdxWBFWR4x5zXhjZYa+Sci8DN0YHqdN93 kn0wmEwFnDt3PBNWTbDfeSgupEs6KmwQPzPhcg1g86Gc3hIrRy8yb26Sd5Ie/NX5Z6tBvO Q37xS/vwy3Ip8cgLnjEVpOZN1xYYwI3h2vhlU6dj2sudzOk4UFE52Bn6S9RFvLTq55Z/nF N3dpXUTcq6mcd42a8JcG+wk84maFfaDuTMX7T+24yYEDDRfOHCxZvpuFkANfYT8V5P8lx8 bF20Mer2xrMrxpRoKZwCJAlwweZwbxxAA/+4BH3xPUh0tc1lmV/mG5Qd0IUZRg== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SyDmL4kBCz1Cgr; Sat, 23 Dec 2023 19:30:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 31D26170E6; Sat, 23 Dec 2023 20:30:56 +0100 (CET) From: Kristof Provost To: Brooks Davis , jrm@FreeBSD.org Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 8ccd0b876e67 - main - libc: expose execvpe for Linux compat Date: Sat, 23 Dec 2023 20:30:55 +0100 X-Mailer: MailMate (1.14r5937) Message-ID: In-Reply-To: <202312111927.3BBJRWon091352@gitrepo.freebsd.org> References: <202312111927.3BBJRWon091352@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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_478E9E23-66C9-48D3-A14C-E8D94C1F5B89_=" --=_MailMate_478E9E23-66C9-48D3-A14C-E8D94C1F5B89_= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Brooks, Joseph, On 11 Dec 2023, at 20:27, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D8ccd0b876e67fda6249f294ff4847= 98cc1e1569f > > commit 8ccd0b876e67fda6249f294ff484798cc1e1569f > Author: Brooks Davis > AuthorDate: 2023-12-11 19:24:53 +0000 > Commit: Brooks Davis > CommitDate: 2023-12-11 19:24:53 +0000 > > libc: expose execvpe for Linux compat > > We already implemented execvpe internally with an _ prefix in libc = > so > go ahead and expose it for compatibility with Linux. > > This reverts c605eea952146348e5e1ad5cab6c127d7a1bd164. > > Bump __FreeBSD_version for the addition and add definitions to = > supress > compat shims in libzfs (zfs changes were merged from upstream). > > PR: 275370 (request and exp-run (thanks antoine!)) > Reviewed by: kevans > Differential Revision: https://reviews.freebsd.org/D42846 I don=E2=80=99t understand why, but this breaks devel/bear (=E2=80=9CTool= that = generates a compilation database for clang tooling=E2=80=9D). Rather than generate a list of commands it seems to recursively spawn = endless =E2=80=9Cwrapper=E2=80=9D processes: ``` 82661 0 I+ 0:00.18 | | `-- bear -- ls 82662 0 I+ 0:06.90 | | `-- /usr/local/bin/bear intercept = --library /usr/local/lib/bear/libexec.so --wrapper = /usr/local/lib/bear/wrapper --wrapper-dir /usr/local/lib/bear/wr 82663 0 I+ 0:00.13 | | `-- /usr/local/lib/bear/wrapper = --destination dns:///localhost:30309 --execute /bin/ls -- ls 82664 0 I+ 0:00.09 | | `-- /usr/local/lib/bear/wrapper = --destination dns:///localhost:30309 --execute /bin/ls -- ls 82665 0 I+ 0:00.06 | | `-- = /usr/local/lib/bear/wrapper --destination dns:///localhost:30309 = --execute /bin/ls -- ls 82666 0 I+ 0:00.06 | | `-- = /usr/local/lib/bear/wrapper --destination dns:///localhost:30309 = --execute /bin/ls -- ls ``` It=E2=80=99s trivially reproducible at least. Without this patch `bear --= ls` = returns immediately and generates a compile_commands.json file (empty, = but that=E2=80=99s fine here). With it it=E2=80=99ll spin endlessly. Best regards, Kristof --=_MailMate_478E9E23-66C9-48D3-A14C-E8D94C1F5B89_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi Brooks, Joseph,

On 11 Dec 2023, at 20:27, Brooks Davis wrote:

The branch main has been updated by= brooks:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D8ccd0b876e67fda6249f294ff484798cc1e1569f

commit 8ccd0b876e67fda6249f294ff484798cc1e1569f
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-12-11 19:24:53 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-12-11 19:24:53 +0000

libc: expose execvpe for Linux compat

We already implemented execvpe internally with an _ p= refix in libc so
go ahead and expose it for compatibility with Linux.

This reverts c605eea952146348e5e1ad5cab6c127d7a1bd164= =2E

Bump __FreeBSD_version for the addition and add defin= itions to supress
compat shims in libzfs (zfs changes were merged from upstream).

PR: 275370 (request and exp-run (thanks a= ntoine!))
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42846

I don=E2=80=99t understand why, but this breaks devel/bea= r (=E2=80=9CTool that generates a compilation database for clang tooling=E2= =80=9D).

Rather than generate a list of commands it seems to recur= sively spawn endless =E2=80=9Cwrapper=E2=80=9D processes:

82=
661  0  I+       0:00.18 | |     `-- bear -- ls
82662  0  I+       0:06.90 | |       `-- /usr/local/bin/bear intercept --=
library /usr/local/lib/bear/libexec.so --wrapper /usr/local/lib/bear/wrap=
per --wrapper-dir /usr/local/lib/bear/wr
82663  0  I+       0:00.13 | |         `-- /usr/local/lib/bear/wrapper --=
destination dns:///localhost:30309 --execute /bin/ls -- ls
82664  0  I+       0:00.09 | |           `-- /usr/local/lib/bear/wrapper =
--destination dns:///localhost:30309 --execute /bin/ls -- ls
82665  0  I+       0:00.06 | |             `-- /usr/local/lib/bear/wrappe=
r --destination dns:///localhost:30309 --execute /bin/ls -- ls
82666  0  I+       0:00.06 | |               `-- /usr/local/lib/bear/wrap=
per --destination dns:///localhost:30309 --execute /bin/ls -- ls

It=E2=80=99s trivially reproducible at least. Without thi= s patch bea= r -- ls returns immediately and generates a compile_commands.json = file (empty, but that=E2=80=99s fine here). With it it=E2=80=99ll spin en= dlessly.

Best regards,
Kristof

--=_MailMate_478E9E23-66C9-48D3-A14C-E8D94C1F5B89_=-- From nobody Sat Dec 23 20:58:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyGj72BjGz550v5; Sat, 23 Dec 2023 20:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SyGj71WpSz4MPy; Sat, 23 Dec 2023 20:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703365099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M1gXcV1fGbQFDMZQTUv2V/OXzDlteHrMT6RUceAU2XQ=; b=giAethcuA7kW9CISyTsXJJwNsvtLHsnj1z56WZyHQypOGKNV5Ybg8mrzpxSAvfOByws359 6cr88SmsDTgNF158YIgMMn6FOc/waQCHYC8eoyxenj3uDmg/1tjeNF5dvzKPjkFuN1yrLt mt85VO8zPnpKvxme1ptxmGuCFuwXLDQIHJ7CXJaUWsUgJD6q1ybXyvNG6qV8fxkr5Opxwi 0iG7TNU0WGmpVMHuhkOiLbAaru8Qi4vYz6ka9NyAMG1YSIlQT/bVPK0QOVadEevMjTQ5ox IduxqdcenA1tN+VjPsyrL6go8D76gTQ4xTWP33A+NH4pihOG1BKvVRChXT8BJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703365099; a=rsa-sha256; cv=none; b=OxeYmu+7g8TFwEZHrlSuVUw6HTaA9SQakNGD3LuMDZjeFEUp5+I7NYS0EB1jq/mY4/1dXd 2jX22KXzxD0ZawJOnP3qxof4o+IL8SLWq4a4Tyqe8gfoIHRMAcNk5owmgoNoiSNxKdFKDX UKiy04kMZXbABtfFIl1UMAyAWtKZsC2hTG5Xwc/NDz8izSyZ4SloLDhqgc2222z7/4OwGt tOIrFD7YS3HQUhyOHBedEQ8fKTV8nXHAQcUEmH/HHlMsonikvsUKmOfd7NhvXwyEzpetrH MoK7xLx/iBKID5JES85JvHUuIhYx5yB1n4v144tS33pzLzaxfW2ZW2whuXScNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703365099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M1gXcV1fGbQFDMZQTUv2V/OXzDlteHrMT6RUceAU2XQ=; b=pD3KI7SGZF6wtqI/QlEUTXvNp05DcmLBuZEbWSldbzdHCO4HbmgsW2to0IRaedeWi3LULz DBv4GY6YehkPnNoQD8JlzK3f85XXW+Ho8VcB7RP1LiGzvxejqNgqcZ0YbZtTTGC4Iw0twe aSLmu87IyX0ZgBzJMAgRldL4js5M1YxuJspI0gLGefL0H0m4C1V9G2SBmLa4aaZ2RMiQKc UH9drnd9w6bIZXe7ijgAnKXPMZzaOkVpyijvqfpFYiMgnH1cw6Pn6lPvZ86eMm8OPO05sJ 3uPa/b+ZqA8qGAcOrtoXvTlY46chjy17wRlwI663tZhKUL2w5Lb8oTUra5kHFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SyGj70Ywdz1Dkw; Sat, 23 Dec 2023 20:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BNKwI7V029687; Sat, 23 Dec 2023 20:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BNKwIUV029684; Sat, 23 Dec 2023 20:58:18 GMT (envelope-from git) Date: Sat, 23 Dec 2023 20:58:18 GMT Message-Id: <202312232058.3BNKwIUV029684@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: 553ed8e38bfd - main - mlx4(5): fix driver initialization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 553ed8e38bfdd4832deecdec1c0b023824dcff94 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=553ed8e38bfdd4832deecdec1c0b023824dcff94 commit 553ed8e38bfdd4832deecdec1c0b023824dcff94 Author: Yuji Hagiwara AuthorDate: 2023-12-23 20:53:02 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-23 20:53:02 +0000 mlx4(5): fix driver initialization After netlinkification, ether_ifattach() requires ifmedia_init() to be done before it. PR: 275897 MFC after: 1 week --- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index c26afc0099b5..583de1816d1b 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -2293,7 +2293,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, dev_addr[ETHER_ADDR_LEN - 1 - i] = (u8) (priv->mac >> (8 * i)); - ether_ifattach(dev, dev_addr); if_link_state_change(dev, LINK_STATE_DOWN); ifmedia_init(&priv->media, IFM_IMASK | IFM_ETH_FMASK, mlx4_en_media_change, mlx4_en_media_status); @@ -2306,6 +2305,8 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, DEBUGNET_SET(dev, mlx4_en); + ether_ifattach(dev, dev_addr); + en_warn(priv, "Using %d TX rings\n", prof->tx_ring_num); en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num);

\x50 - \x51 - \x51 - \x52 - \x52 - \x53 - \x53 - \x54 - \x54 - \x55 - \x55 - \x56 - \x56 - \x57 - \x57 - \x58 - \x58 - \x59 - \x59 - \x5a - \x5a - \x5b - \x5c - \x5d - \x5e - \x5f - \x60 - \x61 - \x61 - \x62 - \x62 - \x63 - \x63 - \x64 - \x64 - \x65 - \x65 - \x66 - \x66 - \x67 - \x67 - \x68 - \x68 - \x69 - \x69 - \x6a - \x6a - \x6b - \x6b - \x6c - \x6c - \x6d - \x6d - \x6e - \x6e - \x6f - \x6f - \x70 -